function getHTTPObject()
{
 var xmlHttp=null;
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("Msxml2.XMLHTTP.6.0");
	  }
	  catch (e)
		{
		  try{
	    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP.3.0");
		  }
		  catch (e){
			  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
		}
	}
	  }
return xmlHttp;
 } 


 function setOutput(){
if(httpObject.readyState == 4)
{
	removeAllOptions(document.getElementById('car_service'));
	//addOption(document.getElementById('DDLdest'),'','--Select Destn--');
	var i;
 	var y = httpObject.responseText;
	var v=y.split(",");
//	alert(v.length);
	for(i=0;i<v.length;i++)
	{
		addOption(document.getElementById('car_service'),v[i],v[i]);
  	}
  document.getElementById('spin').style.visibility = "hidden";
}
}
							  // Getting The drop down type.
  function getcity(x){
	httpObject = getHTTPObject();
	if (httpObject != null) {
	httpObject.open("GET", "service/surf_buyer/carbuyer/process/carprocess.php?id=" + x, true);
	httpObject.send(null);
	httpObject.onreadystatechange = setOutput;
	}
 //alert("ajax end");
  }
 
   function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}
  

 
function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		selectbox.remove(i);
	}
}
  var httpObject = null;
