/*
addLoadEvent(function() {
	CALENDAR.inicio();
});

function mealsHistoric(jsonData)
{
	for(i=0;i<jsonData.length; i++)
	{
		$("." + jsonData[i]['meal_date']).css({'color' : 'green','font-weight' : 'bold', 'cursor' : 'pointer'});
	}
}

CALENDAR  = {

	inicio : function() 
	{
		Date.firstDayOfWeek = 1;
		Date.format = 'dd/mm/yyyy';
		
		divId = String($(".calendarContainer").attr('id'));
		initialDate = divId.substr(12);
		
		initialYear = Number(initialDate.substr(0,4));
		initialMonth = Number(initialDate.substr(5,2)) - 1;
		
		$('.calendarContainer')
		.datePicker({inline:true, startDate:'01/01/2009', month: initialMonth, year:initialYear, renderCallback:function($td, thisDate, month, year)
				{
					the_month = String('0' + (Number(month) + 1));
				    the_day   = String('0' + Number($td.html()));
				    the_date  = year + '-' + the_month.substr(the_month.length-2) + '-' + the_day.substr(the_day.length-2);
					if(month == thisDate.getMonth()){
						$td.addClass(the_date);
					}
				}
		})
		.bind('dpMonthChanged', function(e, displayedMonth, displayedYear)
			{
				the_month = String('0' + (Number(displayedMonth) + 1));
				sendPost('', '/ajax/meals/historic/month/' + the_month + '/year/' +  displayedYear , mealsHistoric, ajaxError); 
			})
		.bind('dateSelected', function(e, selectedDate, $td)
			{
				the_month = String('0' + (Number(selectedDate.getMonth()) + 1));
				the_day   = String('0' + Number(selectedDate.getDate()));
				the_date  = the_day.substr(the_day.length-2) + '-' + the_month.substr(the_month.length-2) + '-' + selectedDate.getFullYear();
				
				document.location.href = '/menus-recomendados/ver/fecha/' + the_date;
			});
			
		theinitialMonth = String('0' + (Number(initialMonth) + 1));
		sendPost('', '/ajax/meals/historic/month/' + theinitialMonth.substr(the_day.length-2) + '/year/' + initialYear , mealsHistoric, ajaxError); 
		return false;
	}
}
*/

