$(function(){

$('td').click(
         function()
         {
             $(this).effect("highlight", {color: "#FFE0E0"}, 500);
            
         });

});

function show(day,year,month){
//document.write('sdfsdf');
if (month< 10){month = '0'+month;}
if (day< 10){day = '0'+day;}
	$(function(){
	$.ajax({
             type: "POST",
             url: path_ajax,
             data: "day=" + day + "&year="+year+"&month="+month,
             dataType: "text",
             success: function(msg)
             {
		$('#cevent').css('display','none');
		$('#cevent').html(msg);
		$('#cevent').show('slow', function() {
    // Animation complete.
  });
		
		
             }
         });
	});

}

function next(year,month){

if (month==12){year+=1;month=1;}
else {month+=1;}
if (month< 10){month = '0'+month;}

	$(function(){
	$.ajax({
             type: "POST",
             url:formcalendar_ajax,
             data: "year="+year+"&month="+month,
             dataType: "text",
             success: function(msg)
             {
		//$('.calendar').css('display','none');
		
		//$('.calendar').slideDown("fast");
    // Animation complete.
		$('.calendar').animate({
	    	width: "1px"
		}, 1000, function() {

  $('.calendar').animate({
	    	width: "100%"
		}, 1000);
$('.calendar').html(msg);
  });
		

             }
         });
	});

}


function prev(year,month){

if (month==1){year-=1;month=12;}
else {month-=1;}
if (month< 10){month = '0'+month;}

	$(function(){
	$.ajax({
             type: "POST",
             url:formcalendar_ajax,
             data: "year="+year+"&month="+month,
             dataType: "text",
             success: function(msg)
             {
		$('.calendar').animate({
		marginLeft: "220px",
	    	width: "1px"
		}, 1000, function() {

  $('.calendar').animate({
		marginLeft:"0",
	    	width: "100%"
		}, 1000);
$('.calendar').html(msg);
  });
             }
         });
	});

}
