var lastElement;

	function highlightCalendarCell(element) {
		$(element).style.border = '1px solid #999999';
	}

	function resetCalendarCell(element) {
		$(element).style.border = '1px solid #fff';
	}
	
	function startCalendar(month, year) {
		new Ajax.Updater('calendarInternal', 'rpc.php', {method: 'post', postBody: 'action=startCalendar&month='+month+'&year='+year+''});
	}
	
	
	function showEventForm(element, day) {
		$('evtDay').value = day;
		$('evtMonth').value = $F('ccMonth');
		$('evtYear').value = $F('ccYear');
		$(element).style.background = '#ffff99 url(\'../images/lj-checkmark.png\')'; 
		if(Element.visible('addEventForm')) {
			// do nothing.
		} else {
			Element.show('addEventForm');
		}
		 if (lastElement != undefined) {
		
		$(lastElement).style.background = '#ffff99 url(images/available.gif)';
		}
		
		lastElement = element; 
	}	