// JavaScript Document
//
function GetXmlHttpObject(){
	var xmlHttp=null;
	try{
	 // Firefox, Opera 8.0+, Safari
	 xmlHttp=new XMLHttpRequest();
	 }catch (e){
	 //Internet Explorer
	 try{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	 }catch (e){
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	 }
	}
	return xmlHttp;
}
//
function change_date(day,month,year,clink){	
	//
	//alert("change_date ");
	xmlHttp=GetXmlHttpObject();
	//
	if(xmlHttp==null){
		 alert ("Browser does not support HTTP Request");
		 return;
	 }
	//var url=clink+"?day="+day+"&month="+month+"&year="+year;
	var url="http://www.lmcaz.com/inc/calendar.php?day="+day+"&month="+month+"&year="+year;
	////
	xmlHttp.onreadystatechange=interestStateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
		return false;
}
//
function interestStateChanged() { 
	//alert('interestStateChanged');
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
	 	//
		var response = xmlHttp.responseText ;
		//var statusBarMessage = document.getElementById("interestShortMessage");
		var responseDiv = document.getElementById("calendar_content");
		//
		if(response == "duplicate"){
			alert("Please reload the page");
		}else{
			document.getElementById("calendar_content").innerHTML = response;
		}
	} 
}