var xmlHttp;
var xmlHttpBasic;
var xmlHttpLoad;
function showRetailer(str)
{
if(str.length == 0) return;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url=rootPath+"AjaxRequest/loadRetailerByDistributor.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

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

    //alert(document.getElementById("txtHint").innerHTML);

    }
}


function showBasicInfo(str, userType)
{
document.getElementById("error").innerHTML = '';
document.getElementById('error').className="";
document.getElementById("preferredCurrencyAmount").value = 0;
document.getElementById("confirmAmount").value = '';
document.getElementById("divMessage").innerHTML="";
//alert('basic');
if(str.length == 0){
    document.getElementById("basicInfo").innerHTML="";
    return;
}
xmlHttpBasic=GetXmlHttpObject();
if (xmlHttpBasic==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var basicURL=rootPath+"AjaxRequest/userBasicInformation.php";
basicURL=basicURL+"?q="+str+"&userType="+userType;
basicURL=basicURL+"&sid="+Math.random();
xmlHttpBasic.onreadystatechange=displayBasicInfo;
xmlHttpBasic.open("GET",basicURL,true);
xmlHttpBasic.send(null);
document.getElementById("basicInfo").innerHTML = "<img src='WebTopUp/WebTopUpOnVOS/DevelopmentCode/UserInterface/images/largeLoading.gif' />";
}

function showLoadInfo(str, userType)
{

//return;
//alert('load');
if(str.length == 0){
    document.getElementById("loadInfo").innerHTML="";
    return;
}

xmlHttpLoad=GetXmlHttpObject();
if (xmlHttpLoad==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var loadURL=rootPath+"AjaxRequest/userLoadInfo.php";
loadURL=loadURL+"?q="+str+"&userType="+userType;
loadURL=loadURL+"&sid="+Math.random();
xmlHttpLoad.onreadystatechange=displayLoadInfo;
xmlHttpLoad.open("GET",loadURL,true);
xmlHttpLoad.send(null);
document.getElementById("loadInfo").innerHTML = "<img src='WebTopUp/WebTopUpOnVOS/DevelopmentCode/UserInterface/images/largeLoading.gif' />";
}

function displayBasicInfo()
{
    if (xmlHttpBasic.readyState==4)
    {
    document.getElementById("basicInfo").innerHTML=xmlHttpBasic.responseText;

    //alert(document.getElementById("txtHint").innerHTML);

    }
}

function displayLoadInfo()
{
    if (xmlHttpLoad.readyState==4)
    {
    document.getElementById("loadInfo").innerHTML=xmlHttpLoad.responseText;

    //alert(document.getElementById("txtHint").innerHTML);

    }
}

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;
}
