//var aj = getCookie("TestCookie"); 

function select_date(day,month,year,date_num){

    xmlHttp = ajaxOBJ();    
	//var url = "http://localhost/pp/pull_day.php?day="+day+"&month="+month+"&year="+year+"&date_no="+date_num;	
	var url = "http://www.petershamproperties.com/pull_day.php?day="+day+"&month="+month+"&year="+year+"&date_no="+date_num;	
	var newURL = url;
	xmlHttp.onreadystatechange=function(){
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById(date_num).innerHTML=xmlHttp.responseText;
	}}
	xmlHttp.open("GET",newURL,true);
	xmlHttp.send(null);


}


function pop_date(){ 
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById(aj).innerHTML=xmlHttp.responseText;
	}	
}


function display_states(){ 

  xmlHttp = ajaxOBJ();
    var c_id =  document.tarrif_form.s_months.options[document.tarrif_form.s_months.selectedIndex].value;    
	//var url = "http://localhost/pp/pull_days.php?action=s_days&month_id="+c_id;
	var url = "http://www.petershamproperties.com/pull_days.php?action=s_days&month_id="+c_id;
	var newURL = url;
	xmlHttp.onreadystatechange=RenderDIV;
	xmlHttp.open("GET",newURL,true);
	xmlHttp.send(null);

}


function RenderDIV() { 
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("s_days").innerHTML=xmlHttp.responseText;
	}	
}



function display_e_days(){ 

  xmlHttp = ajaxOBJ();
    var c_id =  document.tarrif_form.e_months.options[document.tarrif_form.e_months.selectedIndex].value;    
	//var url = "http://localhost/pp/pull_days.php?action=e_days&month_id="+c_id;
	var url = "http://www.petershamproperties.com/pull_days.php?action=e_days&month_id="+c_id;
	var newURL = url;
	xmlHttp.onreadystatechange=e_day_DIV;
	xmlHttp.open("GET",newURL,true);
	xmlHttp.send(null);

}


function e_day_DIV() { 
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("e_days").innerHTML=xmlHttp.responseText;
	}	
}



function ajaxOBJ(){
  var xmlHttp;
  try{
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
	}catch (e){
    // Internet Explorer
    try{
      	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }catch (e){
      	try{
        	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }catch (e){
        	alert("Your browser does not support AJAX!");
        	return false;
       	}
      }
   }
   return xmlHttp;
}	


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}