function GetXmlHttpObject() {
		   var xmlHttp=null;
			try {
  				// Firefox, Opera 8.0+, Safari
  				xmlHttp=new XMLHttpRequest();
  				} catch (e) {
  				// Internet Explorer
  				try {
    				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    				} catch (e) {
    					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    				}
  				}
			return xmlHttp;
			}
  
  function stateChanged(SpanName) { 
		   /*
		   if (xmlHttp.status == 1 || xmlHttp.status == 2 || xmlHttp.status == 3) {
			  	if (SpanName == 'PageImage') {
				   document.getElementById("PageImageLoading").style.display = 'block'
				   document.getElementById("PageImage").style.display = 'none'
				   }
				document.getElementById(SpanName).innerHTML = "<?=($_SESSION['AllLoading'])?>";
			    }	
			*/ 
		   
		   if (xmlHttp.readyState==4) { 
			   if (xmlHttp.status == 200) {
					if (SpanName == 'PageImage') {
						document.getElementById("PageImageLoading").style.display = 'block'
						document.getElementById("PageImage").style.display = 'none'
						}
				   document.getElementById(SpanName).innerHTML = xmlHttp.responseText;
			  	   }
		   	   }  
 		  }	
   function remove_loading() {
				document.getElementById("PageImageLoading").style.display = 'none';
				document.getElementById("PageImage").style.display = 'block';
				
			}
  
  
  function GetAjax(url, SpanName) {
  			if (SpanName == 'ShowTownship') {
				url = url + document.getElementById("City").value
				}
			
			if (SpanName == 'EstateShowTownship') {
				url = url + document.getElementById("EstateCity").value
				}
				
  			xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null) {
  				alert ("<?=($_SESSION['AjaxSupport'])?>");
  				return;
  				}
			//xmlHttp.onreadystatechange=stateChanged;
			xmlHttp.onreadystatechange=function(){stateChanged(SpanName);}
			xmlHttp.open("GET",""+url,true);
			xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
			
			
			xmlHttp.send(null);
  			
			}	
