var xmlHttp;
//getstreet
function getStreet(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="../scripts/getstreets.php";

url=url+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedStr;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChangedStr() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("streets").innerHTML=xmlHttp.responseText;
 } 
}
//get building
function getBuild(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="../scripts/getbuildings.php";

url=url+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedBld;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChangedBld() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("buildings").innerHTML=xmlHttp.responseText;
 } 
}

//gettariff
function getTariff(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="../scripts/gettariff.php";

url=url+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedTari;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChangedTari() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("tariffs").innerHTML=xmlHttp.responseText;
 } 
}

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;
}