//  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 REGIMStart=0;
var ItemsOnPage=0;
var OrderInd=0;
var GroupBy=0;
var CodeBy=0;
var GCurPage=0;
var GTotPage=0;
var RegimHeightTable=0;
//var MessWaitingAnilize="<table bgcolor=#FFFFFF bordercolor='B4D8D4' border=2><tr><td height='100px' width='400px' align=center valign=middle style='FONT-WEIGHT: bold; FONT-SIZE: 25px; COLOR: #ff8205;'>Analyzing database</td></tr></table>";
var MessWaitingAnilize="<table bgcolor=#FFFFFF style='BORDER:  #B4D8D4 3px solid;' ><tr><td><img src='progress2.gif' border='0'></td></tr></table>";

 var br = navigator.userAgent.toLowerCase();
 var ie = br.indexOf('msie');

 
function formatNumber0(num) 
{
s=""+num;r="";k=0;
for(var i=s.length-1;i>-1;i--)
{r=s.charAt(i)+r;k++;	if (k>2&&i>0) {r=","+r;k=0;}}
return r;
}


/////////////// NEXT PAGE
function getAjaxNextPage()
{
if (NoAjax>0){
if ((parseInt(GCurPage))<GTotPage)
{
//document.location.hash = '#page='+(1+parseInt(GCurPage));
document.location="search_result.asp?"+GlobPar+"&page="+(1+parseInt(GCurPage));
return false;
}}
  var myurl = 'usmanajax_result.asp?page=next';
if (FlagAjax == 0 )
{
FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  // 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 = useHttpResponseNextPage;
  http.send(null);
}
}


function useHttpResponseNextPage() {
var mystroka="";
var myEval="";
var myarr;
   if (http.readyState == 4) {
    if(http.status == 200) {
	var myresponse=http.responseText;
	myDrawPage(myresponse);
		FlagAjax=0;
  document.getElementById("showprogress").innerHTML="";
  document.getElementById("showprogress").visibility = "hidden";
	 }
	} 
	else 
	{
//                 document.getElementById("XITEM1").innerHTML =" ";
  document.getElementById("showprogress").innerHTML=MessWaitingAnilize;
  document.getElementById("showprogress").visibility = "visible";
	}
}
/////////////////// PREVIOUS PAGE
function getAjaxPrevPage()
{
if (NoAjax>0){
if ((parseInt(GCurPage))>1)
{
//document.location.hash = '#page='+(parseInt(GCurPage)-1);
document.location="search_result.asp?"+GlobPar+"&page="+(parseInt(GCurPage)-1);
return false;
}}
  var myurl = 'usmanajax_result.asp?page=prev';
if (FlagAjax == 0 )
{
FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  // 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 = useHttpResponsePrevPage;
  http.send(null);
}
}

function useHttpResponsePrevPage() {
var mystroka="";
var myEval="";
var myarr;
   if (http.readyState == 4) {
    if(http.status == 200) {
	var myresponse=http.responseText;
	myDrawPage(myresponse);
		FlagAjax=0;
  document.getElementById("showprogress").innerHTML="";
  document.getElementById("showprogress").visibility = "hidden";
	 }
	} 
	else 
	{
//              document.getElementById("XITEM1").innerHTML = " ";
 document.getElementById("showprogress").innerHTML=MessWaitingAnilize;
 document.getElementById("showprogress").visibility = "visible";
	}
}
/////////////////// PAGE NUMBER
function getAjaxPageNumber(numberpage)
{
	if  (document.getElementById("ItemsOnPage"))
	{ItemsOnPage=parseInt(document.getElementById("ItemsOnPage").value);}
	else
	{ItemsOnPage=9};
if (document.getElementById("OrderInd"))
{OrderInd=parseInt(document.getElementById("OrderInd").value);}
else
{OrderInd=0}
if (numberpage=="1")
{
var mIE=""
var k=(ExpandFixType)? "t":"f";
mIE=k
k=(ExpandFinish)? "t":"f";
mIE=mIE+k;
k=(ExpandStyle)? "t":"f";
mIE=mIE+k;
k=(ExpandBrand)? "t":"f";
mIE=mIE+k;
k=(ExpandWidth)? "t":"f";
mIE=mIE+k;
k=(ExpandHeight)? "t":"f";
mIE=mIE+k;
k=(ExpandLed)? "t":"f";
mIE=mIE+k;
k=(ExpandVoltage)? "t":"f";
mIE=mIE+k;
k=(ExpandColoredGlass)? "t":"f";
mIE=mIE+k;
k=(ExpandMount)? "t":"f";
mIE=mIE+k;
k=(ExpandPrice)? "t":"f";
mIE=mIE+k;
k=(ExpandOptions)? "t":"f";
mIE=mIE+k;
k=(ExpandInst)? "t":"f";
mIE=mIE+k;
if (GlobPage>0)
{
  var myurl = 'usmanajax_result.asp?page=number&number='+GlobPage+'&qitems='+ItemsOnPage+'&orderind='+OrderInd+'&menu='+mIE;
GlobPage=0;
}
else
{
  var myurl = 'usmanajax_result.asp?page=number&number='+numberpage+'&qitems='+ItemsOnPage+'&orderind='+OrderInd+'&menu='+mIE;
}
REGIMStart=1;

}
else
{
if (NoAjax>0){
if ((1+parseInt(GCurPage))<GTotPage)
{
//document.location.hash = '#page='+(1+parseInt(GCurPage));
document.location="search_result.asp?"+GlobPar+"&page="+document.getElementById("CurrentPage").value;
return false;
}}
  var myurl = 'usmanajax_result.asp?page=number&number='+document.getElementById("CurrentPage").value;
REGIMStart=0;
}
if (FlagAjax == 0 )
{
FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  // 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 = useHttpResponsePageNumber;
  http.send(null);
}
}

