function handleHttpResponse() {
  if (http.readyState == 4) {
    // Split the comma delimited response into an array
    results = http.responseText;
	//alert(results);
	document.getElementById('stateoutput').innerHTML = results;
	//alert();
  }
}

function handleHttpResponse1() {
  if (http.readyState == 4) {
    // Split the comma delimited response into an array
    results = http.responseText;
	//alert(results);
	document.getElementById('stateoutput1').innerHTML = results;
	//alert();
  }
}
function handleHttpResponse4() {
  if (http.readyState == 4) {
    // Split the comma delimited response into an array
    results = http.responseText;
	//alert(results);
	document.getElementById('stateoutput_ind').innerHTML = results;
	//alert();
  }
}
function updateCityState(ph) { 
  var cidIndex = document.getElementById("txt_country");
  var cidValue = cidIndex.options[cidIndex.selectedIndex].value;
  var url = ph+"AjaxPhpFiles/getCityState.php?cid="; // The server-side script
//  alert(cidValue);
  http.open("GET", url + escape(cidValue), true);
  http.onreadystatechange = handleHttpResponse;
  http.send(null);
}

function updateCityState1(ph) { 

  var cidIndex = document.getElementById("txt_business_country");
  var cidValue = cidIndex.options[cidIndex.selectedIndex].value;
  var url = ph+"AjaxPhpFiles/getCityState1.php?cid="; // The server-side script
//  alert(cidValue);
  http.open("GET", url + escape(cidValue), true);
  http.onreadystatechange = handleHttpResponse1;
  http.send(null);
}
function updateCityState2(ph) { 

  var cidIndex = document.getElementById("txt_country");
  var cidValue = cidIndex.options[cidIndex.selectedIndex].value;
  var url = ph+"AjaxPhpFiles/getCityState2.php?cid="; // The server-side script
  //alert(cidValue);
  http.open("GET", url + escape(cidValue), true);
  http.onreadystatechange = handleHttpResponse;
  http.send(null);
}

function updateCityState4(ph) { 

  var cidIndex = document.getElementById("txt_country_id");
  var cidValue = cidIndex.options[cidIndex.selectedIndex].value;
  var url = ph+"AjaxPhpFiles/getCityState4.php?cid="; // The server-side script
  //alert(cidValue);
  http.open("GET", url + escape(cidValue), true);
  http.onreadystatechange = handleHttpResponse4;
  http.send(null);
}
function updateCityState5(ph) { 

  var cidIndex = document.getElementById("txt_country_id");
  var cidValue = cidIndex.options[cidIndex.selectedIndex].value;
  var url = ph+"AjaxPhpFiles/getCityState4.php?cid="; // The server-side script
  //alert(cidValue);
  http.open("GET", url + escape(cidValue), true);
  http.onreadystatechange = handleHttpResponse1;
  http.send(null);
}
function makeObject(){
var x;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
x = new ActiveXObject("Microsoft.XMLHTTP");
}else{
x = new XMLHttpRequest();
}
return x;
}
//common for all ajax
var request = makeObject();

/*function GiveYear()
	{	
	
	var selectBox = document.form1.bike_model;
	
	var selectBox1=document.form1.bike_make;

	var Partis = selectBox1.options[selectBox1.selectedIndex].value;
	
	var Partis1 = selectBox.options[selectBox.selectedIndex].value;
	
//	request.open('get', 'year_new1.php?makeid=' + Partis +   'modelid=' + Partis1);
	request.open('get','year_new1.php?makeid=' + Partis  +  '& modelid=' + Partis1);		
//	request.open('get','year_new1.php?modelid=' + Partis1);		
	request.onreadystatechange = parseInfo;
	request.send('');
		
		
	}

        function parseInfo()
        {
        if(request.readyState == 1)
                {
              //  document.getElementById('yearid').innerHTML = 'Loading...';
                }
        if(request.readyState == 4)
                {
                var answer = request.responseText;
             //   document.getElementById('yearid').innerHTML = answer;
                }
        }*/

function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object