var xmlHttp

function showMakes(newUsed)
{
	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Your browser does not support AJAX!");
			return;
		} 
	var url="/includes/inc_getMake.asp";
	url=url+"?newUsed="+newUsed;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChangedMake;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChangedMake() 
{ 
	if (xmlHttp.readyState==4)
		{ 
			document.getElementById('make').innerHTML=xmlHttp.responseText;
		}
}

function showModels(newUsed,make)
{
	xmlHttpModels=GetXmlHttpObject();
		if (xmlHttpModels==null)
		{
			alert ("Your browser does not support AJAX!");
			return;
		} 
	var url="/includes/inc_getModels.asp";
	url=url+"?newUsed="+newUsed;
	url=url+"&make="+make;	
	url=url+"&sid="+Math.random();
	xmlHttpModels.onreadystatechange=stateChangedModel;
	xmlHttpModels.open("GET",url,true);
	xmlHttpModels.send(null);
}

function stateChangedModel() 
{ 
	if (xmlHttpModels.readyState==4)
		{ 
			document.getElementById('model').innerHTML=xmlHttpModels.responseText;
		}
}

function updateTotal(newUsed,make,model,min,max)
{ 
xmlHttp2=GetXmlHttpObject();
if (xmlHttp2==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/includes/inc_getTotals.asp";
url=url+"?newUsed="+newUsed;
url=url+"&make="+make;
url=url+"&model="+model;
url=url+"&min="+min;
url=url+"&max="+max;
url=url+"&sid="+Math.random();
xmlHttp2.onreadystatechange=stateChangedTotalCount;
xmlHttp2.open("GET",url,true);
xmlHttp2.send(null);

}

function stateChangedTotalCount() 
{ 
if (xmlHttp2.readyState==4)
{ 
document.getElementById("totalCount").innerHTML=xmlHttp2.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;
}