function useHttpResponsePageNumber() {
var mystroka="";
var myEval="";
var myarr;
var ItemsOnPage;
var sdvig;
   if (http.readyState == 4) {
    if(http.status == 200) {
	var myresponse=http.responseText;
//document.getElementById("countajax").innerHTML=myresponse;
	myDrawPage(myresponse);
if (RegimHeightTable==1)
{
GdIK();
}
		FlagAjax=0;
  document.getElementById("showprogress").innerHTML="";
  document.getElementById("showprogress").visibility = "hidden";
	 }
	} 
	else 
	{
//               document.getElementById("XITEM1").innerHTML = ' ';
	if (document.getElementById("showprogress").innerHTML=="")
	{
  document.getElementById("showprogress").innerHTML=MessWaitingAnilize;
  document.getElementById("showprogress").visibility = "visible";
	}
	}
}
function useHttpResponseIndividual() {
   if (http.readyState == 4) {
    if(http.status == 200) {
	var myresponse=http.responseText;
	var mysplit=myresponse.split("%%");
 if (mysplit[0] =="xxx")
 {
	window.location="search_uni.asp";
	return false;
 }
                   if (mysplit[0] !="xxx")
		{
               document.getElementById("XIMGMAIN").innerHTML = mysplit[0];
               document.getElementById("XINFOMAIN").innerHTML = mysplit[1];
               document.getElementById("XADDINFO").innerHTML =  " ";
               document.getElementById("XANIM").innerHTML =  " ";
		}
  http.onreadystatechange =null;
		FlagAjax=0;
	 }
	} 
	else 
	{
//               document.getElementById("XANIM").innerHTML =  '<img src="anim.gif">';
	}
}
/////////add item
function getAjaxAddItem(iditem,idprice){
		if (FlagAjax == 0)
		{
		FlagAjax=1;
		  var myurl = 'usmanajax_additem.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 = useHttpResponseAddItem;
		  http.send(null);
		}
		
}

function useHttpResponseAddItem() {
   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];
			if  (document.getElementById("XWISHName"))
	           	document.getElementById("XWISHName").innerHTML=mysplit[6];		
		   }
		}
		}
  document.getElementById("showprogress").innerHTML="";
	  http.onreadystatechange = null;
  }
 } else {
//	if (document.getElementById('XTOTAL'))
//	{ document.getElementById('XTOTAL').innerHTML = 'xxxxx';}
  }
}
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("%%");
		FlagAjax=0;
 if (mysplit[0] =="xxx")
 {
	window.location="search_uni.asp";
	return false;
 }
                if (mysplit[0] !="xxx")
		{
			window.location="usmanajax_addcard.asp?3DRedir="+escape(mysplit[1]);
			return false;
		}
  }
 } else {
//	if (document.getElementById('XTOTAL'))
//	{ document.getElementById('XTOTAL').innerHTML = 'xxxxx';}
  }
}

