		function GetXmlHttpObject(handler)
		{
		    var objXMLHttp=null
		    if (window.XMLHttpRequest)
		    {
		        objXMLHttp=new XMLHttpRequest()
		    }
		    else if (window.ActiveXObject)
		    {
		        objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		    }
		    return objXMLHttp
		}
		
		function countryChanged()
		{

		    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		    {
		            document.getElementById("txtStateResults").innerHTML= xmlHttp.responseText;
		            document.getElementById("txtRegionResults").innerHTML="";
		            document.getElementById("txtSuburbResults").innerHTML="";
		    }
		    else {
		            //alert(xmlHttp.status);
		    }
		}
		function stateChanged()
		{
		    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		    {
		            document.getElementById("txtRegionResults").innerHTML= xmlHttp.responseText;
		            document.getElementById("txtSuburbResults").innerHTML="";

		    }
		    else {
		            //alert(xmlHttp.status);
		    }
		}		
		function regionChanged()
		{
		    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		    {
		            document.getElementById("txtSuburbResults").innerHTML= xmlHttp.responseText;

		    }
		    else {
		            //alert(xmlHttp.status);
		    }
		}	
		
		// Will populate data based on input
		function htmlData(changed,url, qStr)
		{
			listField = "";
			mySuffix = "";
			if (qStr =="Any Country") {
				document.getElementById("txtStateResults").innerHTML= "";
		        document.getElementById("txtRegionResults").innerHTML="";

		        
				return;
			} else {
				if (qStr =="Any State") {
			        document.getElementById("txtRegionResults").innerHTML="";

					return;
				} else {
					if (qStr =="Any Region") {
					return;
					}
				}
				
			}
			
		    xmlHttp=GetXmlHttpObject()
		    if (xmlHttp==null)
		    {
		        alert ("Browser does not support HTTP Request");
		        return;
		    }
			if (changed=="country") {
				listField = "txtStateResults";

		    	xmlHttp.onreadystatechange=countryChanged;	

			} else {
				if (changed=="state") {
					listField = "txtRegionResults";
					mySuffix = "&countryList=" +document.forms["frmSearchPanel"].elements["countryList"].value;
					xmlHttp.onreadystatechange=stateChanged;
				} else {
					if (changed=="region") {
						
						listField = "txtSuburbResults";
						mySuffix = "&countryList=" +document.forms["frmSearchPanel"].elements["countryList"].value;
						mySuffix = mySuffix + "&stateList=" +document.forms["frmSearchPanel"].elements["stateList"].value;
						xmlHttp.onreadystatechange=regionChanged;
						
					} else {
						alert ("Error in htmlData function, unexpected change:" + changed);
					}
				}
			}
		    if (url.length==0)
		    {
		        document.getElementById(listField).innerHTML=""; 
		        return;
		    }
	    	url=url+"?ch="+qStr +mySuffix; 
	    	url=url+"&sid="+Math.random();

	    	xmlHttp.open("GET",url,true) ;
	    	xmlHttp.send(null);	

		}
