function highlightCalendarCell(element) {
		$(element).style.color = '#000000';
	}

	function resetCalendarCell(element) {
		$(element).style.color = '#ffffff';
	}
	
	function startCalendar(month, year, day) {
		new Ajax.Updater('calendarInternal', 'rpc.php', {method: 'post', postBody: 'action=startCalendar&month='+month+'&year='+year+''});
		if(month == 0) {displayEvents('<?php echo date("d"); ?>','<?php echo date("m"); ?>','<?php echo date("Y"); ?>'); }
		else {
		  displayEvents(day,month,year);
		}
	}
	
	function showEventForm(day) {
		$('evtDay').value = day;
		$('evtMonth').value = $F('ccMonth');
		$('evtYear').value = $F('ccYear');
		
		displayEvents(day, $F('ccMonth'), $F('ccYear'));
		
		if(Element.visible('addEventForm')) {
			// do nothing.
		} else {
			Element.show('addEventForm');
		}
	}
	
	function displayEvents(day, month, year) {
		new Ajax.Updater('lista_eventos', 'resultado_cal.php', {method: 'post', postBody: 'action=lista_eventos&&d='+day+'&m='+month+'&y='+year+''});
		if(Element.visible('lista_eventos')) {
			// do nothing, its already visble.
		} else {
			setTimeout("Element.show('lista_eventos')", 300);
		}
	}
	
	function highlightEvent(day) {
		Element.hide('addEventForm');
		$('calendarDay_'+day+'').style.background = '#<?= $eventColor ?>';
	}
	
	function showLoginBox() {
		Element.show('loginBox');
	}
	
	function showCP() {
		Element.show('cpBox');
	}	
