//////////////////////////////////////////////////////////////////////////////////////
// Maps 1.1 - Initial
// Maps 1.2
//
// 		06/09/2009 - mthomas - Added echo of response in ajaxAction()
//////////////////////////////////////////////////////////////////////////////////////

var xmlHttp = null;
var response;


function GetXmlHttpObject()
{
	//var xmlHttp=null;
	
	try
  	{
  	// Firefox, Opera 8.0+, Safari
		if(xmlHttp == null) {
	  		xmlHttp=new XMLHttpRequest();
		}
  	}

	catch (e)
  	{
  // Internet Explorer
  		try
    	{
			if(xmlHttp == null) {
	    		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
    	}
	
  		catch (e2)
    	{
			if(xmlHttp == null) {
	    		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
    	}
  }
  
	return xmlHttp;
}

function ajaxAction() {
		if (xmlHttp.readyState==4)
		{ 
			//alert("Response found");
			response=xmlHttp.responseText;
			return response;
		}		
}

function doAjax(url) {
	xmlHttp=GetXmlHttpObject();
	
	if (xmlHttp===null)
  	{
  	//alert ("Your browser does not support AJAX!");
  		return;
  	}

	url=url+"&foo="+Math.random();
	
	xmlHttp.onreadystatechange=function () { return ajaxAction(); };
	

	xmlHttp.open("GET",url,false);	//syncronous
	xmlHttp.send(null);


	if (xmlHttp.readyState==4)
	{ 
		response=xmlHttp.responseText;
		return response;

	}		
} 
// JavaScript Document