// JavaScript Document for pulling the customer data

var xmlHttp
function AJAX_Example(add1,add2)
{ 
var url="../includes/ajax/AJAX_Add_Function.asp?sid=" + Math.random() + "&add1=" + add1 + "&add2=" + add2;
xmlHttp=GetXmlHttpObject(addNums)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}

function addMoreContacts(DashMatrix, TheNumber, postback)
{
	var url= DashMatrix + "includes/ajax/addMoreContacts.asp?sid=" + Math.random() + "&DashMatrix=" + DashMatrix + "&ContactNum=" + TheNumber;
	strDashMatrix = DashMatrix;
	workElement = postback;
	xmlHttp=GetXmlHttpObject(postbackDisplay)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}

function postbackDisplay() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById(workElement).innerHTML=xmlHttp.responseText; 
	}
}



function addNums() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("thesum").innerHTML=xmlHttp.responseText 
	}
}

var xmlHttp
function getEmailPage(pageid)
{ 
var url="../includes/ajax/AJAX_EmailPage.asp?sid=" + Math.random() + "&pageid=" + pageid;
xmlHttp=GetXmlHttpObject(formemail)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}

function formemail() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("pullcontent").innerHTML=xmlHttp.responseText ;
		document.getElementById("pullcontent").style.display='block';
	}
}


function getReqInfo(ModuleID)
{ 
var url="../includes/ajax/AJAX_AddToReqInfo.asp?sid=" + Math.random() + "&moduleid=" + ModuleID;
xmlHttp=GetXmlHttpObject(AddModule)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}

function AddModule() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("pullcontent").innerHTML=xmlHttp.responseText ;
		document.getElementById("pullcontent").style.display='block';
	}
}


function getExplanation(ABC)
{ 
var url="../includes/ajax/AJAX_DisplayInformation.asp?sid=" + Math.random() + "&infoString=" + ABC;
xmlHttp=GetXmlHttpObject(xrsInfo)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}

function xrsInfo() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("pullcontent").innerHTML=xmlHttp.responseText ;
		document.getElementById("pullcontent").style.display='block';
	}
}

function MSAJAX_newobject(pageref,strVar,strValue)
{ 
var url=pageref + "?sid=" + Math.random() + "&" + strVar + "=" + strValue;
xmlHttp=GetXmlHttpObject(newobj_stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}

function newobj_stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("newobject").innerHTML=xmlHttp.responseText 
	}
} 

function MSAJAX_saveinfo(pageref,strDatabase,strVars,strValues)
{ 
var url=pageref + "?sid=" + Math.random() + "&db=" + strDatabase + "&Vars=" + strVars + "&Values=" + strValues;
xmlHttp=GetXmlHttpObject(saveinfo_submit)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}

function saveinfo_submit() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("saveinfo").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
	}
} 