var xmlHttp
var strSpanID
var xmlHttpGetProductName
var strSpanIDGetProductName
function getProductName(str,strOfferCode,strShellID,strSpanID1)
{
strSpanIDGetProductName=strSpanID1;
if (str.length==0)
{
document.getElementById(strSpanIDGetProductName).innerHTML='';
return;
}
xmlHttpGetProductName=GetXmlHttpObject()
if (xmlHttpGetProductName==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="ajax_submit.asp";
url=url+"?pn="+str;
url=url+"&oc="+strOfferCode;
url=url+"&shell_id="+strShellID;
url=url+"&action=getProductName";
url=url+"&spanid="+strSpanID1;
url=url+"&sid="+Math.random();
xmlHttpGetProductName.onreadystatechange=stateChangedGetProductName;
xmlHttpGetProductName.open("GET",url,true)
xmlHttpGetProductName.send(null)
}
function stateChangedGetProductName()
{
if (xmlHttpGetProductName.readyState==4)
{
var txtResponse=xmlHttpGetProductName.responseText;
var arrResponse=txtResponse.split("|");
var strStatus=arrResponse[0];
var strInputValue = strSpanIDGetProductName.replace('txtProductNumber','');
if (strStatus!="OK")
{
alert(arrResponse[1]);
document.getElementById('product_number_' + strInputValue).value='';
document.getElementById('qty_' + strInputValue).value='';
document.getElementById(strSpanIDGetProductName).innerHTML='';
document.getElementById('product_number_' + strInputValue).focus();
}
else
{
document.getElementById('product_number_' + strInputValue).value=arrResponse[2];
document.getElementById(strSpanIDGetProductName).innerHTML=arrResponse[1];
document.getElementById('qty_' + strInputValue).focus();
}
}
}
function writeEmailSignupForm(strSpanID1)
{
var qt
qt='"'
document.getElementById(strSpanID1).innerHTML="Email
";
}
function addEmail(str,strSpanID1)
{
strSpanID=strSpanID1;
if (str.length==0)
{
document.getElementById(strSpanID).innerHTML="";
return;
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="/ajax_submit.asp";
url=url+"?email="+str;
url=url+"&action=addEmail";
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4)
{
document.getElementById(strSpanID).innerHTML=xmlHttp.responseText;
}
}
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;
}