function doLoading()
{
	document.getElementById("BookCottage").innerHTML="";
}

function getPrice(cottageref,startdate,duration)
{
	
		  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;  
							 }
								   }
									   }
			xmlHttp.onreadystatechange=function()
			  {
			  if(xmlHttp.readyState==4)
				{
				document.getElementById("BookCottage").innerHTML=xmlHttp.responseText;
				 
				 
				 var sPath = window.location.pathname;
				 var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
				 
				 if(sPage=='holiday-cottages-uk.asp'){getDesc(cottageref,startdate);}
				 
				 checkSpecialForPic(cottageref,startdate,duration);
				 animatedcollapse.show('BookCottage');
				}
			  }
			xmlHttp.open("GET","AJAX/getavaildates/getprice.asp?duration=" + duration + "&cottageref=" + cottageref + "&startdate=" + startdate + "&ms=" + new Date().getTime(),true);
			xmlHttp.send(null);
}

function checkSpecialForPic(cottageref,startdate,duration)
{

		  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;  
							 }
								   }
									   }
			xmlHttp.onreadystatechange=function()
			  {
			  if(xmlHttp.readyState==4)
				{
				 document.getElementById("fadeshow").innerHTML=xmlHttp.responseText;
				}
			  }
			xmlHttp.open("GET","AJAX/getavaildates/getSpecialPic.asp?duration=" + duration + "&cottageref=" + cottageref + "&startdate=" + startdate + "&ms=" + new Date().getTime(),true);
			xmlHttp.send(null);
}



function getAvailDates(cottageref,duration,arrival)
{


document.getElementById("dates").innerHTML="Finding dates..."

  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;  
			         }
					       }
						       }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById("dates").innerHTML=xmlHttp.responseText;
		//alert(xmlHttp.responseText)
        }
      }
    xmlHttp.open("GET","AJAX/getavaildates/getdates.asp?duration=" + duration + "&cottageref=" + cottageref + "&arrival=" + arrival + "&ms=" + new Date().getTime(),true);
    xmlHttp.send(null);
	}
	
	
 function shortlist(cottageref)
{  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;  
			         }
					       }
						       }

	
	var clicked = document.getElementById("hide");
	if (clicked.innerHTML=="Add Shortlist")
	{
	clicked.innerHTML = "<a href=shortlist.asp class=shortlistR>View&nbsp;Shortlist</a>"
	    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
		document.getElementById("numshortlist").innerHTML=xmlHttp.responseText
		//alert(xmlHttp.responseText)
        }
      }
    xmlHttp.open("GET","/shortlist/add.asp?cottageref="+cottageref,true);
    xmlHttp.send(null); }
	 }
	 
	 
	 
	 function getDesc(cottageref,startdate)
{
		  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;  
							 }
								   }
									   }
			xmlHttp.onreadystatechange=function()
			  {
			  if(xmlHttp.readyState==4)
				{
				document.getElementById("description").innerHTML=xmlHttp.responseText;
				//alert(xmlHttp.responseText)
				}
			  }
			xmlHttp.open("GET","AJAX/getavaildates/get-desc.asp?cottageref=" + cottageref + "&startdate=" + startdate + "&ms=" + new Date().getTime(),true);
			xmlHttp.send(null);
}

	 function getFacLay(cottageref,startdate)
{
		  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;  
							 }
								   }
									   }
			xmlHttp.onreadystatechange=function()
			  {
			  if(xmlHttp.readyState==4)
				{
				document.getElementById("faclay").innerHTML=xmlHttp.responseText;
				//alert(xmlHttp.responseText)
				}
			  }
			xmlHttp.open("GET","AJAX/getavaildates/get-FacLay.asp?cottageref=" + cottageref + "&startdate=" + startdate + "&ms=" + new Date().getTime(),true);
			xmlHttp.send(null);
}

