//
//Maffo Advanced Locations Sytstem
//For use with 68Classifieds 4
//Written by Andy Mathieson 
//Email maffo@classified-software.co.uk
//Online manaual available at
//http://www.classified-software.co.uk
//
var xmlHttp=GetXmlHttpObject();
var display_element=null;
var trip = null;
function sendRequested(query,url,async)
{   
	xmlHttp=GetXmlHttpObject();
	
  	var contentType = "application/x-www-form-urlencoded; charset=UTF-8";
	xmlHttp.onreadystatechange=stateChanged;
	if(async==true){
		
		xmlHttp.open("GET",url+query,async);
		xmlHttp.setRequestHeader("Content-Type", contentType);
		xmlHttp.send(null);
	}
	else{
		xmlHttp.open("GET",url+query,async);
		xmlHttp.setRequestHeader("Content-Type", contentType);
		xmlHttp.send(null);
		if (xmlHttp.onreadystatechange == null) stateChanged();
	}
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{
document.getElementById('wait').style.visibility = "hidden";
document.getElementById(display_element).innerHTML=xmlHttp.responseText;
}else{
  document.getElementById('wait').style.visibility = "visible";
  }
}

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");
    }
  }
  
  if (xmlHttp==null)
  		{
	  		alert ("Your browser does not support AJAX!");
	  		return;
		} 	
return xmlHttp;
}