var xmlHttp

function showAS(str,icid,srch)
{ 
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtAS").innerHTML=xmlHttp.responseText 
		//document.form9.vAudience.focus();
		//document.getElementById("srch").focus();
		//document.form1.srch.focus();
	} 
} 
//Device change
function showDevice(str,icid,srch)
{ 
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChangedProvince)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateChangedProvince() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtDevice").innerHTML=xmlHttp.responseText 
	} 
} 
//device2 change
function showDevice2(str,icid,srch)
{ 
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChangedProvince2)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateChangedProvince2() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtDeviceCart").innerHTML=xmlHttp.responseText 
	} 
} 
//FP change
function showProduct(str,icid,srch)
{ 
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChangedProduct)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateChangedProduct() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtProduct").innerHTML=xmlHttp.responseText 
	} 
} 
////Compatible Device change
function showComDeviceModel(str,icid,srch)
{ 
	
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar	
	xmlHttp=GetXmlHttpObject(stateComDeviceModel)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateComDeviceModel() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtComDeviceModel").innerHTML=xmlHttp.responseText 
	} 
} 
////Compatible Device model change
function showComDeviceModelSess(str,icid,srch)
{ 
	
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar	
	xmlHttp=GetXmlHttpObject(stateComDeviceModelSess)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateComDeviceModelSess() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtComDeviceModelSess").innerHTML=xmlHttp.responseText 
	} 
} 
//District change
function showPageDistrict(str,icid,srch)
{ 
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChangedDistrict)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateChangedDistrict() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtRegion").innerHTML=xmlHttp.responseText 
	} 
} 
// International
function showPageInternational(str,icid,srch)
{ 
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChangedInternational)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateChangedInternational() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtInternational").innerHTML=xmlHttp.responseText 
	} 
} 

// area of work
function showPageAreaofWork(str,icid,srch)
{ 
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChangedAreaofWork)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateChangedAreaofWork() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtAreaofWork").innerHTML=xmlHttp.responseText
		document.getElementById("txtExtUser").innerHTML="<a href=\"javascript:showPageExtUser('ExtUser','Y','$srch')\"><u>Add</u></a>" 
	} 
} 
// area of work2
function showPageAreaofWork2(str,icid,srch)
{ 	
	
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChangedAreaofWork2)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	//showPageAreaofWork("AreaofWork","N","")	
	
} 

function stateChangedAreaofWork2() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtAreaofWork2").innerHTML=xmlHttp.responseText
		document.getElementById("txtAreaofWork").innerHTML="<a href=\"javascript:showPageAreaofWork('AreaofWork','Y','$srch')\"><u>Add another</u></a>" 
		document.getElementById("txtExtUser").innerHTML="<a href=\"javascript:showPageExtUser('ExtUser','Y','$srch')\"><u>Add</u></a>" 
	} 
} 

// ExtUser
function showPageExtUser(str,icid,srch)
{ 
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChangedExtUser)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateChangedExtUser() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtExtUser").innerHTML=xmlHttp.responseText 
		document.getElementById("txtAreaofWork").innerHTML="<a href=\"javascript:showPageAreaofWork('AreaofWork','Y','$srch')\"><u>Add</u></a>" 
	} 
} 
// ExtUser2
function showPageExtUser2(str,icid,srch)
{ 	
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChangedExtUser2)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateChangedExtUser2() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtExtUser2").innerHTML=xmlHttp.responseText 
		document.getElementById("txtExtUser").innerHTML="<a href=\"javascript:showPageExtUser('ExtUser','Y','$srch')\"><u>Add another</u></a>" 
		document.getElementById("txtAreaofWork").innerHTML="<a href=\"javascript:showPageAreaofWork('AreaofWork','Y','$srch')\"><u>Add</u></a>" 
	} 
} 
//end
// OperationRegion
function showPageOperationRegion(str,icid,srch)
{ 
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChangedOperationRegion)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateChangedOperationRegion() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtOperationRegion").innerHTML=xmlHttp.responseText 
		document.getElementById("txtAreaofWork").innerHTML="<a href=\"javascript:showPageAreaofWork('AreaofWork','Y','$srch')\"><u>Add</u></a>" 
	} 
} 
// OperationRegion2
function showPageOperationRegion2(str,icid,srch)
{ 	
	var url="getpage.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChangedOperationRegion2)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
} 

function stateChangedOperationRegion2() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtOperationRegion2").innerHTML=xmlHttp.responseText 
		document.getElementById("txtExtUser").innerHTML="<a href=\"javascript:showPageExtUser('ExtUser','Y','$srch')\"><u>Add</u></a>" 
		document.getElementById("txtAreaofWork").innerHTML="<a href=\"javascript:showPageAreaofWork('AreaofWork','Y','$srch')\"><u>Add</u></a>" 
	} 
} 
//end

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

function showContactTimer () {
	var loader = document.getElementById('loadBar');
	loader.style.display = 'block';
	sentTimer = setTimeout("hideContactTimer()",1000);
}
function hideContactTimer () {
	var loader = document.getElementById('loadBar');
	loader.style.display = "none";
}

function showContactTimer1 () {
	var loader = document.getElementById('loadBar1');
	loader.style.display = 'block';
	sentTimer = setTimeout("hideContactTimer1()",1000);
}
function hideContactTimer1 () {
	var loader = document.getElementById('loadBar1');
	loader.style.display = "none";
}



 