function myDrawPage(myresponse)
{
	var mysplit=myresponse.split("%%");
if (mysplit[0]=="endsession")
{
window.location="search.asp";
return ;
}
var promstring;
var mystroka;
var mestoTab;
//mysplit 
//0-Items on Page
//1-Colls in Row
//2-Image Size for search
//3-Current Page
//4-Page Total Count
//5-Prev page
//6-next page
//7-compare
//8-debug
//document.getElementById("test2").innerHTML=myresponse;
//
//9-found Items 
//10-checkbox ECommerice
//11.... Regim Search onsale
//12.... Items
sdvig=11;
if (mysplit[0]>9) window.scrollTo(0,0);
if (document.getElementById("ItogoItems"))
{document.getElementById("ItogoItems").innerHTML="&nbsp;"+formatNumber0(mysplit[9])+"&nbsp;";}
//document.getElementById("ItogoItems").innerHTML=mysplit[6];
 if (document.getElementById("ECitems"))
{
	if  (mysplit[10]=="1")
	{document.getElementById("ECitems").checked=true;}
}
if ((0+mysplit[9])==0)
{
 if (document.getElementById("stock"))
{document.getElementById("stock").checked=false;}
if (document.getElementById("ManGroup"))
{document.getElementById("ManGroup").value="0";}
if (document.getElementById("ManufacturerName"))
{document.getElementById("ManufacturerName").value="0";}
if ((0+mysplit[11])==1)
alert("Currently there are no Sale items.");
else
alert('       Item not found.\nPlease expand your Search.');
window.location='search_result.asp?previous=Y&nothing=Y';
//myPreviousSearch();
return ;
}
if (mysplit[0]=="undefined")
{
window.location="search.asp";
return ;
}
 if (mysplit[0] =="xxx")
 {
	window.location="search_uni.asp";
	return false;
 }

             if (mysplit[0] !="xxx" )
		{
ItemsOnPage=parseInt(mysplit[0]);
GCurPage=parseInt(mysplit[3]);
GTotPage=parseInt(mysplit[4]);
	if (REGIMStart==1)
	{
var buf=[];
buf.push("&nbsp;Page ");
buf.push("<select id=CurrentPage name=CurrentPage onchange='javascript:getAjaxPageNumber();' class=textbox ><font color=black>");
		for(var str=1;str<parseInt(mysplit[4])+1;str++)
		{
buf.push("<option value='"+str+"' >"+str+"</option>");
		}
buf.push("</font></select>");
buf.push(" of "+mysplit[4]+"&nbsp;&nbsp;");
	if (document.getElementById("RisCurrentPage"))
	{
        document.getElementById("RisCurrentPage").innerHTML =buf.join("");
	if (document.getElementById("CurrentPage"))
	{
	document.getElementById("CurrentPage").value=mysplit[3];
	}
	}
buf=[];
var RowQuantity=ItemsOnPage/3;
buf.push("<TABLE cellSpacing=0 cellPadding=0 width='650px' class=resulttable align=left  border=0>");
buf.push("<TBODY>");

		for (var row=1;row<RowQuantity+1;row++)
		{
buf.push("<TR>");
			for(var kol=1;kol<4;kol++)
			{
mestoTab=(row-1)*3+kol;
buf.push("<TD width='33%'><TABLE cellSpacing=0 cellPadding=0 width='100%' border=0>");
buf.push("<TBODY><TR><TD valign=top width='120px' height='120px' align='center'>");
buf.push("<div id='i"+mestoTab+"' name='i"+mestoTab+"' style='position:absolute;' ></div>");
buf.push("<DIV align=center style='POSITION: relative; margin-bottom:-5px;z-index:1;' id='d"+mestoTab+"'>");
buf.push("<A id='XAnchorIMG"+mestoTab+"' name='XAnchorIMG"+(mestoTab )+"'>");
buf.push("<img src='images/onlineimage.gif'  ID='XSHA"+mestoTab +"' name='XSHA"+mestoTab+"' border='0' style='position: absolute;left:0;top:0;width:120px;height:120px;z-index:10;'>");
buf.push("<IMG ID='XIMG"+mestoTab +"' name='XIMG"+mestoTab+"' border='0'></a>");
buf.push("</DIV></TD>");
buf.push("<TD vAlign=top align=left>");
buf.push("<DIV ID='XITEM"+(mestoTab )+"' NAME='XITEM"+(mestoTab )+"'></DIV>");
buf.push("</TD></TR>");
buf.push("</TBODY></TABLE>");
buf.push("</TD>");
				if (kol<3)
				{
	buf.push("<TD width='1%'>");
	buf.push("<DIV align=center><IMG height=165 src='images/vert_rule.gif' width=3></DIV>");
	buf.push("</TD>");
				}
			}
buf.push("</TR>");
buf.push("<TR>");
			for(var kol=1;kol<4;kol++)
			{
			buf.push("<TD><DIV align=center><IMG height=3 src='images/small_grey_rule.gif' width='99%'></DIV></TD>");
				if (kol<3)
				{
			buf.push("<TD><DIV align=center><IMG height=2 src='images/spacer.gif' width='2px'></DIV></TD>");
				}
			}
buf.push("</TR>");
		}
buf.push("</TBODY>");
buf.push("</TABLE>");

               document.getElementById("setka").innerHTML = buf.join("");
	}
	else
	{
               document.getElementById("CurrentPage").value = mysplit[3];
	};
		REGIMStart=0;
				if (mysplit[5]=="prev")
				{
		var strPrev="PREVIOUS";
		if (GLang=="fra")
		strNext="PR&Eacute;C&Eacute;DENT";
		else if (GLang=="spa")
		strNext="Anterior";
		if (document.getElementById("XPREVPGTOPI"))
               document.getElementById("XPREVPGTOPI").innerHTML = "<a href='javascript:getAjaxPrevPage();'  nowrap><img src='images/standardicons/previousbutton.gif' width='25' height='25' border=0></a>";
		if (document.getElementById("XPREVPGTOP"))
               document.getElementById("XPREVPGTOP").innerHTML = "<a class='mainpagebuttons' href='javascript:getAjaxPrevPage();'  nowrap>"+strPrev+"</a>";
		if (document.getElementById("X2PREVPGTOPI"))
               document.getElementById("X2PREVPGTOPI").innerHTML = "<a href='javascript:getAjaxPrevPage();'  nowrap><img src='images/standardicons/previousbutton.gif' width='25' height='25' border=0></a>";
		if (document.getElementById("X2PREVPGTOP"))
               document.getElementById("X2PREVPGTOP").innerHTML = "<a class='mainpagebuttons' href='javascript:getAjaxPrevPage();'  nowrap>"+strPrev+"</a>";
                		}
				else
				{
		if (document.getElementById("XPREVPGTOP"))
               document.getElementById("XPREVPGTOP").innerHTML = "<img src='images/shim.gif' width=68px height=25px border=0 >";
		if (document.getElementById("XPREVPGTOPI"))
               document.getElementById("XPREVPGTOPI").innerHTML = "<img src='images/shim.gif' width=25px height=25px border=0 >";
		if (document.getElementById("X2PREVPGTOP"))
               document.getElementById("X2PREVPGTOP").innerHTML = "<img src='images/shim.gif' width=68px height=25px border=0 >";
		if (document.getElementById("X2PREVPGTOPI"))
               document.getElementById("X2PREVPGTOPI").innerHTML = "<img src='images/shim.gif' width=25px height=25px border=0 >";
				}
				if (mysplit[5]=="prev" && mysplit[6]=="next")
			{
               document.getElementById("XMIDPAGES").innerHTML = "&nbsp|&nbsp";
               document.getElementById("X2MIDPAGES").innerHTML = "&nbsp|&nbsp";
			}
				else
			{
               document.getElementById("XMIDPAGES").innerHTML = "&nbsp&nbsp&nbsp";
               document.getElementById("X2MIDPAGES").innerHTML = "&nbsp&nbsp&nbsp";
			}
				if (mysplit[6]=="next")
				{		
		var strNext="NEXT";
		if (GLang=="fra")
		strNext="SUIVANT";
		else if (GLang=="spa")
		strNext="Siguiente";
		if (document.getElementById("XNEXTPGTOP"))
               document.getElementById("XNEXTPGTOP").innerHTML = "<a class='mainpagebuttons' href='javascript:getAjaxNextPage();' nowrap>"+strNext+"</a>";
		if (document.getElementById("XNEXTPGTOPI"))
               document.getElementById("XNEXTPGTOPI").innerHTML = "<a href='javascript:getAjaxNextPage();' nowrap><img src='images/standardicons/nextbutton.gif' width='25' height='25' border=0></a>";
		if (document.getElementById("X2NEXTPGTOP"))
               document.getElementById("X2NEXTPGTOP").innerHTML = "<a class='mainpagebuttons' href='javascript:getAjaxNextPage();' nowrap>"+strNext+"</a>";
		if (document.getElementById("X2NEXTPGTOPI"))
               document.getElementById("X2NEXTPGTOPI").innerHTML = "<a href='javascript:getAjaxNextPage();' nowrap><img src='images/standardicons/nextbutton.gif' width='25' height='25' border=0></a>";
				}
				else
				{
		if (document.getElementById("XNEXTPGTOP"))
               document.getElementById("XNEXTPGTOP").innerHTML = "<img src='images/shim.gif' width=42px height=25px border=0 >";
		if (document.getElementById("XNEXTPGTOPI"))
               document.getElementById("XNEXTPGTOPI").innerHTML = "<img src='images/shim.gif' width=25px height=25px border=0 >";
		if (document.getElementById("X2NEXTPGTOP"))
               document.getElementById("X2NEXTPGTOP").innerHTML = "<img src='images/shim.gif' width=42px height=25px border=0 >";
		if (document.getElementById("X2NEXTPGTOPI"))
               document.getElementById("X2NEXTPGTOPI").innerHTML = "<img src='images/shim.gif' width=25px height=25px border=0 >";
				}
		var		myCompare=mysplit[7].split(",");
			for (var i=1;i<ItemsOnPage+1;i++)	
			{
		mystroka=mysplit[i+sdvig];
		myarr=mystroka.split("~~");
				if (myarr[0]=="xxx" ) 
				{
			               document.getElementById("XAnchorIMG"+i).href ="";
			               document.getElementById("XIMG"+i).src ="clear.jpg";
document.getElementById("XIMG"+i).width ="0px";
document.getElementById("XIMG"+i).height ="0px";
document.getElementById("XIMG"+i).usmanimg ="";
			               document.getElementById("XITEM"+i).innerHTML =" ";
//			               document.getElementById("XDETA"+i).innerHTML =" ";
//			               document.getElementById("XCOMP"+i).innerHTML =" ";
//			               document.getElementById("XADVI"+i).innerHTML =" ";
//			               document.getElementById("XADCA"+i).innerHTML =" ";
			}
				else
				{
		 mystroka="";
// 0 -ID
// 1 - image_name
// 2 -width image
// 3 - height image
// 4 - myretail
// 5 - retail
// 6 - instock
// 7 -manufacturer_name
// 8 -widht of lamp
// 9 -height of lamp
//10 -extension 
//11 -bulb type
//12 -wattage1
//13 -wattage2
//14 -manufacturer finish
//15 -extradescription
//16 t24
//17 estar
//18 eeficiet
//19 collection
//20 convert(id)
//21 manufacturer number
//22 manufacturer name
//23 NE - site is not ecommerce,EC-site is e-commerce
//24 Y product is online,N-is not Online
//25 special item
//26 regular price for special item
//27 tag for regular price
var buf=[];
buf.push("<TABLE cellSpacing=0 cellPadding=0 width=105 border=0><TBODY>");
buf.push("<tr><td rowspan=12>&nbsp</td></tr>");
///		if (myarr[8] != "0")
///		{
///               mystroka=mystroka+"<tr><td class='reztext' nowrap >Width</td><td class='reztext'>:</td><td class='reztext' nowrap>"+myarr[8]+"</td></tr>";
///		}
///		if (myarr[9] != "0")
///		{
///               mystroka=mystroka+"<tr><td class='reztext' nowrap>Height</td><td class='reztext'>:</td><td class='reztext' nowrap>"+myarr[9]+"</td></tr>";
///		}
buf.push("<tr><td colspan=3 valign='top' align='left'  class='pricing'>");
		if (myarr[25] == "Y")
		{
	               buf.push("<table border='0' cellSpacing='0' cellPadding='0'>");
			if (myarr[28]!="")
			{
        	       buf.push("<tr><td nowrap align='left' class='rezTxtList'>List Price:&nbsp;</td>");
	               buf.push("<td nowrap align='right' class='rezPriceList'>"+myarr[28]+"</td></tr>");
			}
		       buf.push("<tr><td nowrap  align='left' class='rezTxtReg'>Regular Price</td><td class='rezPriceReg' align='right'>"+myarr[26]+"</td></tr>");
		       buf.push("<tr><td nowrap  align='left' class='rezTxtSale'>Sale Price</td><td class='rezPriceSale' align='right'>"+myarr[5]+"</td></tr>");
			if (myarr[27]!="0")
			{	
	               buf.push("<tr><td colspan=3 align='left' class='reztext'>");
				buf.push(taxSaleInfo(myarr[27]));
        		      buf.push("</td></tr>");
			}
			if (myarr[29]!="")
			{
	               buf.push("<tr><td nowrap class='rezTxtListSave' align='left'>You Save:&nbsp;</td>");
	               buf.push("<td nowrap  align='right' class='rezPriceListSave'>"+myarr[29]+"</td></tr>");
			}
	              buf.push("</table>");
		}
		else
		{
			if (myarr[28]=="")
			{
		               buf.push(myarr[5]);
			}
			else
			{
		               buf.push("<table border='0' cellspacing='0' cellpadding='0'>");
		               buf.push("<tr><td nowrap class='rezTxtList' align='left'>List Price:&nbsp;</td>");
		               buf.push("<td nowrap  align='right' class='rezPriceList'>"+myarr[28]+"</td></tr>");
		               buf.push("<tr><td nowrap class='rezTxtPrice' align='left'>Our Price:&nbsp;</td>");
		               buf.push("<td nowrap  align='right' class='rezPricePrice'>"+myarr[5]+"</td></tr>");
		               buf.push("<tr><td nowrap class='rezTxtListSave' align='left'>You Save:&nbsp;</td>");
		               buf.push("<td nowrap  align='right' class='rezPriceListSave'>"+myarr[29]+"</td></tr>");
		               buf.push("</table>");
			}
		}
buf.push("</td></tr>");
		if (myarr[6] == "Y")
		{
		 buf.push("<tr><td colspan=3 class='rezred'  >Usually In Stock </td></tr>");
		}
buf.push("<tr><td  class='reztext' nowrap>ID</td><td class='reztext'>:</td><td class='rezbold' nowrap>"+myarr[20]+"</td></tr>");
		if (myarr[21] != "")
		{
               buf.push("<tr><td colspan='3' class='rezbold'>"+myarr[21]+"</td></tr>");
		}
		if (myarr[22] != "")
		{
               buf.push("<tr><td nowrap colspan='3' class='rezbold'>"+myarr[22]+"</td></tr>");
		}
buf.push("<TR valign='center' ><TD valign='center' align='left' height='18px' width='18px'><a href='search_individual_result.asp?current="+myarr[0]+"&amp;page="+ mysplit[3]+"' ><IMG width=18 height=18 alt='View Product Details' src='images/standardicons/details_icon_sm.gif'  border=0 ></a></td><td valign='center' align='left' colspan='2'><a href='search_individual_result.asp?current="+myarr[0]+"&amp;page="+ mysplit[3]+"' class=resultslinks align='left'>");
if (GLang=="fra")
buf.push("D&eacute;tail&eacute;e");
else if (GLang=="spa")
buf.push("Detalles");
else
buf.push("Details");
buf.push("</a>");
buf.push("</TD></TR>");
var mycompstr="<input type='checkbox'";
for(var k=0;k<myCompare.length-1;k++)
{
	if (myCompare[k]==myarr[0])
	{
mycompstr=mycompstr+" checked ";
	}
}
mycompstr=mycompstr+" name='compare"+myarr[0]+"'  id='compare"+myarr[0]+"' onclick='javascript:AddCompare("+myarr[0]+")'  />";
buf.push("<TR ><TD align='left'>"+mycompstr);
buf.push("</td><td valign='center' align='left' class=resultslinks colspan='2'><label for='compare"+myarr[0]+"'>");
if (GLang=="fra")
buf.push("Comparer");
else if (GLang=="spa")
buf.push("Comparar");
else
buf.push("Compare");
buf.push("</label>");
buf.push("</TD></TR>");
if (RefTextOrImage==1)
{
buf.push("<TR valign='center' ><TD align='center' colspan='3'><a href=\"javascript:getAjaxAddItem("+myarr[0]+",'"+myarr[4]+"');\"  ><img src='images/btnWishList.png' alt='Add to wishlist'  border='0'></a>");
buf.push("</TD></TR>");
}
else
{
buf.push("<TR valign='center' ><TD align='center' width='18px' height='18px'><a href=\"javascript:getAjaxAddItem("+myarr[0]+",'"+myarr[4]+"');\"  ><img src='images/standardicons/add_to_wishlist_sm.gif' alt='Add to wishlist' width='18' height='18' border='0'></a>");
buf.push("</td><td valign='center' align='left' colspan='2' nowrap><a href=\"javascript:getAjaxAddItem("+myarr[0]+",'"+myarr[4]+"');\" class='resultslinks'   nowrap>");
if (GLang=="fra")
buf.push("Ajoutez &agrave; la liste");
else if (GLang=="spa")
buf.push("A&ntilde;ada a su Lista");
else 
buf.push("Add To Wish List");
buf.push("</a>");
buf.push("</TD></TR>");
}
	if (myarr[23]=="EC")
	{
		if (myarr[24]=="Y")
		{
			if (RefTextOrImage==1)
			{
			buf.push("<TR valign='center' ><TD align='center'  colspan='3'>");
			buf.push("<a href='#' onclick=getAjaxAddCard("+myarr[0]+",'"+myarr[4]+"')  ><img src='images/btnBuyNow.png' alt='Add to E-commerce Cart' border='0' ></a>");
			buf.push("</TD></TR>");
			}
			else
			{
			buf.push("           <TR valign='center' >  <TD align='center'  width='18px' height='18px'>");
			buf.push("<a href='#' onclick=getAjaxAddCard("+myarr[0]+",'"+myarr[4]+"')  ><img src='images/standardicons/add_cart_sm.gif' alt='Add to E-commerce Cart' width='18' height='18' border='0' ></a>");
			buf.push("          </td><td colspan='2' nowrap ><a href='#' onclick=getAjaxAddCard("+myarr[0]+",'"+myarr[4]+"') class='resultslinks' >");
			if (GLang=="fra")
				buf.push("Add To Cart");
			else if (GLang=="spa")
				buf.push("A&ntilde;ada sus Compras");
			else
				buf.push("Add To Cart");
			buf.push("</a>");
			buf.push("</TD></TR>");
			}
		}
		else
		{
		if (All3DshowMessage==1)
		{
			buf.push("<TR><TD align='center'  colspan='3' class='rezbold'>in-store purchase only</TD></TR>");
		}
///mystroka=mystroka+"<img src='images/standardicons/notavailable_icon.gif' height='18px' width='18px' border='0'></td><td colspan='2' class='resultslinks'>Not Available";
		}
	}


///		if (myarr[6] == "Y")
///		{
///		 mystroka=mystroka+"<tr><td colspan=3 class='rezred'>Usually In Stock</td></tr>"
///		}
///		if (myarr[16] == "1")
///		{
///		 mystroka=mystroka+"<tr><td colspan=3 class='rezbold'>Title 24</td></tr>"
///		}
///		if (myarr[17] == "1")
///		{
///		 mystroka=mystroka+"<tr><td colspan='3' class='rezbold'>Energy Star</td></tr>"
///		}
///		if (myarr[18] == "1")
///		{
///		 mystroka=mystroka+"<tr><td colspan='3' class='rezbold'>Energy Efficient</td></tr>"
///		}
///		if (myarr[21] != "")
///		{
//               mystroka=mystroka+"<tr><t class='reztext' nowrap>Manufacturer #</td><td class='reztext'>:</td><td></td></tr>";
/// 	      mystroka=mystroka+"<tr><td colspan='3' class='rezbold'>&nbsp</td></tr>";
///               mystroka=mystroka+"<tr><td colspan='3' class='rezbold'>"+myarr[21]+"</td></tr>";
///		}
///		if (myarr[22] != "")
///		{
//               mystroka=mystroka+"<tr><t class='reztext' nowrap>Manufacturer</td><td class='reztext'>:</td><td></td></tr>";
// 	      mystroka=mystroka+"<tr><td colspan='3' class='rezbold'>&nbsp</td></tr>";
///               mystroka=mystroka+"<tr><td colspan='3' class='rezbold'>"+myarr[22]+"</td></tr>";
///		}


//mystroka=mystroka+"<br><TABLE cellSpacing=0 cellPadding=0 width=105 border=0><TBODY>";
//mystroka=mystroka+"<TR><TD class='rezbold'>&nbsp</td><td class='rezbold'>&nbsp</td></tr>";
//mystroka=mystroka+"<TR><TD  colspan='2' align=left nowrap>";
//mystroka=mystroka+"<a href=javascript:getAjaxAddItem("+myarr[0]+",'"+myarr[4]+"'); class=buttonsnobold><IMG height=14  alt='Add To Wish List' src='images/wishlist_icon2.gif' width=20  border=0 >Add to Wish List</a></TD></TR>";
buf.push("</TBODY></TABLE>");
//////mystroka=mystroka+"<table height=10px width=85 border=0 ><tr><td height=10px   class='reztext'><a href='#'><img src='clear.gif' border=0 width=90px height=10px onclick='javascript:stm(Text["+i+"],Style[0]);'></a></td></tr></table>";
///onmouseover=document.style.cursor='hand'
		if (document.getElementById("XITEM"+i))
		{
               document.getElementById("XITEM"+i).innerHTML =buf.join("");
		}
				}
			}
		}
			for (var i=1;i<ItemsOnPage+1;i++)	
			{
		mystroka=mysplit[i+sdvig];
		myarr=mystroka.split("~~");
				if (myarr[0]!="xxx") 
				{
//document.getElementById("XIMG"+i).src = "usmanimage.aspx?img=" +escape(myarr[1])+"&w="+myarr[2]+"&h="+myarr[3];
document.getElementById("XIMG"+i).usmanimg =myarr[1];
if (CDNregim==0)
{
document.getElementById("XSHA"+i).title ="LA";
document.getElementById("XIMG"+i).src = "http://www.lightsamerica.com/images/images/SM1/" +escape(myarr[1]);
}
else
{
document.getElementById("XSHA"+i).title ="CDN";
document.getElementById("XIMG"+i).src = "http://cdn.lightsamerica.com/images/SM1/" +escape(myarr[1]);
document.getElementById("XIMG"+i).onerror = imgError;
}
document.getElementById("XIMG"+i).width =myarr[2];
document.getElementById("XIMG"+i).height =myarr[3];
buf=[];
buf.push("<table   cellpadding=0 cellspacing=0 align='center' border=0>");
	if ((myarr[8]!="0") ||(myarr[9]!="0")  )
	{
buf.push("<tr><td align=left class=maintextxx width=30% nowrap>");
buf.push("Size (WxH):");
buf.push("</td><td align=left class=maintextxx nowrap >");
buf.push("<b>"+myarr[8]+"&quot; x "+myarr[9]+"&quot;</b></td></tr>");
        }
	if (myarr[10]!="0")
	{
buf.push("<tr><td align=left class=maintextxx  width=30% nowrap>");
buf.push("Extension:");
buf.push("</td><td align=left class=maintextxx nowrap>");
buf.push("<b>"+myarr[10]+"</b>");
buf.push("</td></tr>");
	}
	if (myarr[11]!="")
	{
buf.push("<tr><td align=left class=maintextxx  width=30% nowrap>");
buf.push("Bulb type:");
buf.push("</td><td align=left class=maintextxx nowrap>");
buf.push("<b>"+myarr[11]+"</b>");
buf.push("</td></tr>");
	}
	if ((myarr[12]!="0") ||(myarr[13]!="0")  )
	{
buf.push("<tr><td align=left class=maintextxx  width=30% nowrap>");
buf.push("Bulb (qty x wattage):&nbsp");
buf.push("</td><td align=left class=maintextxx nowrap>");
buf.push("<b>"+myarr[12]+" x "+myarr[13]+"</b>");
buf.push("</td></tr>");
        }
	if (myarr[14]!="")
	{
buf.push("<tr><td align=left class=maintextxx width=30% nowrap>");
buf.push("Finish:");
buf.push("</td><td align=left class=maintextxx nowrap>");
buf.push("<b>"+myarr[14]+"</b>");
buf.push("</td></tr>");
	}
	if (myarr[15]!="")
	{
buf.push("<tr><td align=left class=maintextxx colspan=2 >Description:&nbsp;<b>");
var promstr=myarr[15];
if (promstr.length<40)
{
buf.push(promstr);
}
else
{
buf.push(promstr.substr(0,35)+"<br />");
promstr=promstr.substr(35,promstr.length-35);
	if (promstr.length<50)
	{
buf.push(promstr);
	}
	else
	{
	for (;promstr.length>50;)
	{
	buf.push(promstr.substr(0,50)+"<br/>");
	promstr=promstr.substr(50,promstr.length-50);
	}
	buf.push(promstr.substr(0,50));
	}
}
buf.push("</b></td></tr>");
	}
var dopOptions=""
	if (myarr[16]=="1")
	{
	dopOptions="Title24";
	}
	if (myarr[17]=="1")
	{
		if (dopOptions!="") dopOptions=dopOptions+" , ";
	dopOptions=dopOptions+" Energy Star";
	}
	if (myarr[18]=="1")
	{
		if (dopOptions!="") dopOptions=dopOptions+" , ";
	dopOptions=dopOptions+" Energy Efficient";
	}
	if (dopOptions!="")
	{
buf.push("<tr><td align=left class=maintextxx width=30% nowrap>");
buf.push("Options:");
buf.push("</td><td align=left class=maintextxx nowrap>");
buf.push("<b>"+dopOptions+"</b></td></tr>");
	}

buf.push("</table>");
document.getElementById("XIMG"+i).usmaninfo =buf.join("");
document.getElementById("XIMG"+i).onmouseover =test1;
document.getElementById("XSHA"+i).onmouseover =test1;
document.getElementById("XIMG"+i).dddonclick = "document.SearchForm.action='search_individual_result.asp?current="+myarr[0]+"&amp;page="+mysplit[0]+"';document.SearchForm.submit();";
//document.getElementById("XIMG"+i).dddonclick = "open('search_individual_result.asp?current="+myarr[0]+"&amp;page="+mysplit[0]+"')";
document.getElementById("XAnchorIMG"+i).href = "javascript:document.SearchForm.action='search_individual_result.asp?current="+myarr[0]+"&amp;page="+mysplit[0]+"';document.SearchForm.submit()";
				}
			}
}
function test1(){
var zamenai=this.id.substring(4);
var ximg=document.getElementById("XIMG"+zamenai)
var file=ximg.usmanimg;
var infofile=ximg.usmaninfo;
if (document.getElementById("enlargeImage"))
{
if (document.getElementById("enlargeImage").checked==1)
usmImgExpand('i'+zamenai,'d'+zamenai,3.3,0,'http://www.lightsamerica.com/images/images/'+file,infofile,zamenai);
}
}
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("%%");
  http.onreadystatechange =null;
  document.getElementById("showprogress").innerHTML="";
  document.getElementById("showprogress").visibility = "hidden";
		FlagAjax=0;
			 }
   } else {
//  document.getElementById('XTOTAL').innerHTML = '<img src="anim.gif">';
  }
}
function ViewCollection (item) {
	document.SearchForm.action = 'search_result.asp?params=Collection:' + item +';';
	document.SearchForm.submit();
}

function AddEnlarge()
{
var myurl = 'usmanajax_enlarge.asp?enlarge=';
if (document.getElementById("enlargeImage"))
{
	if (document.getElementById("enlargeImage").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 = useHttpResponseEnlarge;
		  http.send(null);
		}
}
}
function useHttpResponseEnlarge() {
   if (http.readyState == 4) {
   if(http.status == 200) {
	var myresponse=http.responseText;
FlagAjax=0;
CloseDivProg();
	http.onreadystatechange =null;
return false;
			 }
   }
}
function ShowCrtWL()
{
 showdeadcenterdiv(550,200,"ViknoCrtWL");
 document.getElementById('ChgCrtName').value="New Wish List";
 document.getElementById('ChgCrtText').value="";
 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 = useHttpResponseAddItem;
  http.send(null);
}
}
function imgError()
{
this.src="http://lightsamerica.com/images/images/SM1/" +escape(this.usmanimg);
document.getElementById("XSHA"+this.id.substring(4)).title="LAe";
this.onerror=null;
return true;
}

