//  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 CDNregim=1;  
var RefTextOrImage=0;    //use Image for buttons
var All3DshowMessage=0;  //use message "in-store purchase only" if non 3d commerce
var http = getXMLHTTPRequest();
var innerItemId =123123;
var innerREGIM =0;
var FlagAjax=0;
var sDiv="^%^";
 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+" ";
  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(sDiv);
                if (mysplit[0] !="xxx")
		{
		if (mysplit[39]=="dif.fin")
		{
			document.getElementById("XIMGMAIN").src =  "usmanimage.aspx?disc=DIFFIN&img="+mysplit[0]+"&w="+mysplit[1]+"&h="+mysplit[2]+"&rand="+parseInt(Math.random()*999999999999999);
			document.getElementById("XIMGMAIN").style.width =mysplit[1]+"px";
			document.getElementById("XIMGMAIN").style.height =mysplit[2]+"px";
			document.getElementById("XIMGMAIN").width =mysplit[1];
			document.getElementById("XIMGMAIN").height =mysplit[2];
		}
		else if (mysplit[30]=="D")
		{
		document.getElementById("XIMGMAIN").src =  "usmanimage.aspx?disc=Disc&img="+mysplit[0]+"&w="+mysplit[1]+"&h="+mysplit[2]+"&rand="+parseInt(Math.random()*999999999999999);
			document.getElementById("prevImgName").value =mysplit[3];
		}
		else		
		{
		document.getElementById("XIMGMAIN").usmanimg=mysplit[0];
		if (CDNregim==0)
		{
		document.getElementById("XSHAMAIN").title ="LA";
		document.getElementById("XIMGMAIN").src =  "http://www.lightsamerica.com/images/images/SM5/"+mysplit[0];
		}
		else
		{
		document.getElementById("XSHAMAIN").title ="CDN";
		document.getElementById("XIMGMAIN").src = "http://cdn.lightsamerica.com/images/SM5/"+escape(mysplit[0]);
		document.getElementById("XIMGMAIN").onerror = imgErrorMain;
		}
			document.getElementById("prevImgName").value =mysplit[3];
		}
		document.getElementById("XIMGMAIN").width =mysplit[1];
		document.getElementById("XIMGMAIN").height =mysplit[2];
		document.getElementById("XSHAMAIN").style.width =mysplit[1]+"px";
		document.getElementById("XSHAMAIN").style.height =mysplit[2]+"px";
	if (document.getElementById("XPRICE")){
               	document.getElementById("XPRICE").innerHTML = mysplit[5];
	}
//	document.getElementById("remont").innerHTML=myresponse+"  ="+mysplit[12]+"  "+mysplit[13];
		if (mysplit[39]=="dif.fin")
		{
			if (document.getElementById("AddToWishButton1"))
	               	{document.getElementById("AddToWishButton1").href="javascript:getAjaxLDAddItem("+mysplit[3]+",'"+mysplit[4]+"');";}
			if (document.getElementById("AddToWishButton2"))
	               	{document.getElementById("AddToWishButton2").href="javascript:getAjaxLDAddItem("+mysplit[3]+",'"+mysplit[4]+"');";}
		}
		else 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[39]=="dif.fin")
			{
		  		document.getElementById("AddToCardButton1").innerHTML="";
			}
			else
			{
			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>";
				}
			}
			}
		}
		if (document.getElementById("AddToCardButton2"))
               	{
			if (mysplit[39]=="dif.fin")
			{
		  		document.getElementById("AddToCardButton2").innerHTML="";
			}
			else
			{
			if (mysplit[12]=="EC")
			{
				if (mysplit[13]=="Y")
				{	
					if (RefTextOrImage==1)
					{
						document.getElementById("AddToCardButton2").innerHTML="<a href='#' id=hrefAddCard2 name=hrefAddCard2 class='actionlinks' ><img src='images/btnBuyNow.png' alt='Add to E-commerce Cart' border='0' ></a>";
					}                               	
					else
					{
					  	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>";
					if (All3DshowMessage==1)
					document.getElementById("AddToCardButton2").innerHTML="<span class='Databold'>in-store purchase only</span>";
					else	
					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")
{
		myg=[];
		myg.push("<table border='0' cellspacing='0' cellpadding='0' >");
			if (mysplit[36]!="")
			{
		myg.push("<tr><td class='indTxtList' nowrap>List Price:</td><td>&nbsp;</td><td class='indPriceList' align='right'>"+mysplit[36]+"</td></tr>");
			}
		myg.push("<tr><td class='indTxtReg' nowrap>Reg. Price:</td><td>&nbsp;</td><td class='indPriceReg' align='right'>"+mysplit[22]+"</td></tr>");
		myg.push("<tr><td class='indTxtSale' align='left' nowrap>Sale Price:</td><td>&nbsp;</td><td class='indPriceSale' align='right'>"+mysplit[5]+"</td></tr>");
		if (mysplit[29]!="0")
		{
			myg.push("<tr><td colspan=3 class='datatext' align='left'>"+taxSaleInfo(mysplit[29])+"</td></tr>");
		}
			if (mysplit[37]!="")
			{
		myg.push("<tr><td class='indTxtListSave' nowrap>You Save:</td><td>&nbsp;</td><td class='indPriceListSave' align='right'>"+mysplit[37]+"</td></tr>");
			}

		myg.push("</table>");
		document.getElementById("XPRICEITEM").innerHTML=myg.join("");
}
else
{
			if (mysplit[36]=="")
			{
			document.getElementById("XPRICEITEM").innerHTML=mysplit[5];
			}
			else
			{
				myg=[];
				myg.push("<table border='0' cellspacing='0' cellpadding='0' >");
				myg.push("<tr><td class='indTxtList'>List Price:</td><td>&nbsp;</td><td class='indPriceList' align='right' nowrap>"+mysplit[36]+"</td></tr>");
				myg.push("<tr><td class='indTxtPrice' nowrap>Our Price:</td><td>&nbsp;</td><td class='indPricePrice' align='right'>"+mysplit[5]+"</td></tr>");
					if (mysplit[37]!="")
					{
						myg.push("<tr><td class='indTxtListSave'>You Save:</td><td>&nbsp;</td><td class='indPriceListSave' align='right'>"+mysplit[37]+"</td></tr>");
					}

				myg.push("</table>");
			document.getElementById("XPRICEITEM").innerHTML=myg.join("");
			}
}
var iIm=0;
if (mysplit[39]=="dif.fin")
	iIm=1;
else
	iIm=0;
if (document.getElementById("PrintRef1"))
{document.getElementById("PrintRef1").href="javascript:PrintThisItem("+mysplit[3]+","+iIm+");"}
if (document.getElementById("PrintRef2"))
{document.getElementById("PrintRef2").href="javascript:PrintThisItem("+mysplit[3]+","+iIm+");"}
if (document.getElementById("PrintRef3"))
{document.getElementById("PrintRef3").href="javascript:PrintThisItem("+mysplit[3]+","+iIm+");"}
if (document.getElementById("PrintRef4"))
{document.getElementById("PrintRef4").href="javascript:PrintThisItem("+mysplit[3]+","+iIm+");"}
if (document.getElementById("EmailRef1"))
{document.getElementById("EmailRef1").href="javascript:EmailThisItem("+mysplit[3]+","+iIm+");";}
if (document.getElementById("EmailRef2"))
{document.getElementById("EmailRef2").href="javascript:EmailThisItem("+mysplit[3]+","+iIm+");";}
if (document.getElementById("EmailRef3"))
{document.getElementById("EmailRef3").href="javascript:EmailThisItem("+mysplit[3]+","+iIm+");";}
if (document.getElementById("EmailRef4"))
{document.getElementById("EmailRef4").href="javascript:EmailThisItem("+mysplit[3]+","+iIm+");";}
if (document.getElementById("XCOMMENTS"))
{
document.getElementById("XCOMMENTS").innerHTML=mysplit[16];
}
if (document.getElementById("EconomParam"))
{
var mykol=0;
var buf=[];
buf.push("<table width='322' border='0' align='center' cellpadding='1' cellspacing='1' class='iconrightjustified'>");
buf.push("<tr>");
	if (mysplit[15].substring(0,1)=="Y")
	{
	buf.push("<td width='24' align='right'><img src='images/standardicons/t24_icon.gif' alt='title 24 compatable' width='23' height='23'></td>");
	buf.push("<td width='73' class='datapulltextsm'>Title 24 </td>");
	mykol++;
	}
	if (mysplit[15].substring(1,2)=="Y")
	{
	buf.push("<td width='24' align='right'><img src='images/standardicons/energystar_icon.gif' alt='Energy Star' width='24' height='25'></td>");
	buf.push("<td width='73' class='datapulltextsm'>Energy Star </td>");
	mykol++;
	}
	if (mysplit[15].substring(2,3)=="Y")
	{
	buf.push("<td width='24' align='right'><img src='images/standardicons/energy_efficient_icon.gif' alt='Energy Efficent' width='25' height='25'></td>");
	buf.push("<td width='73' class='datapulltextsm'>Energy Efficient </td>");
	mykol++;
	}
	if (mykol>2)
	{
	buf.push("</tr><tr>");
	mykol++;
	}
	if (mysplit[15].substring(3,4)=="Y")
	{
	buf.push("<td width='24' align='right'><img src='images/standardicons/ada_compliant_icon.gif' alt='Ada Compliant' width='23' height='25'></td>");
	buf.push("<td width='73' class='datapulltextsm'>ADA Compliant </td>");
	mykol++;
	}
	if (mykol>2)
	{
	buf.push("</tr><tr>");
	mykol++;
	}
	if (mysplit[15].substring(4,5)=="Y")
	{
	buf.push("<td width='24' align='right'><img src='images/standardicons/darksky_icon.gif' alt='Dark Sky' width='27' height='25'></td>");
	buf.push("<td width='73' class='datapulltextsm'>Dark Sky </td>");
	mykol++;
	}
if (mykol<3)
{
for(var i=mykol;i<3;i++)
buf.push("<td>&nbsp;</td><td>&nbsp;</td>");
}
buf.push("</tr>");
buf.push("</table>");
document.getElementById("EconomParam").innerHTML=buf.join("");
}

//               	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 (mysplit[35]=="")
	{
		if (document.getElementById("XanchorIMG"))
		document.getElementById("XanchorIMG").href = "javascript:DoNothing();"
		if (document.getElementById("XanchorIMG2"))
		document.getElementById("XanchorIMG2").href = "javascript:DoNothing();";
		if (document.getElementById("XanchorIMG1"))
		document.getElementById("XanchorIMG1").href = "javascript:DoNothing();";
		if (document.getElementById("XZoom1"))
		document.getElementById("XZoom1").style.visibility="hidden";
		if (document.getElementById("XZoom2"))
		document.getElementById("XZoom2").style.visibility="hidden";
	}
	else
	{
		if (document.getElementById("XanchorIMG"))
		document.getElementById("XanchorIMG").href = "javascript:MM_openBrWindow('http://www.search52.com/javala/flash_zoom.asp?p="+mysplit[35]+"','detail','width=840,height=650')";
		if (document.getElementById("XanchorIMG2"))
		document.getElementById("XanchorIMG2").href = "javascript:MM_openBrWindow('http://www.search52.com/javala/flash_zoom.asp?p="+mysplit[35]+"','detail','width=840,height=650')";
		if (document.getElementById("XanchorIMG1"))
		document.getElementById("XanchorIMG1").href = "javascript:MM_openBrWindow('http://www.search52.com/javala/flash_zoom.asp?p="+mysplit[35]+"','detail','width=840,height=650')";
		if (document.getElementById("XZoom1"))
		document.getElementById("XZoom1").style.visibility="visible";
		if (document.getElementById("XZoom2"))
		document.getElementById("XZoom2").style.visibility="visible";
	}

///	if (document.getElementById("XanchorIMG"))
///	document.getElementById("XanchorIMG").href = "javascript:MM_openBrWindow('http://www.search52.com/javala/flash_zoom.asp?p="+mysplit[35]+"','detail','width=840,height=650')";
///	if (document.getElementById("XanchorIMG2"))
///	document.getElementById("XanchorIMG2").href = "javascript:MM_openBrWindow('http://www.search52.com/javala/flash_zoom.asp?p="+mysplit[35]+"','detail','width=840,height=650')";
buf=[];
buf.push("<table width='195' align='center' cellpadding='0' cellspacing='1' class='datacontentbold'>");
if (mysplit[17]!="")
{
buf.push("<tr>");
buf.push("<td width='82' class='datapulltextsm'>");
 if (GLang=="fra")
 buf.push("Fournisseur:");
 else if (GLang=="spa")
 buf.push("Fabricante:");
 else
 buf.push("Manufacturer:");
buf.push("</td>");
buf.push("<td width='108' class='Databold'>"+mysplit[17]+"</td>");
buf.push("</tr>");
}
if (mysplit[18]!="")
{
buf.push("<tr>");
buf.push("<td width='82' class='datapulltextsm'>Product #:</td>");
buf.push("<td width='108' class='Databold'>"+mysplit[18]+"</td>");
buf.push("</tr>");
}
if (usmCheckValue(mysplit[8]))
{
		if (mysplit[39]!="dif.fin")
		{
		buf.push("<tr>");
		buf.push("<td width='82' class='datapulltextsm'>ID:</td>");
		buf.push("<td width='108' class='Databold'>"+mysplit[8]+"</td>");
		buf.push("</tr>");
		}
}
if (usmCheckValue(mysplit[10]))
{
buf.push("<tr>");
buf.push("<td width='82' class='datapulltextsm'>");
 if (GLang=="fra")
  buf.push("Finition:");
 else if (GLang=="spa")
  buf.push("Acabado:");
 else
   buf.push("Finish");
buf.push(":</td>");
buf.push("<td width='108' class='Databold'>"+mysplit[10]+"</td>");
buf.push("</tr>");
}
if (mysplit[19]!="")
{
buf.push("<tr>");
buf.push("<td width='82' class='datapulltextsm'>");
 if (GLang=="spa")
buf.push("Colecci&oacute;n:");
 else
buf.push("Collection:");
buf.push(":</td>");
buf.push("<td width='108' class='Databold'>"+mysplit[19]+"</td>");
buf.push("</tr>");
}
buf.push("</table>");
               	document.getElementById("XINFO1").innerHTML = buf.join("");
buf=[]
buf.push("<table width='350' border='0' align='center' cellpadding='0' cellspacing='1' class='iconrightjustified'>");
buf.push("<tr>");
buf.push("<td colspan='4' class='Databold'>");
 if (GLang=="fra")
  buf.push("Sp&eacute;cifications du produit:");
 else if (GLang=="spa")
  buf.push("Especificaci&oacute;n de Productos");
 else
  buf.push("Product Specifications");
buf.push(":</td></tr>");
buf.push("<tr>");
buf.push("<td width='88' valign='top' class='datapulltextsm'>");
if (usmCheckValue(mysplit[27]))
{
 if (GLang=="fra")
  buf.push("Largeur/Dia:");
 else if (GLang=="spa")
  buf.push("Ancho/Dia:");
 else
  buf.push("Width/Dia:");
}
buf.push("</td><td width='97' valign='top' class='Databold'>");
	if (usmCheckValue(mysplit[27])) buf.push(mysplit[27]);;
buf.push("</td><td width='55' valign='top' class='datapulltextsm'>");
	if (usmCheckValue(mysplit[23])) buf.push("Extension:");
buf.push("</td><td width='105' valign='top' class='Databold'>");
	if (usmCheckValue(mysplit[23])) buf.push(mysplit[23]);
buf.push("</td></tr>");
if (usmCheckValue(mysplit[28]))
{
buf.push("<tr>");
buf.push("<td width='88' valign='top' class='datapulltextsm'>");
 if (GLang=="fra")
 buf.push("Hauteur:");
 else if (GLang=="spa")
 buf.push("Alto:");
  else
 buf.push("Height:");
buf.push("</td><td width='97' valign='top' class='Databold'>"+mysplit[28]+"</td>");
buf.push("<td width='55' valign='top' class='datapulltextsm'></td><td width='105' valign='top' class='Databold'></td></tr>");
}
if (usmCheckValue(mysplit[38]))
{
buf.push("<tr>");
buf.push("<td width='88' valign='top' class='datapulltextsm'>Length");
buf.push("</td><td width='97' valign='top' class='Databold'>"+mysplit[38]+"</td>");
buf.push("<td width='55' valign='top' class='datapulltextsm'></td><td width='105' valign='top' class='Databold'></td></tr>");
}
buf.push("<tr>");
buf.push("<td colspan='4' class='Databold'>");
if (GLang=="fra")
   buf.push("Lampe");
 else if (GLang=="spa")
   buf.push("Bombilla");
 else
   buf.push("Bulb");
buf.push(":</td>");
buf.push("</tr>");
if (usmCheckValue(mysplit[24]))
{
	buf.push("<tr><td width='88' valign='top' class='datapulltextsm'>");
 if (GLang=="spa")
	  buf.push("Tipo de bombillas:");
 else
	  buf.push("Type:");
buf.push("</td><td width='97' valign='top' class='Databold'>"+mysplit[24]+"</td>");
buf.push("<td width='55' valign='top' class='datapulltextsm'></td><td width='105' valign='top' class='Databold'></td></tr>");
}
if (usmCheckValue(mysplit[25]))
{
buf.push("<tr><td width='88' valign='top' class='datapulltextsm'>");
 if (GLang=="fra")
	 buf.push("Qt&eacute;e:");
 else if (GLang=="spa")
	 buf.push("Cantidad:");
 else
	 buf.push("Qty:");
buf.push("</td><td width='97' valign='top' class='Databold'>"+mysplit[25]+"</td>");
buf.push("<td width='55' valign='top' class='datapulltextsm'></td><td width='105' valign='top' class='Databold'></td></tr>");
}
if (usmCheckValue(mysplit[26]))
{
buf.push("<tr><td width='88' valign='top' class='datapulltextsm'>");
 if (GLang=="fra")
	   buf.push("Puissance:");
 else if (GLang=="spa")
	   buf.push("Potencia de Vatios:");
 else
	   buf.push("Wattage:");
buf.push("</td><td width='97' valign='top' class='Databold'>"+mysplit[26]+"</td>");
buf.push("<td width='55' valign='top' class='datapulltextsm'></td><td width='105' valign='top' class='Databold'></td></tr>");
}
buf.push("</table>");
if (mysplit[31]=="SCO")
{
               	document.getElementById("XSCO").innerHTML = "Schonbek products and prices shown are valid for North American customers and shipments (110V) only.";
}
else
{
               	document.getElementById("XSCO").innerHTML = "";
}
if (mysplit[32]=="")
{
document.getElementById("XQTYNAME1").innerHTML = "";
document.getElementById("XQTY1").innerHTML = "";
}
else
{
document.getElementById("XQTYNAME1").innerHTML = "Factory Availability:";
document.getElementById("XQTY1").innerHTML =mysplit[32];
}
               	document.getElementById("XINFO2").innerHTML = buf.join("");
               	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);
}
}
function imgErrorMain()
{
this.src="http://lightsamerica.com/images/images/SM5/" +escape(this.usmanimg);
document.getElementById("XSHAMAIN").title="LAe";
this.onerror=null;
return true;
}
///////////Few Finishes /////////
function ChangeFinish()
{
var arrID=document.getElementById("selDiffFinish").value.split(";");
if (arrID[0]=="0" || arrID[0]=="")
{
getAjaxNoImg(arrID[1]);
}
else
{
getAjaxGlavImg(arrID[0]);
}
}
function getAjaxNoImg(iditem) {
if (FlagAjax == 0 )
{
FlagAjax=1;
  var myurl = "usmanajax_individ.asp?individual="+iditem+"&NOIMG=YYY&prevImg="+usmEscape(document.getElementById("prevImgName").value);
  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+" ";
  http.open("GET", modurl, true);
  // set up the callback function
  http.onreadystatechange = useHttpResponseIndividual;
  http.send(null);
}
}
                                                    
function getAjaxLDAddItem(iditem,idprice,mannum){
		if (FlagAjax == 0)
		{
		FlagAjax=1;
		  var myurl = 'usmanajax_additem.asp?LDadd='+iditem+'&price='+idprice+'&kol=1&mannum='+mannum;
		  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 PrintThisItem(ID,iImage)
{
 document.getElementById('PrintHdf').value=ID;
 document.getElementById('idExistImage').value=iImage;
 showdeadcenterdiv(350,200,"ViknoPrint");
 document.getElementById('ViknoPrint').style.zIndex=500;
 document.getElementById("ViknoPrint").style.visibility='visible';
}
function StartPrintItem()
{
ClosePrint();
var myurl="print_item_detail.asp?item="+document.getElementById("PrintHdf").value;
myurl=myurl+"&noimg="+document.getElementById('idExistImage').value;
myurl=myurl+"&locationid="+document.getElementById("LocStore1").value;
myurl=myurl+"&comment="+escape(document.getElementById("ChgPrtText").value);
myurl=myurl+"&prevImg="+usmEscape(document.getElementById("prevImgName").value)
window.open(myurl);
}

function ClosePrint()
{
document.getElementById('ViknoPrint').style.zIndex=0;
document.getElementById('ViknoPrint').height="0px";
document.getElementById('ViknoPrint').style.visibility='hidden';
}

function EmailThisItem(ID,iImage)
{
 document.getElementById('EmailHdf').value=ID;
 document.getElementById('idExistImage').value=iImage;
 showdeadcenterdiv(350,200,"ViknoEmail");
 document.getElementById('ViknoEmail').style.zIndex=500;
 document.getElementById("ViknoEmail").style.visibility='visible';
}
function CloseEmail()
{
document.getElementById('ViknoEmail').style.zIndex=0;
document.getElementById('ViknoEmail').height="0px";
document.getElementById('ViknoEmail').style.visibility='hidden';
}

function StartEmailItem()
{
var strError="";
var s="";
document.getElementById("email").style.backgroundColor="#FFFFFF";
document.getElementById("youremail").style.backgroundColor="#FFFFFF";
if (document.getElementById("youremail").value=="")

if (document.getElementById("youremail").value=="")
{
document.getElementById("youremail").style.backgroundColor="#FFF000";
s="You entered  an invalid e-mail address \r\n";
}
else if (!checkemail(document.getElementById("youremail").value))
{
strError=strError+"Your Email is incorrect.Please check. \r\n";
} 
if (document.getElementById("yourname").value=="")
{
strError=strError+"Please Input Your Name \r\n";
}
if (document.getElementById("email").value=="")
{
strError=strError+"Please Input Recipient E-mail \r\n";
}
else if (!checkemail(document.getElementById("email").value))
{
document.getElementById("email").style.backgroundColor="#FFF000";
s="You entered  an invalid e-mail address \r\n";
} 
strError=strError+s;
if (strError!="")
{
alert(strError);
}
else
{
CloseEmail();
var myurl="usmanajax_ind_email.asp?item="+document.getElementById("EmailHdf").value;
myurl=myurl+"&email="+document.getElementById("email").value;
myurl=myurl+"&yourname="+escape(document.getElementById("yourname").value);
myurl=myurl+"&youremail="+escape(document.getElementById("youremail").value);
myurl=myurl+"&location="+document.getElementById("LocStore2").value;
myurl=myurl+"&comment="+escape(document.getElementById("ChgEmText").value);
myurl=myurl+"&noimg="+document.getElementById('idExistImage').value;
myurl=myurl+"&prevImg="+usmEscape(document.getElementById("prevImgName").value);
ShowDivProg();
		if (FlagAjax == 0)
		{
		FlagAjax=1;
		  myRand = parseInt(Math.random()*999999999999999);
		  var modurl = myurl+"&rand="+myRand+"";
		  http.open("GET", modurl, true);
		  // set up the callback function
		  http.onreadystatechange = useHttpIndEmail;
		  http.send(null);
		}
}
}
function useHttpIndEmail() {
   if (http.readyState == 4) {
    if(http.status == 200) {
CloseDivProg();
	var myresponse=http.responseText;
	var mysplit=myresponse.split("%%");
		FlagAjax=0;
		if (mysplit[0]=="y")
		{
alert(mysplit[1]);
		}
 }
  }
}
function DoNothing()
{
}
