var xmlHttp

function showCustomer(str)
{ 
var url="getindustry.php?sid=" + Math.random() + "&q=" + str
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
} 
} 




function showsubindustry(str)
{ 
        
var url="getsubindustry.php??sid=" + Math.random() + "&q1=" + str
xmlHttp=GetXmlHttpObject(stateChanged1)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
} 

function stateChanged1() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint1").innerHTML=xmlHttp.responseText 
} 
} 
///////////////////////////////////------------------------------------
function showchild(str)
{ 
var url="getSubchild.php?sid=" + Math.random() + "&q2=" + str
xmlHttp=GetXmlHttpObject(stateChanged2)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
} 

function stateChanged2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("child").innerHTML=xmlHttp.responseText 
} 
} 



//---------------------------------------Check Exporter userid-------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------

function Checkexpid(str)
{ 
if(str=="" || !str.match(/^[a-zA-Z0-9]+$/) || str.length<=3 || str.length>=21)
{
document.getElementById("idcheck").innerHTML = "<span class='backred'>&nbsp;&nbsp;Please choose a Valid ID</span>";


//alert ("Please Enter ALphnumeric values");
	form1.username.value="";
	

}
else
{

 

var url="ajax_user.php?sid=" + Math.random() + "&q=" + str
xmlHttp=GetXmlHttpObject(idChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}
} 

function idChanged() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("idcheck1").innerHTML=xmlHttp.responseText 
} 
}

//-------------------------------------------------------------------------------------------------------------------


//---------------------------------------Check importer userid-------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------

function Checkimpid(str)
{ 
if(str=="")
{
document.getElementById("idcheck").innerHTML = "<span class='remark'>&nbsp;&nbsp;Please choose a Member ID</span>";
form1.username.focus();
}
else
{
var url="ajax_importer.php?sid=" + Math.random() + "&q=" + str
xmlHttp=GetXmlHttpObject(idChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}
} 

function idChanged() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("idcheck").innerHTML=xmlHttp.responseText 
} 
}

//-----------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------
//-------------------------------------------calling Product's category--------------------------------------------


function insert(str)

{ 
var url="ajax_product.php?sid=" + Math.random() + "&q=" + str
xmlHttp=GetXmlHttpObject(ProductChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
} 

function ProductChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 


document.getElementById("txtHint1").innerHTML=xmlHttp.responseText 
} 
} 



//----------------------------------------------------View Selling Lead---------------------------------------------

function selling(str)

{ 
var url="ajax_sellinglead.php?sid=" + Math.random() + "&q=" + str
xmlHttp=GetXmlHttpObject(sellingchange)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
} 

function sellingchange() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("txtHint1").innerHTML=xmlHttp.responseText 
} 
} 










//-----------------------------------------------------------------------------------------------------------------
//------------------------------------------------Inserting Categories-------------------------------------------------------------

function showCustomer(str)
{ 
var url="getindustry.php?sid=" + Math.random() + "&q=" + str
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
} 
} 




//-------------------------------------show CP_product
function cpproduct(str)

{ 
var url="ajax_prtest.php?sid=" + Math.random() + "&q=" + str
xmlHttp=GetXmlHttpObject(ProductChanged1)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
} 

function ProductChanged1() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("product").innerHTML=xmlHttp.responseText 
} 
} 
//--------------------------------------------------------
function cpselling(str)

{ 
var url="ajax_sellingtest.php?sid=" + Math.random() + "&l=" + str
xmlHttp=GetXmlHttpObject(Changed3)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
} 

function Changed3() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("selling").innerHTML=xmlHttp.responseText 
} 
} 






function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null

if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") 
return 
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
} 
try
{ 
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler 
return objXmlHttp
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled") 
return 
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler 
return objXmlHttp
}
} 

