var xmlHttp;

function disable(divName) {
var cottage="co"+divName;
var adults="ad"+divName;
var child="ch"+divName;
if (document.getElementById(cottage).style.display == "none")
{
	document.getElementById(cottage).style.display = "";
	document.getElementById(adults).style.display = "";
	document.getElementById(child).style.display = "";
}
else
{
	document.getElementById(cottage).style.display = "none";
	document.getElementById(adults).style.display = "none";
	document.getElementById(child).style.display = "none";
}
}

function existinguser(user)
{
var existuser=user;
var url="customeredit.php";
url=url+"?name="+user;
window.open(url,"_self");
}

function showMonth(month,day,year)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="days.php";
url=url+"?month="+month;
url=url+"&day="+day;
url=url+"&year="+year;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
 } 
}

function showMonth2(month2,day2,year2)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="days2.php";
url=url+"?month2="+month2;
url=url+"&day2="+day2;
url=url+"&year2="+year2;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHint2").innerHTML=xmlHttp.responseText;
 } 
}

function addnew() {
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="newdate.php";
url=url+"?sid="+Math.random();
xmlHttp.onreadystatechange=stateNewDate;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateNewDate() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("newDate").innerHTML=xmlHttp.responseText;
 } 
}

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;
}