// JavaScript Document

var xmlHttp

function showList(ptype, bedrooms, region, area, price, sqltxt)
{ 

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX so our quick search feature will not work. However you can still use the other features of our site to find your new home now in Spain");
  return;
  } 
	
//document.getElementById("gosearch").disabled="Disabled"
document.getElementById("waitgifs").innerHTML = "<img src='images/pleasewait.gif' width='140' height='16'>"
document.getElementById("sqltxt").disabled="Disabled"
document.getElementById("ptypes").disabled="Disabled"
document.getElementById("bedrooms").disabled="Disabled"
document.getElementById("region").disabled="Disabled"
document.getElementById("area").disabled="Disabled"
document.getElementById("price").disabled="Disabled"
document.getElementById("resets").disabled="Disabled"
var url="psearchselect.asp";
url=url+"?vtype="+ptype+"&vbed="+bedrooms+"&vregion="+region+"&varea="+area+"&vprice="+price+"&sqltxt="+sqltxt;
url=url+"&sid="+Math.random();
url = encodeURI(url);
xmlHttp.onreadystatechange=stateChangedSales;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);


}

function stateChangedSales() 
{ 


if (xmlHttp.readyState==4)
{ 
	document.getElementById("displayqs").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;
}