
var xmlHttp

function showCustomer(str)
{ 


xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="getcustomer.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function showKec(strx)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="getkecamatan.php";
url=url+"?kc="+strx;
url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=stateChangedKc;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function showEmail(str)
{ 


xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="getEmail.php";
url=url+"?eml="+str;
url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=stateChangedEml;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function showEmailComp(str)
{ 


xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="getEmailComp.php";
url=url+"?eml2="+str;
url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=stateChangedEmlComp;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}



function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
}
}


function stateChangedKc() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtKec").innerHTML=xmlHttp.responseText;
}
}




function stateChangedEml() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtEml").innerHTML=xmlHttp.responseText;
}
}


function stateChangedEmlComp() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtEmlComp").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;
}

