$(function() {		function removeAmp(string) {		var strReplaceAll = string;		var intIndexOfMatch = strReplaceAll.indexOf( "&" );		while (intIndexOfMatch != -1){			strReplaceAll = strReplaceAll.replace( "&", "%26" )			intIndexOfMatch = strReplaceAll.indexOf( "&" );		}		return strReplaceAll;	}		function sign() {		var subject = $("#subject").val();		var name = $("#name").val();		var email = $("#email").val();		var comment = $("#comment").val();		var code = $("#code").val();		var data = "code="+code+"&subject="+subject+"&name="+name+"&email="+email+"&comment="+removeAmp(comment);		$.ajax({				type: "POST",				url: "pagefuncs.php",				data: data,				success: function(msg){					if (msg==1) {						$(".dialog").dialog("close");						var entries = $("#entries").html();						$("#entries").html("<span id='new' style='display:none;'></span>"+entries);						$("#new").html("<h2> "+subject+"<span class='time'><em>"+$('#curstring').val()+" - By <a href='mailto:"+email+"'>"+name+"</a></em></span></h2>"+comment+" </p><hr />");						$("#new").slideDown("slow", function() {							$("#new").highlight();						});					} else {						alert(msg);					}				}			});	}	$(".dialog").dialog({			autoOpen: false,			bgiframe: true,			width: 520,			height: 450,			modal: true,			show: 'fold',			hide: 'fold'	});		$("#signer").click(function() {		$('.dialog').dialog('option', 'buttons',{ "Sign It": function() { sign(); }, "Cancel": function() {$(this).dialog("close"); } });		$(".dialog").dialog("open");	});		$(".date_has_event").click(function() {	alert("ASDAS");		/*var d = $(this).attr("id");		var m = $("#month").val();		var y = $("#year").val();		//window.location="/schedule.php?d="+d+"&m="+m+"&y="+y;		alert("/schedule.php?d="+d+"&m="+m+"&y="+y);*/	});});