// JavaScript Document
function highlightCalendarCell(element) {
		$(element).style.border = '1px solid #999999';
	}

function resetCalendarCell(element) {
		$(element).style.border = '1px solid #000000';
	}
	
function startCalendar(month, year) {
		new Ajax.Updater('calendarInternal', 'javascript/mysqlCalendar_1_2/rpc.php', {method: 'post', postBody: 'action=startCalendar&month='+month+'&year='+year+''});
	}
	
function displayEvents(day, month, year) {
		new Ajax.Updater('eventList', 'javascript/mysqlCalendar_1_2/rpc.php', {method: 'post', postBody: 'action=listEvents&&d='+day+'&m='+month+'&y='+year+''});
		if(Element.visible('eventList')) {
			// do nothing, its already visble.
		} else {
			setTimeout("Element.show('eventList')", 300);
		}
	}
	
function backward(month,year) {
	if(month == 1) 
	{
		month = 12;
		year --;
	}
	else
		month --;
		
	new Ajax.Updater('calendarInternal', 'javascript/mysqlCalendar_1_2/rpc.php', {method: 'post', postBody: 'action=startCalendar&month='+month+'&year='+year+''});
	} 
	
function forward(month,year) {
	if(month == 12) 
	{
		month = 1;
		year ++;
	}
	else
		month ++;
		
	new Ajax.Updater('calendarInternal', 'javascript/mysqlCalendar_1_2/rpc.php', {method: 'post', postBody: 'action=startCalendar&month='+month+'&year='+year+''});
	}