var xmlHttp;

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


var ncatorder = new Array();

//
function getmodel()
{	
	
   xmlHttp = null;
    xmlHttp = getXMLHttp();

    if(xmlHttp == null)
        return;
	var bid = document.getElementById("askmake").value;	

var url="ajax/getmodel.php?brand_id="+bid;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged()
{
 if(xmlHttp.readyState == 4 && xmlHttp.status == 200){

  document.getElementById("modeldiv").innerHTML=xmlHttp.responseText;
  }
}

function getsearchmodel()
{	
	
   xmlHttp = null;
    xmlHttp = getXMLHttp();

    if(xmlHttp == null)
        return;
	var bid = document.getElementById("smake").value;	

var url="ajax/getsearchmodel.php?brand_id="+bid;
xmlHttp.onreadystatechange=stateChangeds;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChangeds()
{
 if(xmlHttp.readyState == 4 && xmlHttp.status == 200){

  document.getElementById("modelsearchdiv").innerHTML=xmlHttp.responseText;
  }
}


