$(function() {	function newCal(m,y) {		$("#calendar").fadeOut('fast',function() {			var data="m="+m+"&y="+y;			$.ajax({				type: "POST",				url: "calcall.php",				data: data,				success: function(msg){					$("#calendar").hide();					$("#calendar").html(msg);					$("#calendar").fadeIn('fast');				}			});		});	}		$("#nextmonth").live('click',function() {		var m = parseInt($("#month").val());		var y = parseInt($("#year").val());		if (m==12) {m=1;y=y+1;} else {m=m+1;}		newCal(m,y);	});		$("#prevmonth").live('click',function() {		var m = parseInt($("#month").val());		var y = parseInt($("#year").val());		if (m==1) {m=12;y=y-1;} else {m=m-1;}		newCal(m,y);	});	$(".date_has_event").live('click',function() {		var d = $(this).attr("id");		var m = $("#month").val();		var y = $("#year").val();		window.location="schedule.php?d="+d+"&m="+m+"&y="+y;	});			$(".albumclick").click(function() {		var id = $(this).attr("id");		window.location="media.php?page=albums&aid="+id;	});		$(".dialog2").dialog({			autoOpen: false,			bgiframe: true,			width: 1024,			height: 680,			modal: true,			show: 'fold',			hide: 'fold'	});			$(".mediaalbum").click(function() {		var id = $(this).attr("id");		var string = "<img src='images/main/"+id+".jpg' width='1010' height='670'>";		$(".dialog2").html(string);		$(".dialog2").dialog('option', 'buttons',{ "Close": function() {$(this).dialog("close"); } });		$(".dialog2").dialog("open");	});});