﻿var xmlHttp
var b = "";
function clearAll()
{
 document.getElementById("liveSearch").innerHTML="";
 document.getElementById('liveSearch').style.display="none";
 return	
}
function showResult(str)
{
if (str.length<=0)
{
clearAll();
return
}
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 

var url = "/liveSearch-3.0.asp"
url=url+"?q="+str
//url=url+"?q="+str+"&b="+b
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
  document.getElementById('liveSearch').innerHTML=xmlHttp.responseText;
  document.getElementById('liveSearch').style.display="";

 }
}

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 fillCity(strcity)
{
//alert(document.getElementById("tbxcity") + " and " + document.getElementById("TextBoxCity"));
if(document.getElementById("tbxcity") != null){
document.getElementById("tbxcity").value=strcity;
}
if(document.getElementById("TextBoxCity") != null){
document.getElementById("TextBoxCity").value=strcity;
}
clearAll();
}
