// JavaScript Document
/* * File Name                   : showcity.js
 * File Created                : Thursday, March 08, 2007
 * File Last Modified          : Thursday, March 08, 2007
 * Copyright                   : (C) 2001 AJ Square Inc
 * Email                       : licence@ajsquare.net
 * Software Language:          : PHP
 * Version Created             : 
 * Programmers worked          : Nanda Kumar
 
 *      Licence Agreement: 
 
*     This program is a Commercial licensed software; 
*     you are not authorized to redistribute it and/or modify/and or sell it under any publication 
*     or license /or term it under the GNU General Public License as published by the Free Software Foundation;
*     either user and developer versions of the License, or (at your option) 
*     any later version is applicable for the same.*/


var xmlHttp1

function showCity(state,cty)
{
//alert("city"+state);
if (state.length==0 )
{ 
document.getElementById("cities").innerHTML=""
return
}
xmlHttp1=GetXmlHttpObject1()
if (xmlHttp1==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="displaycity.php"
url=url+"?stateid="+state
url=url+"&cityid="+cty
url=url+"&sid="+Math.random()
xmlHttp1.onreadystatechange=stateChanged1
//alert (url);
xmlHttp1.open("GET",url,true)
//window.open(url)
xmlHttp1.send(null)
} 

function stateChanged1() 
{ 
	if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
	{ 
	document.getElementById("cities").innerHTML=xmlHttp1.responseText 
	//alert(xmlHttp1.responseText);
	} 
} 

function GetXmlHttpObject1()
{ 
var objxmlHttp1=null
if (window.XMLHttpRequest)
{
objxmlHttp1=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objxmlHttp1=new ActiveXObject("Microsoft.XMLHTTP")
}
return objxmlHttp1
} 