
<!--
	function HS_StatesPopulate(FormHandler,AllowEmpty){		
		for(var k = FormHandler.state.options.length-1; k>=0; k--){
			FormHandler.state.options[k] = null;
		}//for
		for(var k = FormHandler.city.options.length-1; k>=0; k--){
			FormHandler.city.options[k] = null;
		}//for
		FormHandler.state.options[0] = new Option("...loading...");
		FormHandler.city.options[0] = new Option("...loading...");
		var Country = FormHandler.country.options[FormHandler.country.selectedIndex].value;
		var xmlHttpReq = false;
    	var self = this;
    	// Mozilla/Safari
    	if (window.XMLHttpRequest) {
        	self.xmlHttpReq = new XMLHttpRequest();
    	}//if
    	// IE
    	else if (window.ActiveXObject) {
        	self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    	}//else if
    	self.xmlHttpReq.open('POST', "index.php", true);
    	self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    	self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4 && self.xmlHttpReq.status == 200) {
	        HS_PullData(self.xmlHttpReq.responseXML,FormHandler.state,'state');
	        HS_PullData(self.xmlHttpReq.responseXML,FormHandler.city,'city');
    	}//if
        }//function
    	self.xmlHttpReq.send("handler=geo&action=states&country="+Country+"&allow_empty="+AllowEmpty);
	}//HS_StatesPopulate
	function HS_CitiesPopulate(FormHandler,AllowEmpty){
		for(var k = FormHandler.city.options.length-1; k>=0; k--){
			FormHandler.city.options[k] = null;
		}//for
		FormHandler.city.options[0] = new Option("...loading...");
		var Country = FormHandler.country.options[FormHandler.country.selectedIndex].value;
		var State = FormHandler.state.options[FormHandler.state.selectedIndex].value;
		var xmlHttpReq = false;
    	var self = this;
    	// Mozilla/Safari
    	if (window.XMLHttpRequest) {
        	self.xmlHttpReq = new XMLHttpRequest();
    	}//if
    	// IE
    	else if (window.ActiveXObject) {
        	self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    	}//else if
    	self.xmlHttpReq.open('POST', "index.php", true);
    	self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    	self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4 && self.xmlHttpReq.status == 200) {
	        HS_PullData(self.xmlHttpReq.responseXML,FormHandler.city,'city');
    	}//if
        }//function
    	self.xmlHttpReq.send("handler=geo&action=cities&&country="+Country+"&state="+State+"&allow_empty="+AllowEmpty);
	}//HS_CitiesPopulate
	function HS_PullData(XMLData,FieldHandler,ItemName){
		for(var k = FieldHandler.options.length-1; k>=0; k--){
			FieldHandler.options[k] = null;
		}//for
		var Items = XMLData.getElementsByTagName(ItemName);
    	for(var i=0;i<Items.length;i++){
    		var ItemID = Items[i].firstChild.firstChild.nodeValue;
    		var ItemName = Items[i].firstChild.nextSibling.firstChild.nodeValue;
    		FieldHandler.options[i] = new Option(ItemName,ItemID);
    	}//for
	}//HS_PullData
//-->
