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

function stateChangedBilling() 
{ 

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

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

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

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

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

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

function stateChangedAttach() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtAttach").innerHTML=xmlHttp.responseText 
	} 
}
// end attach
// calender
function showCalender(req_month,year,today) {
	var url="calender.php?req_month=" + req_month + "&year=" + year + "&today=" + today
	showContactTimer1(); // quickly begin the load bar
	xmlHttp=GetXmlHttpObject(stateChangedCal)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 
function stateChangedCal() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtshowCalender").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
}
} 

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