function cal(month, year){
	$('#loading').show();
	$('#cal').hide();
	
	$.post("ajax.php", {ajax:"cal", month:month, year:year}, function(data){
		$("#cal").html(data);
		$('#loading').hide();
		$('#cal').show();
	});
}

function showDay(d){
	$.post("ajax.php", {ajax:"showDay", date:d}, function(d){$("#content_right").html(d);});
	$.post("ajax.php", {ajax:"showDayIMG",date:d}, function(d){$("#content_left").html(d);});
	$("#loading").hide();
}

function showID(d, Addr){
	$.post("ajax.php", {ajax:"showID",date:d,url:Addr}, function(d){$("#content_right").html(d);});
	$.post("ajax.php", {ajax:"showIDIMG", date:d}, function(data){
		$("#content_left").html(data);
		$("a[rel=example_group]").fancybox({
             'transitionIn': 'none',
             'transitionOut': 'none',
             'titlePosition': 'over',
             'titleFormat': function(title, currentArray, currentIndex, currentOpts) {
                  return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
             }
        });
	});
	$("#loading").hide();
}

function showDetails(d, Addr){
	$("#loading").hide();
	$.post("ajax.php", {ajax:"showDetails",date:d, url:Addr}, function(d){$("#content_right2").html(d);});
	//new Ajax.Updater("content_left2", "ajax.php", {method:'post', postBody:'ajax=showIDIMG&date='+d});	
}

function showDetailsD(d){
	$("#loading").hide();
	$.post("ajax.php", {ajax:"showDetailsD",date:d}), function(d){$("#content_right").html(d);};	
}

function goTo(u){
	window.location.href = u;	
}
