//  Ver: 1.2 usmanrv@gmail.com
function getXMLHTTPRequest() {
try {
req = new XMLHttpRequest();
} catch(err1) {
  try {
  req = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (err2) {
    try {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (err3) {
      req = false;
    }
  }
}
return req;
}

var http = getXMLHTTPRequest();
var innerItemId =123123;
var innerREGIM =0;
var FlagAjax=0;
 var br = navigator.userAgent.toLowerCase();
 var ie = br.indexOf('msie');


function getAjaxGlavImg(iditem) {
  var myurl = 'usmanajax_individ.asp?individual='+iditem;
if (FlagAjax == 0 )
{
FlagAjax=1;
  innerItemId=iditem;
  myRand = parseInt(Math.random()*999999999999999);
  var mynumber="Installation"+iditem;
  // add random number to URL to avoid cache problems
  var modurl = myurl+"&rand="+myRand+" ";
//document.write(modurl);
  http.open("GET", modurl, true);
  // set up the callback function
  http.onreadystatechange = useHttpResponseIndividual;
  http.send(null);
}
}
 

function getAjaxAddItemI(iditem,idprice){
		if (FlagAjax == 0)
		{
		FlagAjax=1;
//idkol=0+parseInt(document.getElementById("QTYITEMSADD").value);
idkol=1;
		  var myurl = 'usmanajax_additem.asp?additem='+iditem+'&price='+idprice+'&kol='+idkol;
		  myRand = parseInt(Math.random()*999999999999999);
		  // add random number to URL to avoid cache problems
		  var modurl = myurl+"&rand="+myRand+"";
		  http.open("GET", modurl, true);
		  // set up the callback function
		  http.onreadystatechange = useHttpResponseAddItemI;
		  http.send(null);
		}
}

function useHttpResponseAddItemI() {
   if (http.readyState == 4) {
    if(http.status == 200) {
	var myresponse=http.responseText;
	var mysplit=myresponse.split("%%");
		FlagAjax=0;
 if (mysplit[0] =="xxx")
 {
	window.location="search_uni.asp";
	return false;
 }
                if (mysplit[0] =="cWL")
		{
	ShowCrtWL();
	  document.getElementById("showprogress").innerHTML="";
	  http.onreadystatechange = null;
	 return false;
		}
                if (mysplit[1] =="ExName")
		{
		document.getElementById("txtError").innerHTML="Wish List with this name already exists. Please change the name.";
		}
		else
		{
		CloseCrtWL();

                   if (mysplit[0] !="xxx")
		{
                   if (mysplit[1] =="LOG")
		   {
			window.location='customersignin.asp';
		   }
		   else
		   {

			if (document.getElementById('XTOTAL'))
			{
			}
			else
//	           	{document.getElementById("XWISH0").innerHTML=" has <b><span id='XITEMTOTAL' name='XITEMTOTAL'>0</span></b> item(s).&nbsp Total qty. of <b><span id='XQTYTOTAL' name='XQTYTOTAL'>0</span></b>. Total price: <b><span id='XTOTAL' name='XTOTAL'>0</span></b>";};		
	           	{document.getElementById("XWISH0").innerHTML=" has <b><span id='XITEMTOTAL' name='XITEMTOTAL'>0</span></b> item(s).&nbsp Total price: <b><span id='XTOTAL' name='XTOTAL'>0</span></b>";};		
	               	document.getElementById("XITEMTOTAL").innerHTML =mysplit[2];
//               		document.getElementById("XQTYTOTAL").innerHTML =mysplit[3];
               		document.getElementById("XTOTAL").innerHTML =mysplit[4];
               document.getElementById("XADDINFO").innerHTML = mysplit[5];
			if  (document.getElementById("XWISHName"))
	           	document.getElementById("XWISHName").innerHTML=mysplit[6];		
		   }
		}
		}
 }
  } else {
//  document.getElementById('XTOTAL').innerHTML = '<img src="anim.gif">';
  }
}


function useHttpResponseIndividual() {
   if (http.readyState == 4) {
    if(http.status == 200) {
	var myresponse=http.responseText;
	var mysplit=myresponse.split("%%");
                   if (mysplit[0] !="xxx")
		{
		if (mysplit[30]=="D")
		document.getElementById("XIMGMAIN").src =  "usmanimage.aspx?disc=Disc&img="+mysplit[0]+"&w="+mysplit[1]+"&h="+mysplit[2];
		else		
		document.getElementById("XIMGMAIN").src =  "http://www.lightsamerica.com/images/images/"+mysplit[0];
		document.getElementById("XIMGMAIN").width =mysplit[1];
		document.getElementById("XIMGMAIN").height =mysplit[2];
	if (document.getElementById("XPRICE")){
               	document.getElementById("XPRICE").innerHTML = mysplit[5];
	}
//	document.getElementById("remont").innerHTML=myresponse+"  ="+mysplit[12]+"  "+mysplit[13];
		if (mysplit[30]=="D")
		{
			if (document.getElementById("AddToWishButton1"))
			{
	       document.getElementById("AddToWishButton1").innerHTML="";
               document.getElementById("AddToWishButton1").href="#";
			}
			if (document.getElementById("AddToWishButton2"))
			{
	             document.getElementById("AddToWishButton2").innerHTML="";
	               document.getElementById("AddToWishButton2").href="#";
			}
		}
		else
		{
			if (document.getElementById("AddToWishButton1"))
	               	{document.getElementById("AddToWishButton1").href="javascript:getAjaxAddItemI("+mysplit[3]+",'"+mysplit[4]+"');";}
			if (document.getElementById("AddToWishButton2"))
	               	{document.getElementById("AddToWishButton2").href="javascript:getAjaxAddItemI("+mysplit[3]+",'"+mysplit[4]+"');";}
		}
		if (document.getElementById("AddToCardButton1"))
               	{
			if (mysplit[12]=="EC")
			{
			if (mysplit[13]=="Y")
				{	
  		document.getElementById("AddToCardButton1").innerHTML="<a href='#'  id=hrefAddCard1 name=hrefAddCard1 ><img src='images/standardicons/add_cart_icon.gif' width='25' height='25' border=0></a>";
		document.getElementById("hrefAddCard1").href="javascript:getAjaxAddCard("+mysplit[3]+",'"+mysplit[4]+"');";

				}                                                                                         
			else
				{	
		document.getElementById("AddToCardButton1").innerHTML="<img src='images/standardicons/notavailable_icon.gif' width='20' height='20' border=0>";
		document.getElementById("AddToCardButton1").innerHTML="";
				}
			}
		}
		if (document.getElementById("AddToCardButton2"))
               	{
			if (mysplit[12]=="EC")
			{
			if (mysplit[13]=="Y")
				{	
		document.getElementById("AddToCardButton2").innerHTML="<a href='#' id=hrefAddCard2 name=hrefAddCard2 class='actionlinks' >Add To Cart</a>";
		document.getElementById("hrefAddCard2").href="javascript:getAjaxAddCard("+mysplit[3]+",'"+mysplit[4]+"');";
				}                                                                                         
			else
				{	
//		document.getElementById("AddToCardButton2").innerHTML="<span class='actionlinks'>Item not Available</span>";
		document.getElementById("AddToCardButton2").innerHTML="";
				}
			}
		}
		if (document.getElementById("XDESCRIPT"))
{ document.getElementById("XDESCRIPT").innerHTML=mysplit[14];}

//               	document.getElementById("AddToWishButton2").href="javascript:getAjaxAddItemI("+mysplit[3]+",'"+mysplit[4]+"');";
//               	document.getElementById("AddToWishButton3").href="javascript:getAjaxAddItemI("+mysplit[3]+",'"+mysplit[4]+"');";
//               	document.getElementById("AddToWishButton4").href="javascript:getAjaxAddItemI("+mysplit[3]+",'"+mysplit[4]+"');";
if (mysplit[20]=="Y")
{
if (document.getElementById("XPRICEITEM"))
{
var myp="<span class='PRICE'>"+mysplit[5]+"</span>   ";
		if (mysplit[29]!="0")
		{
			if (mysplit[29]=="1") myp=myp+"<br /><span class='datatext' align='center'>Only while quantities last</span>";
 			if (mysplit[29]=="2") myp=myp+"<br /><span class='datatext' align='center'>In stock items only</span>";
			if (mysplit[29]=="3") myp=myp+"<br /><span class='datatext' align='center'>No special orders</span>";
			if (mysplit[29]=="4") myp=myp+"<br /><span class='datatext' align='center'>Not valid with any other offer</span>";
			if (mysplit[29]=="5") myp=myp+"<br /><span class='datatext' align='center'>Display Model-Store Pickup Only</span>";
			if (mysplit[29]=="6") myp=myp+"<br /><span class='datatext' align='center'>While quantities last</span>";
		}
document.getElementById("XPRICEITEM").innerHTML=myp;
}
if (document.getElementById("XPRICEREG"))
{
var myp="<span class='pricecut'>Reg Price:</span><span class='pricecutstrike'>"+mysplit[21]+"</span>";
document.getElementById("XPRICEREG").innerHTML=myp;
}
}
else
{
if (document.getElementById("XPRICEITEM"))
{document.getElementById("XPRICEITEM").innerHTML="<span class='pricing'>"+mysplit[5]+"</span>";}
if (document.getElementById("XPRICEREG"))
{document.getElementById("XPRICEREG").innerHTML="";}
}
if (document.getElementById("PrintRef1"))
{document.getElementById("PrintRef1").href="search_individual_result.asp?current="+mysplit[3]+"&PrintItem=Y";}
if (document.getElementById("PrintRef2"))
{document.getElementById("PrintRef2").href="search_individual_result.asp?current="+mysplit[3]+"&PrintItem=Y";}
if (document.getElementById("EmailRef1"))
{document.getElementById("EmailRef1").href="search_individual_result.asp?current="+mysplit[3]+"&EmailFriend=Y";}
if (document.getElementById("EmailRef2"))
{document.getElementById("EmailRef2").href="search_individual_result.asp?current="+mysplit[3]+"&EmailFriend=Y";}
if (document.getElementById("XCOMMENTS"))
{
document.getElementById("XCOMMENTS").innerHTML=mysplit[16];
}
var mystroka="";
if (document.getElementById("EconomParam"))
{
var mykol=0;
mystroka="<table width='322' border='0' align='center' cellpadding='1' cellspacing='1' class='iconrightjustified'>";
mystroka=mystroka+"<tr>"
	if (mysplit[15].substring(0,1)=="Y")
	{
	mystroka=mystroka+"<td width='24' align='right'><img src='images/standardicons/t24_icon.gif' alt='title 24 compatable' width='23' height='23'></td>";
	mystroka=mystroka+"<td width='73' class='datapulltextsm'>Title 24 </td>";
	mykol++;
	}
	if (mysplit[15].substring(1,2)=="Y")
	{
	mystroka=mystroka+"<td width='24' align='right'><img src='images/standardicons/energystar_icon.gif' alt='Energy Star' width='24' height='25'></td>";
	mystroka=mystroka+"<td width='73' class='datapulltextsm'>Energy Star </td>";
	mykol++;
	}
	if (mysplit[15].substring(2,3)=="Y")
	{
	mystroka=mystroka+"<td width='24' align='right'><img src='images/standardicons/energy_efficient_icon.gif' alt='Energy Efficent' width='25' height='25'></td>";
	mystroka=mystroka+"<td width='73' class='datapulltextsm'>Energy Efficient </td>";
	mykol++;
	}
	if (mykol>2)
	{
	mystroka=mystroka+"</tr><tr>"
	mykol++;
	}
	if (mysplit[15].substring(3,4)=="Y")
	{
	mystroka=mystroka+"<td width='24' align='right'><img src='images/standardicons/ada_compliant_icon.gif' alt='Ada Compliant' width='23' height='25'></td>";
	mystroka=mystroka+"<td width='73' class='datapulltextsm'>ADA Compliant </td>";
	mykol++;
	}
	if (mykol>2)
	{
	mystroka=mystroka+"</tr><tr>"
	mykol++;
	}
	if (mysplit[15].substring(4,5)=="Y")
	{
	mystroka=mystroka+"<td width='24' align='right'><img src='images/standardicons/darksky_icon.gif' alt='Dark Sky' width='27' height='25'></td>";
	mystroka=mystroka+"<td width='73' class='datapulltextsm'>Dark Sky </td>";
	mykol++;
	}
if (mykol<3)
{
for(var i=mykol;i<3;i++)
mystroka=mystroka+"<td>&nbsp;</td><td>&nbsp;</td>";
}
mystroka=mystroka+"</tr>";
mystroka=mystroka+"</table>";
document.getElementById("EconomParam").innerHTML=mystroka;
}

//               	document.getElementById("EmailRef2").innerHTML="<a href='search_individual_result.asp?current="+mysplit[3]+"&EmailFriend=Y'  class='couponlinks'>Email This Item</a>";
//               	document.getElementById("SimilarRef1").innerHTML="<a href=\"javascript:document.SearchForm.action='search_result.asp?SI="+mysplit[3]+"';document.SearchForm.submit();\"   class='couponlinks'><img src='images/similar_icon.gif' alt='View Similar' width='16' height='16' border='0' /></a>";
//               	document.getElementById("SimilarRef2").innerHTML="<a href=\"javascript:document.SearchForm.action='search_result.asp?SI="+mysplit[3]+"';document.SearchForm.submit();\"   class='couponlinks'>View Similar Items </a>";
		if (document.getElementById("XanchorIMG"))
		document.getElementById("XanchorIMG").href = "javascript:MM_openBrWindow('product_zoom.asp?ImageName="+mysplit[0]+"','detail','width=600,height=600')";
		if (document.getElementById("XanchorIMG2"))
 		document.getElementById("XanchorIMG2").href = "javascript:MM_openBrWindow('product_zoom.asp?ImageName="+mysplit[0]+"','detail','width=600,height=600')";

mystroka="<table width='195' align='center' cellpadding='0' cellspacing='1' class='datacontentbold'>";
if (mysplit[17]!="")
{
mystroka=mystroka+"<tr>";
mystroka=mystroka+"<td width='82' class='datapulltextsm'>";
 if (GLang=="fra")
 mystroka=mystroka+"Fournisseur:";
 else if (GLang=="spa")
 mystroka=mystroka+"Fabricante:";
 else
 mystroka=mystroka+"Manufacturer:";
mystroka=mystroka+"</td>";
mystroka=mystroka+"<td width='108' class='Databold'>"+mysplit[17]+"</td>";
mystroka=mystroka+"</tr>";
}
if (mysplit[18]!="")
{
mystroka=mystroka+"<tr>";
mystroka=mystroka+"<td width='82' class='datapulltextsm'>Product #:</td>";
mystroka=mystroka+"<td width='108' class='Databold'>"+mysplit[18]+"</td>";
mystroka=mystroka+"</tr>";
}
if (mysplit[8]!="")
{
mystroka=mystroka+"<tr>";
mystroka=mystroka+"<td width='82' class='datapulltextsm'>ID:</td>";
mystroka=mystroka+"<td width='108' class='Databold'>"+mysplit[8]+"</td>";
mystroka=mystroka+"</tr>";
}
if (mysplit[10]!="")
{
mystroka=mystroka+"<tr>";
mystroka=mystroka+"<td width='82' class='datapulltextsm'>";
 if (GLang=="fra")
  mystroka=mystroka+"Finition:";
 else if (GLang=="spa")
  mystroka=mystroka+"Acabado:";
 else
   mystroka=mystroka+"Finish";
mystroka=mystroka+":</td>";
mystroka=mystroka+"<td width='108' class='Databold'>"+mysplit[10]+"</td>";
mystroka=mystroka+"</tr>";
}
if (mysplit[19]!="")
{
mystroka=mystroka+"<tr>";
mystroka=mystroka+"<td width='82' class='datapulltextsm'>";
 if (GLang=="spa")
mystroka=mystroka+"Colecci&oacute;n:";
 else
mystroka=mystroka+"Collection:";
mystroka=mystroka+":</td>";
mystroka=mystroka+"<td width='108' class='Databold'>"+mysplit[19]+"</td>";
mystroka=mystroka+"</tr>";
}
mystroka=mystroka+"</table>";
               	document.getElementById("XINFO1").innerHTML = mystroka;
mystroka="";
mystroka=mystroka+"<table width='350' border='0' align='center' cellpadding='0' cellspacing='1' class='iconrightjustified'>";
mystroka=mystroka+"<tr>";
mystroka=mystroka+"<td colspan='4' class='Databold'>"
 if (GLang=="fra")
  mystroka=mystroka+"Sp&eacute;cifications du produit:"
 else if (GLang=="spa")
  mystroka=mystroka+"Especificaci&oacute;n de Productos";
 else
  mystroka=mystroka+"Product Specifications";
mystroka=mystroka+":</td></tr>"
mystroka=mystroka+"<tr>"
mystroka=mystroka+"<td width='88' valign='top' class='datapulltextsm'>";
if (mysplit[27]!=""&&mysplit[27]!="0")
{
 if (GLang=="fra")
  mystroka=mystroka+"Largeur:";
 else if (GLang=="spa")
  mystroka=mystroka+"Ancho:";
 else
  mystroka=mystroka+"Width:";
}
mystroka=mystroka+"</td>";
mystroka=mystroka+"<td width='97' valign='top' class='Databold'>";
if (mysplit[27]!=""&&mysplit[27]!="0") mystroka=mystroka+mysplit[27];
mystroka=mystroka+"</td>";
mystroka=mystroka+"<td width='55' valign='top' class='datapulltextsm'>";
if (mysplit[23]!=""&&mysplit[23]!="0") mystroka=mystroka+"Extension:";
mystroka=mystroka+"</td>";
mystroka=mystroka+"<td width='105' valign='top' class='Databold'>";
if (mysplit[23]!=""&&mysplit[23]!="0") mystroka=mystroka+mysplit[23];
mystroka=mystroka+"</td>";
mystroka=mystroka+"</tr>";
if (mysplit[28]!="")
{
mystroka=mystroka+"<tr>"
mystroka=mystroka+"<td width='88' valign='top' class='datapulltextsm'>";
if (mysplit[28]!=""&&mysplit[28]!="0") 
{
 if (GLang=="fra")
 mystroka=mystroka+"Hauteur:";
 else if (GLang=="spa")
 mystroka=mystroka+"Alto:";
  else
 mystroka=mystroka+"Height:"
}
mystroka=mystroka+"</td>";
mystroka=mystroka+"<td width='97' valign='top' class='Databold'>";
if (mysplit[28]!=""&&mysplit[28]!="0") mystroka=mystroka+mysplit[28];
mystroka=mystroka+"</td>";
mystroka=mystroka+"<td width='55' valign='top' class='datapulltextsm'></td>";
mystroka=mystroka+"<td width='105' valign='top' class='Databold'></td>";
mystroka=mystroka+"</tr>";
}
mystroka=mystroka+"<tr>";
mystroka=mystroka+"<td colspan='4' class='Databold'>";
if (GLang=="fra")
   mystroka=mystroka+"Lampe";
 else if (GLang=="spa")
   mystroka=mystroka+"Bombilla";
 else
   mystroka=mystroka+"Bulb";
mystroka=mystroka+":</td>";
mystroka=mystroka+"</tr>"
mystroka=mystroka+"<tr>"
mystroka=mystroka+"<td width='88' valign='top' class='datapulltextsm'>";
if (mysplit[24]!=""&&mysplit[24]!="0"&&mysplit[24]!="na")
{
 if (GLang=="spa")
  mystroka=mystroka+"Tipo de bombillas";
 else
  mystroka=mystroka+"Type";
}
mystroka=mystroka+":</td>";
mystroka=mystroka+"<td width='97' valign='top' class='Databold'>";
if (mysplit[24]!=""&&mysplit[24]!="0"&&mysplit[24]!="na") mystroka=mystroka+mysplit[24];
mystroka=mystroka+"</td>";
mystroka=mystroka+"<td width='55' valign='top' class='datapulltextsm'></td>";
mystroka=mystroka+"<td width='105' valign='top' class='Databold'></td>";
mystroka=mystroka+"</tr>";
mystroka=mystroka+"<tr>"
mystroka=mystroka+"<td width='88' valign='top' class='datapulltextsm'>";
if (mysplit[25]!=""&&mysplit[25]!="0")
{
 if (GLang=="fra")
 mystroka=mystroka+"Qt&eacute;e:";
 else if (GLang=="spa")
 mystroka=mystroka+"Cantidad:";
 else
 mystroka=mystroka+"Qty:";
}
mystroka=mystroka+"</td>";
mystroka=mystroka+"<td width='97' valign='top' class='Databold'>";
if (mysplit[25]!=""&&mysplit[25]!="0") mystroka=mystroka+mysplit[25];
mystroka=mystroka+"</td>";
mystroka=mystroka+"<td width='55' valign='top' class='datapulltextsm'></td>";
mystroka=mystroka+"<td width='105' valign='top' class='Databold'></td>";
mystroka=mystroka+"</tr>";
mystroka=mystroka+"<tr>"
mystroka=mystroka+"<td width='88' valign='top' class='datapulltextsm'>";
if (mysplit[26]!=""&&mysplit[26]!="0")
{
 if (GLang=="fra")
   mystroka=mystroka+"Puissance:";
 else if (GLang=="spa")
   mystroka=mystroka+"Potencia de Vatios:";
 else
   mystroka=mystroka+"Wattage:";
}
mystroka=mystroka+"</td>";
mystroka=mystroka+"<td width='97' valign='top' class='Databold'>";
if (mysplit[26]!=""&&mysplit[26]!="0") mystroka=mystroka+mysplit[26];
mystroka=mystroka+"</td>";
mystroka=mystroka+"<td width='55' valign='top' class='datapulltextsm'></td>";
mystroka=mystroka+"<td width='105' valign='top' class='Databold'></td>";
mystroka=mystroka+"</tr>";
mystroka=mystroka+"</table>";
               	document.getElementById("XINFO2").innerHTML = mystroka;
               	document.getElementById("XADDINFO").innerHTML = "";
if (document.getElementById("XINSTINFO"))
{document.getElementById("XINSTINFO").innerHTML = mysplit[9]+"<br/>"+mysplit[10];};
//               	document.getElementById("XINSTINFO").innerHTML = mysplit[10];
//               	document.getElementById("SkuRef").innerHTML ="SKU: "+ mysplit[8];
               	document.getElementById("XADDINFO").innerHTML =  "&nbsp";

if (document.getElementById("productname"))
{               	document.getElementById("productname").innerHTML =  mysplit[9]+"-"+mysplit[11];}
if (mysplit[30]=="D")
{
document.getElementById("Compare5").innerHTML="";
document.getElementById("Compare6").innerHTML="";
}
else
{
var mycomp="<input type='checkbox' name='compare"+mysplit[3]+"'  id='compare"+mysplit[3]+"'";
if (mysplit[7]=="1") 
{
mycomp=mycomp+" checked ";
}
mycomp=mycomp+" onclick='javascript:AddCompare("+mysplit[3]+");'>";
document.getElementById("Compare5").innerHTML=mycomp;
document.getElementById("Compare6").innerHTML="<label for='compare"+mysplit[3]+"'   class='notest'>Compare</label>";
}
//document.getElementById("Compare6").innerHTML="<a href='#'  onclick='javascript:AddCompare("+mysplit[3]+");' class='notes'>Compare</a>";
//		document.getElementById("showprogress").innerHTML="";
//		document.getElementById("showprogress").innerHTML=mycomp

		}
		FlagAjax=0;
	 }
	} 
	else 
	{
	}
}


function AddCompare(itemComp)
{
var elCompare="compare"+itemComp;
var myurl = 'usmanajax_compare1.asp?item='+itemComp+'&switch='
	if (document.getElementById(elCompare).checked==1)
	{ myurl = myurl+'1';}
	else
	{ myurl = myurl+'0';}
		if (FlagAjax == 0 )
		{
		FlagAjax=1;
		  myRand = parseInt(Math.random()*999999999999999);
		  var modurl = myurl+"&rand="+myRand+" ";
		  http.open("GET", modurl, true);
		  http.onreadystatechange = useHttpResponseCompare;
		  http.send(null);
		}

}
function useHttpResponseCompare() {
   if (http.readyState == 4) {
   if(http.status == 200) {
	var myresponse=http.responseText;
	var mysplit=myresponse.split("%%");
		FlagAjax=0;
			 }
   } else {
//  document.getElementById('XTOTAL').innerHTML = '<img src="anim.gif">';
  }
}
function getAjaxAddCard(iditem,idprice){
		if (FlagAjax == 0)
		{
		FlagAjax=1;
		  var myurl = 'usmanajax_addcard.asp?additem='+iditem+'&price='+idprice;
		  innerItemId=iditem;
		  myRand = parseInt(Math.random()*999999999999999);
		  // add random number to URL to avoid cache problems
		  var modurl = myurl+"&rand="+myRand+"";
		  http.open("GET", modurl, true);
		  // set up the callback function
		  http.onreadystatechange = useHttpResponseAddCard;
		  http.send(null);
		}
		
}

function useHttpResponseAddCard() {
   if (http.readyState == 4) {
    if(http.status == 200) {
	var myresponse=http.responseText;
	var mysplit=myresponse.split("%%");
                if (mysplit[0] !="xxx")
		{
			window.location="usmanajax_addcard.asp?3DRedir="+escape(mysplit[1]);
return false;
		}
		FlagAjax=0;
  }
 } else {
//	if (document.getElementById('XTOTAL'))
//	{ document.getElementById('XTOTAL').innerHTML = 'xxxxx';}
  }
}
function ShowCrtWL()
{
 showdeadcenterdiv(550,200,"ViknoCrtWL");
 document.getElementById('ChgCrtName').value="New Wish List";
 document.getElementById('ChgCrtText').value="";
 document.getElementById('ViknoCrtWL').height="200px";
 document.getElementById('ViknoCrtWL').style.height="200px";
 document.getElementById('ViknoCrtWL').style.zIndex=500;
 document.getElementById("ViknoCrtWL").style.visibility='visible';
}
function CloseCrtWL()
{
document.getElementById('ViknoCrtWL').style.zIndex=0;
document.getElementById('ViknoCrtWL').height="0px";
document.getElementById('ViknoCrtWL').style.visibility='hidden';
}
function CreateNewWishList() {
if (FlagAjax == 0 )
{
FlagAjax=1;
document.getElementById("txtError").innerHTML="";
var myurl = "usmanajax_additem.asp?AddWL=451";
myurl=myurl +"&WNM="+escape(document.getElementById("ChgCrtName").value);
myurl=myurl +"&WTX="+escape(document.getElementById("ChgCrtText").value);
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand;
  http.open("GET", modurl, true);
  http.onreadystatechange = useHttpResponseAddItemI;
  http.send(null);
}
}
