function showEventWithId(evid) {
	for (var i=0; i<max_ev_live_count; i++) {
		var x = $("#right_live_id_"+i);
		if (i==evid)
            x.css('display','');
		else
            x.css('display','none');
	}
}
var ev_timer=0;
function initMainPageEvents() {
	// set the rotation timer
	if (max_ev_live_count > 1) {
		ev_timer = setInterval('nextEvent()', 2000);
		showEventWithId(cur_event_id);
	}
}

function nextEvent() {
	cur_event_id++;
	if (cur_event_id >= max_ev_live_count)
		cur_event_id = 0;
	showEventWithId(cur_event_id);
}

function prevEvent() {
	cur_event_id--;
	if (cur_event_id < 0)
		cur_event_id = eval(max_ev_live_count - 1);
	showEventWithId(cur_event_id);
}
