// Ver: 1.7 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;
}
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;
}
var http = getXMLHTTPRequest();
var innerItemId =123123;
var innerREGIM =0;
var FlagAjax=0;
var ExpandFinish=false;
var ExpandStyle=false;
var ExpandBrand=false;
var ExpandOptions=false;
var ExpandFixType=false;
var ExpandWidth=false;
var ExpandHeight=false;
var ExpandLed=false;
var ExpandVoltage=false;
var ExpandColoredGlass=false;
var ExpandMount=false;
var ExpandPrice=false;
var MenuFirst=0;
var MenuKOL=0;
var RegimTailFinish=0;
var RegimTailStyle=0;
var RegimTailBrand=0;
var RegimTailOptions=0;
var RegimTailWidth=0;
var RegimTailHeight=0;
var RegimTailFixType=0;
var RegimTailLed=0;
var RegimTailVoltage=0;
var RegimTailColoredGlass=0;
var RegimTailMount=0;
var RegimTailPrice=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;'><img src='progress2.gif' border='0'>Analyzing databaseffff</td></tr></table>";
var MessWaitingAnilize="<table bgcolor=#FFFFFF style='BORDER:  #B4D8D4 3px solid;' ><tr><td><img src='progress2.gif' border='0'></td></tr></table>";

function myParamsSearch(strParams)
{
var form=window.document.forms[0];
  var myurl = 'usmanajax_search.asp?params='+strParams;
if (FlagAjax == 0 )
{
FlagAjax=1;
ExpandFinish=false;
ExpandStyle=false;
ExpandBrand=false;
ExpandOptions=false;
ExpandFixType=false;
ExpandWidth=false;
ExpandHeight=false;
ExpandLed=false;
ExpandVoltage=false;
ExpandColoredGlass=false;
ExpandMount=false;
ExpandPrice=false;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
//  var modurl = myurl;
//document.write(modurl);
  http.open("GET", modurl, true);
  // set up the callback function
  http.onreadystatechange = useHttpResponseSearch;
  http.send(null);
}
}
function myCollectionSearch(id)
{
var form=window.document.forms[0];
  var myurl = 'usmanajax_search.asp?params=Collection:'+id;
if (FlagAjax == 0 )
{
FlagAjax=1;
ExpandFinish=false;
ExpandStyle=false;
ExpandBrand=false;
ExpandOptions=false;
ExpandFixType=false;
ExpandWidth=false;
ExpandHeight=false;
ExpandLed=false;
ExpandVoltage=false;
ExpandColoredGlass=false;
ExpandMount=false;
ExpandPrice=false;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
//  var modurl = myurl;
//document.write(modurl);
  http.open("GET", modurl, true);
  // set up the callback function
  http.onreadystatechange = useHttpResponseSearch;
  http.send(null);
}
}
function myPreviousSearch(id)
{
var form=window.document.forms[0];
  var myurl = 'usmanajax_search.asp?previous=Y';
if (FlagAjax == 0 )
{
FlagAjax=1;
ExpandFinish=false;
ExpandStyle=false;
ExpandBrand=false;
ExpandOptions=false;
ExpandFixType=false;
ExpandWidth=false;
ExpandHeight=false;
ExpandLed=false;
ExpandVoltage=false;
ExpandColoredGlass=false;
ExpandMount=false;
ExpandPrice=false;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
//  var modurl = myurl;
//document.write(modurl);
  http.open("GET", modurl, true);
  // set up the callback function
  http.onreadystatechange = useHttpResponseSearch;
  http.send(null);
}
}
function mySimilarSearch(id)
{
var form=window.document.forms[0];
  var myurl = 'usmanajax_search.asp?SI='+id;
if (FlagAjax == 0 )
{
FlagAjax=1;
ExpandFinish=false;
ExpandStyle=false;
ExpandBrand=false;
ExpandOptions=false;
ExpandFixType=false;
ExpandWidth=false;
ExpandHeight=false;
ExpandLed=false;
ExpandVoltage=false;
ExpandColoredGlass=false;
ExpandMount=false;
ExpandPrice=false;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
//  var modurl = myurl;
//document.write(modurl);
  http.open("GET", modurl, true);
  // set up the callback function
  http.onreadystatechange = useHttpResponseSearch;
  http.send(null);
}
}

function myChangeInstallation(InstallationArea,Description)
{
var form=window.document.forms[0];
ZAMENA="Installation:"+InstallationArea+";Description:"+Description+";";
myZamena2("Installation:",ZAMENA);
  var myurl = 'usmanajax_search.asp?params='+ZAMENA;
if (FlagAjax == 0 )
{
FlagAjax=1;
ExpandFinish=false;
ExpandStyle=false;
ExpandBrand=false;
ExpandOptions=false;
ExpandFixType=false;
ExpandWidth=false;
ExpandHeight=false;
ExpandWidth=false;
ExpandLed=false;
ExpandVoltage=false;
ExpandColoredGlass=false;
ExpandMount=false;
ExpandPrice=false;

//  myRand = parseInt(Math.random()*999999999999999);
//  var modurl = myurl+"&rand="+myRand+" ";
  var modurl = myurl;
//document.write(modurl);
  http.open("GET", modurl, true);
  // set up the callback function
  http.onreadystatechange = useHttpResponseSearch;
  http.send(null);
}
}
///
function mySearchBegin()
{
var form=window.document.forms[0];
  var myurl = 'usmanajax_result.asp';
if (FlagAjax == 0 )
{
FlagAjax=1;
//  myRand = parseInt(Math.random()*999999999999999);
//  var modurl = myurl+"&rand="+myRand+" ";
  var modurl = myurl;
//document.write(modurl);
  http.open("GET", modurl, true);
  // set up the callback function
  http.onreadystatechange = useHttpResponseSearch3;
  http.send(null);
}
}
///
function myChangeFixType(FixType)
{
var form=window.document.forms[0];
if (FixType==0) 
{
RegimTailFixType=1;
ExpandFixType=false;
}
else
{
ExpandFixType=true;
	if (FixType<0) 
	{
RegimTailFixType=1;
FixType=0;	
	}
}
ZAMENA="Description:"+FixType+";";
myZamena2("Description:",ZAMENA);
	var myurl = 'usmanajax_search2.asp?params='+ZAMENA;
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
function myChangeONLINE()
{
var FixOnline="0";
if (document.getElementById("ECitems").checked)
{
FixOnline="1";
}
ZAMENA="ONLINE:"+FixOnline+";";
myZamena2("ONLINE:",ZAMENA);
  var myurl = 'usmanajax_search2.asp?params='+ZAMENA;
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
function myChangeGroup()
{
var form=window.document.forms[0];
ZAMENA="GROUP:"+document.getElementById("ManGroup").value+";";
myZamena2("GROUP:",ZAMENA);
  var myurl = 'usmanajax_search2.asp?params='+ZAMENA;
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
function myChangeStock()
{
var form=window.document.forms[0];
if (document.getElementById("stock").checked)
{
ZAMENA="STOCK:1;";
}
else
{
ZAMENA="STOCK:0;";
}

  var myurl = 'usmanajax_search2.asp?params='+ZAMENA;
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}

///
function myChangeWidth(Width)
{
var form=window.document.forms[0];
if (Width==0) 
{
RegimTailWidth=1;
ExpandWidth=false;
}
else
{
ExpandWidth=true;
	if (Width<0) 
	{
RegimTailWidth=1;
Width=0;	
	}
}
ZAMENA="Width:"+Width+";";
myZamena2("Width:",ZAMENA);
  var myurl = 'usmanajax_search2.asp?params='+ZAMENA;
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
function myChangeHeight(Height)
{
if (Height==0) 
{
RegimTailHeight=1;
ExpandHeight=false;
}
else
{
ExpandHeight=true;
	if (Height<0) 
	{
RegimTailHeight=1;
Height=0;	
	}
}
ZAMENA="Height:"+Height+";";
myZamena2("Height:",ZAMENA);
  var myurl = 'usmanajax_search2.asp?params='+ZAMENA;
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
////
function myChangeFinish(Finish)
{
if (Finish==0) 
{
RegimTailFinish=1;
ExpandFinish=false;
}
else
{
ExpandFinish=true;
	if (Finish<0) 
	{
RegimTailFinish=1;
Finish=0;	
	}
}
ZAMENA="Finish:"+Finish+";";
myZamena2("Finish:",ZAMENA);
  var myurl = 'usmanajax_search2.asp?params='+ZAMENA;
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
function myChangePrice(Price)
{
if (Price==0) 
{
RegimTailPrice=1;
ExpandPrice=false;
}
else
{
ExpandPrice=true;
	if (Price<0) 
	{
RegimTailPrice=1;
Price=0;	
	}
}
 var myurl = 'usmanajax_search2.asp?params=Price:'+Price+";";
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
function myChangeLed(Led)
{
if (Led=="0") 
{
RegimTailLed=1;
ExpandLed=false;
}
else
{
ExpandLed=true;
	if (Led<0) 
	{
RegimTailLed=1;
Led=0;	
	}
}
 var myurl = 'usmanajax_search2.asp?params=Led:'+Led+";";
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
///
function myChangeVoltage(Voltage)
{
if (Voltage=="0") 
{
RegimTailVoltage=1;
ExpandVoltage=false;
}
else
{
ExpandVoltage=true;
	if (Voltage<0) 
	{
RegimTailVoltage=1;
Voltage=0;	
	}
}
 var myurl = 'usmanajax_search2.asp?params=Voltage:'+Voltage+";";
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
///
function myChangeColoredGlass(ColoredGlass)
{
if (ColoredGlass==0) 
{
RegimTailColoredGlass=1;
ExpandColoredGlass=false;
}
else
{
ExpandColoredGlass=true;
	if (ColoredGlass<0) 
	{
RegimTailColoredGlass=1;
ColoredGlass=0;	
	}
}
 var myurl = 'usmanajax_search2.asp?params=CGlass:'+ColoredGlass+";";
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
///
function myChangeMount(Mount)
{
if (Mount==0) 
{
RegimTailMount=1;
ExpandMount=false;
}
else
{
ExpandMount=true;
	if (Mount<0) 
	{
RegimTailMount=1;
Mount=0;	
	}
}
 var myurl = 'usmanajax_search2.asp?params=Mount:'+Mount+";";
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
//
function myChangeStyle(Style)
{
if (Style==0) 
{
RegimTailStyle=1;
ExpandStyle=false;
}
else
{
ExpandStyle=true;
	if (Style<0) 
	{
RegimTailStyle=1;
Style=0;	
	}
}
var ZAMENA="Style:"+Style+";";
myZamena2("Style:",ZAMENA);
  var myurl = 'usmanajax_search2.asp?params='+ZAMENA;
	if (FlagAjax == 0 )
	{
	FlagAjax=1
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";

	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
///
function myChangeBrand(Brand)
{
var form=window.document.forms[0];
if (Brand==0) 
{
RegimTailBrand=1;
ExpandBrand=false;
}
else
{
		ExpandBrand=true;
	if (Brand<0) 
	{
RegimTailBrand=1;
Brand=0;	
	}

}
ZAMENA="Brand:"+Brand+";";
myZamena2("Brand:",ZAMENA);
  var myurl = 'usmanajax_search2.asp?params='+ZAMENA;
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
///
function myChangeOptions(Options)
{
if (Options=="0") 
{
RegimTailOptions=1;
ExpandOptions=false;
}
else
{
ExpandOptions=true;
	if (Options<0) 
	{
RegimTailOptions=1;
Options=0;	
	}
}
var form=window.document.forms[0];
ZAMENA="Options:"+Options+";";
myZamena2("Options:",ZAMENA);
  var myurl = 'usmanajax_search2.asp?params='+ZAMENA;
	if (FlagAjax == 0 )
	{
	FlagAjax=1;
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand+" ";
	  http.open("GET", modurl, true);
	  http.onreadystatechange = useHttpResponseSearch2;
	  http.send(null);
	}
}
///


/////////////////////////////////////////////////////////////////

function useHttpResponseSearch() {
  document.getElementById("showprogress").style.top  = parseInt(screen.availHeight/2-100)+"px";
  document.getElementById("showprogress").style.left = parseInt(screen.availWidth/2-100)+"px";

   if (http.readyState == 4) {
    if(http.status == 200) {
	var myresponse=http.responseText;
	var mysplit=myresponse.split("%%");
        var PromCategory=mysplit[0];
if (document.getElementById("narrowresult"))
document.getElementById("narrowresult").innerHTML="Narrow Results";
//{document.getElementById("ECbox").innerHTML="<input type='checkbox' name='ECitems' id='ECitems' onclick='javascript:myChangeONLINE();' ><label for='ECItems' class='dstext'>Only On-line items</label>";}
		var mysplit2=PromCategory.split("~~");
if (document.getElementById("countajax"))
{document.getElementById("countajax").innerHTML=" <SPAN class=infotext>We found</SPAN><span class=infotextbold id='ItogoItems' name='ItogoItems'> "+formatNumber0(mysplit2[0])+" </span><SPAN class=infotext>products that match </span>";}
if ((0+mysplit2[0])==0)
{
if (document.getElementById("stock"))
{
document.getElementById("stock").checked=false;
}
 	        var nothCategory=mysplit[1];
		var nothsplit=nothCategory.split("~~");
if (nothsplit[14]=="1")
{
alert('Currently there are no Sale items .');
window.location='landing.asp';
window.location.href='landing.asp';
http.onreadystatechange="";
return false;
}
else
alert('       Item not found.\nPlease expand your Search.');
//myPreviousSearch();
window.location='search.asp';
//window.location='search_result.asp?previous=Y';
}
var mprev=mysplit2[1];
if (mprev.length>0)
{
 if (mprev.charAt(0)=="t") ExpandFixType=true
 else  ExpandFixType=false;
 if (mprev.charAt(1)=="t") ExpandFinish=true
 else  ExpandFinish=false;
 if (mprev.charAt(2)=="t") ExpandStyle=true
 else  ExpandStyle=false;
 if (mprev.charAt(3)=="t") ExpandBrand=true
 else  ExpandBrand=false;
 if (mprev.charAt(4)=="t") ExpandWidth=true
 else  ExpandWidth=false;
 if (mprev.charAt(5)=="t") ExpandHeight=true
 else  ExpandHeight=false;
 if (mprev.charAt(6)=="t") ExpandLed=true
 else  ExpandLed=false;
 if (mprev.charAt(7)=="t") ExpandVoltage=true
 else  ExpandVoltage=false;
 if (mprev.charAt(8)=="t") ExpandColoredGlass=true
 else  ExpandColoredGlass=false;
 if (mprev.charAt(9)=="t") ExpandMount=true
 else  ExpandMount=false;
 if (mprev.charAt(10)=="t") ExpandPrice=true
 else  ExpandPrice=false;
 if (mprev.charAt(11)=="t") ExpandOptions=true
 else  ExpandOptions=false;
}
var MyCRef="";
var ClRef="";
	for(var i=2;i<mysplit2.length;i++)
	{
 if (mysplit2[i]!="") 
 {
	mysplit4=mysplit2[i].split("!!");
MyCRef=MyCRef+mysplit4[0];
if (i<mysplit2.length-3) {ClRef="infoCommon"}
else {ClRef="infoLast"};
if (document.getElementById("countajax"))
{document.getElementById("countajax").innerHTML=document.getElementById("countajax").innerHTML+"<a href='search_result.asp?params="+MyCRef+"' class='"+ClRef+"'>"+mysplit4[1]+"</a>";}
//document.getElementById("countajax").innerHTML=ClRef;
 }
if (i<mysplit2.length-1)
{
  if (mysplit2[i+1]!="") 
  {
      if (document.getElementById("countajax"))
{ document.getElementById("countajax").innerHTML=document.getElementById("countajax").innerHTML+"<SPAN class=maintext> - </span>";}
  }
}
	}
 	        var PromCategory=mysplit[1];
		var mysplit3=PromCategory.split("~~");
		var SelFixType=mysplit3[0].split(",");
		var SelFinish=mysplit3[1].split(",");
		var SelStyle=mysplit3[2].split(",");
		var SelBrand=mysplit3[3].split(",");
		var SelOptions=mysplit3[4].split(",");
		var SelWidth=mysplit3[5].split(",");
		var SelHeight=mysplit3[6].split(",");
		var SelLed=mysplit3[7].split(",");
		var SelVoltage=mysplit3[8].split(",");
		var SelColoredGlass=mysplit3[9].split(",");
		var SelMount=mysplit3[10].split(",");
		var SelPrice=mysplit3[11].split(",");
		var SelStock=mysplit3[12];
		var SelGroup=mysplit3[12];
if (SelStock=="0") 
{
if (document.getElementById("stock"))
{
document.getElementById("stock").checked=false;
}
}
if (SelGroup=="0") 
{
 if (document.getElementById("ManGroup")) 
	{
document.getElementById("ManGroup").value="0";
	}
}
if (SelBrand=="0") 
{
 if (document.getElementById("ManufacturerName")) 
	{
document.getElementById("ManufacturerName").value="0";
	}
}
//document.getElementById("countajax").innerHTML=SelFixType;
objTreeMenu_3 = new TreeMenu("images", "objTreeMenu_3", "_self", "", true);
	var RegimTailFixType=0;
	var RegimTailFinish=0;
	var RegimTailStyle=0;
	var RegimTailBrand=0;
	var RegimTailWidth=0;
	var RegimTailHeight=0;
	var RegimTailPrice=0;
	var RegimTailLed=0;
	var RegimTailColoredGlass=0;
	var RegimTailVoltage=0;
	var RegimTailMount=0;
/// Fixture Type
usmMenu1(5,mysplit[6],arrFixType,SelFixType,"Type","Fixture Types",ExpandFixType,'myChangeFixType',RegimTailFixType,5);
/// Finishes
usmMenu1(1,mysplit[3],arrFinish,SelFinish,"Finish","Finishes",ExpandFinish,'myChangeFinish',RegimTailFinish,5);
/// Style
usmMenu1(2,mysplit[2],arrStyle,SelStyle,"Style","Styles",ExpandStyle,'myChangeStyle',RegimTailStyle,5);
/// Brand
usmMenu1(3,mysplit[4],arrBrand,SelBrand,"Brand","Brands",ExpandBrand,'myChangeBrand',RegimTailBrand,5);
/// Width
usmMenu1(6,mysplit[7],arrWidth,SelWidth,"Width","Widthes",ExpandWidth,'myChangeWidth',RegimTailWidth,5);
usmMenu1(7,mysplit[8],arrHeight,SelHeight,"Height","Heights",ExpandHeight,'myChangeHeight',RegimTailHeight,5);
usmMenu1(8,mysplit[9],arrLed,SelLed,"Led","Leds",ExpandLed,'myChangeLed',RegimTailLed,5)
usmMenu1(9,mysplit[10],arrVoltage,SelVoltage,"Voltage","Voltages",ExpandVoltage,'myChangeVoltage',RegimTailVoltage,5)
usmMenu1(10,mysplit[11],arrColoredGlass,SelColoredGlass,"Colored Glass","Colored Glasses",ExpandColoredGlass,'myChangeColoredGlass',RegimTailColoredGlass,5)
usmMenu1(11,mysplit[12],arrMount,SelMount,"Mount","Mounts",ExpandMount,'myChangeMount',RegimTailMount,5)
usmMenu1(12,mysplit[13],arrPrice,SelPrice,"Price","Prices",ExpandPrice,'myChangePrice',RegimTailPrice,6)
usmMenu1(4,mysplit[5],arrOptions,SelOptions,"Options","Options",ExpandOptions,'myChangeOptions',RegimTailOptions,6)
	if (document.getElementById("newNode"))
	{
	newNode.iconImageWidth=20;
	newNode.iconImageHeight=20;
	newNode.lineImageWidth=20;
	newNode.lineImageHeight=20;
	}
if (document.getElementById("myTreeMenu"))
document.getElementById("myTreeMenu").innerHTML="";
	objTreeMenu_3.drawMenu();
	objTreeMenu_3.resetBranches();
FlagAjax=0;
//  document.getElementById("showprogress").innerHTML="";
//  document.getElementById("showprogress").visibility = "hidden";
getAjaxPageNumber('1');
	}
  } else {
  document.getElementById("showprogress").innerHTML=MessWaitingAnilize;
  document.getElementById("showprogress").visibility = "visible";
  }
}
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
function useHttpResponseSearch2() {
///  document.getElementById("RisCurrentPage").innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//      document.getElementById("XNEXTPGTOP").innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//      document.getElementById("XPREVPGTOP").innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";

  document.getElementById("showprogress").style.top  = parseInt(screen.availHeight/2-100)+"px";
  document.getElementById("showprogress").style.left = parseInt(screen.availWidth/2-100)+"px";
   if (http.readyState == 4) {
    if(http.status == 200) {
	var myresponse=http.responseText;
//   document.getElementById("test1").innerHTML = myresponse;
	var mysplit=myresponse.split("%%");
var arrPromName=new Array();
var arrPromKol=new Array();
var KOL;
  var PromCategory=mysplit[0];
var nadpisCount=""
//document.getElementById("countajax").innerHTML=myresponse;
//document.getElementById("countajax").innerHTML=RegimTailFinish;
//document.getElementById("countajax").innerHTML=MenuKOL+" items";
		var mysplit2=PromCategory.split("~~");
if (document.getElementById("countajax"))
{document.getElementById("countajax").innerHTML=" <SPAN class=infotext>We found</SPAN><SPAN class=infotextbold id='ItogoItems' name='ItogoItems'> "+formatNumber0(mysplit2[0])+" </span><SPAN class=infotext>products that match </span>";}
var MyCRef="";
var ClRef="";
	for(var i=1;i<mysplit2.length;i++)
	{
 if (mysplit2[i]!="") 
 {
	mysplit4=mysplit2[i].split("!!");
MyCRef=MyCRef+mysplit4[0];
if (i<mysplit2.length-3) {ClRef="infoCommon"}
else {ClRef="infoLast"};
if  (document.getElementById("countajax"))
{document.getElementById("countajax").innerHTML=document.getElementById("countajax").innerHTML+"<a href='search_result.asp?params="+MyCRef+"' class='"+ClRef+"'>"+mysplit4[1]+"</a>";}
//document.getElementById("countajax").innerHTML=ClRef;
 }
if (i<mysplit2.length-1)
{
  if (mysplit2[i+1]!="") 
  {
    if (document.getElementById("countajax"))
{  document.getElementById("countajax").innerHTML=document.getElementById("countajax").innerHTML+"<SPAN class=maintext> - </span>";}
  }
}
	}
 	        var PromCategory=mysplit[1];
		var mysplit3=PromCategory.split("~~");
		var SelFixType=mysplit3[0].split(",");
		var SelFinish=mysplit3[1].split(",");
		var SelStyle=mysplit3[2].split(",");
		var SelBrand=mysplit3[3].split(",");
		var SelOptions=mysplit3[4].split(",");
		var SelWidth=mysplit3[5].split(",");
		var SelHeight=mysplit3[6].split(",");
		var SelLed=mysplit3[7].split(",");
		var SelVoltage=mysplit3[8].split(",");
		var SelColoredGlass=mysplit3[9].split(",");
		var SelMount=mysplit3[10].split(",");
		var SelPrice=mysplit3[11].split(",");
//document.getElementById("countajax").innerHTML=mysplit3[8]+"  Xx ";
objTreeMenu_3 = new TreeMenu("images", "objTreeMenu_3", "_self", "", true);
usmMenu2(5,mysplit[6],arrFixType,SelFixType,"Type","Fixture Types",ExpandFixType,'myChangeFixType',RegimTailFixType,5)
//document.getElementById("countajax").innerHTML=ExpandFinish;
usmMenu2(1,mysplit[3],arrFinish,SelFinish,"Finish","Finishes",ExpandFinish,'myChangeFinish',RegimTailFinish,5)
usmMenu2(2,mysplit[2],arrStyle,SelStyle,"Style","Styles",ExpandStyle,'myChangeStyle',RegimTailStyle,5)
usmMenu2(3,mysplit[4],arrBrand,SelBrand,"Brand","Brands",ExpandBrand,'myChangeBrand',RegimTailBrand,5)
usmMenu2(6,mysplit[7],arrWidth,SelWidth,"Width","Widthes",ExpandWidth,'myChangeWidth',RegimTailWidth,5)
usmMenu2(7,mysplit[8],arrHeight,SelHeight,"Height","Heightes",ExpandHeight,'myChangeHeight',RegimTailHeight,5)
usmMenu2(8,mysplit[9],arrLed,SelLed,"Led","Leds",ExpandLed,'myChangeLed',RegimTailLed,5)
usmMenu2(9,mysplit[10],arrVoltage,SelVoltage,"Voltage","Voltages",ExpandVoltage,'myChangeVoltage',RegimTailVoltage,5)
usmMenu2(10,mysplit[11],arrColoredGlass,SelColoredGlass,"Colored Glass","Colored Glasses",ExpandColoredGlass,'myChangeColoredGlass',RegimTailColoredGlass,5)
usmMenu2(11,mysplit[12],arrMount,SelMount,"Mount","Mounts",ExpandMount,'myChangeMount',RegimTailMount,5)
usmMenu2(12,mysplit[13],arrPrice,SelPrice,"Price","Prices",ExpandPrice,'myChangePrice',RegimTailPrice,6)
usmMenu2(4,mysplit[5],arrOptions,SelOptions,"Energy Efficient","Options",ExpandOptions,'myChangeOptions',RegimTailOptions,5)
	document.getElementById("myTreeMenu").innerHTML="";
	objTreeMenu_3.drawMenu();
	objTreeMenu_3.resetBranches();
FlagAjax=0;
getAjaxPageNumber('1');
//  document.getElementById("showprogress").innerHTML="";
//  document.getElementById("showprogress").visibility = "hidden";
	}
  } else {
  document.getElementById("showprogress").innerHTML=MessWaitingAnilize;
  document.getElementById("showprogress").visibility = "visible";
  }
}
//////////////////////
function usmMenu2(mesto,mestomenu,arrSearch,SelectSearch,namemenu,allname,RegExpand,nameFunc,RegimTailZam,KolStringMenu)
{
 	        var PromCategory=mestomenu;
		var mysplit2=PromCategory.split("++");
 	        var LocalFound=0;
//Control on emtpy menu
		mykont=0;
            for (var i=0; i<mysplit2.length-1 ; i=i+1 )
	   {
		var mysplit3=mysplit2[i].split("~~");
		if (mysplit3[0]>0&&mysplit3[1]>0) mykont=1;
	   }
if (mykont>0)
{
var arrPromName=new Array();
var arrPromKol=new Array();
var nodespec="newNode_"+mesto;
newNode = objTreeMenu_3.addItem(new TreeNode("By <strong>"+namemenu+"</strong>", null, '#', RegExpand, true, 'tmenu0text'));
		var RegimTailLocal=0;
            for (var i=0; i<mysplit2.length-1 ; i=i+1 )
		{
		var mysplit3=mysplit2[i].split("~~");
	if (mysplit3[0]>0)
	{
	arrPromName[arrPromName.length]=mysplit3[0];
	arrPromKol[arrPromKol.length]=mysplit3[1];
	}
		}
promkolmenu=0;
            for (var i=0; i<mysplit2.length ; i=i+1 )
		{
var mysplit3=mysplit2[i].split("~~");
	if (mysplit3[0]>0) ////
	{                  ////

// Draw just first 5 finishes 
	if (promkolmenu<KolStringMenu||RegimTailZam==1)
	{
		KOL="0";
			for (var j=0;j<arrPromName.length;j=j+1)
			{
				if  (arrPromName[j]==mysplit3[0])
				{
					KOL=arrPromKol[j];
				}
			}
		var  itemMenu="noname";
			for(var jn=0;jn<arrSearch.length;jn++)
			{if (arrSearch[jn][0]==mysplit3[0]){itemMenu=arrSearch[jn][1];}}
		if (KOL!="0")
		{
promkolmenu++;
var mynumlen=formatNumber0(KOL).length;
var lenMenu=21;
if (itemMenu.indexOf("&")>0)
{
lenMenu=lenMenu+7;
	if (itemMenu.indexOf("&",itemMenu.indexOf("&")+1)>0)
	{
		lenMenu=lenMenu+7;

	}
}
if ((itemMenu.length+mynumlen)>lenMenu)
{
itemMenu=itemMenu.substring(0,lenMenu-mynumlen);
}
			if (SelectSearch==mysplit3[0]) 
			{
//document.getElementById("countajax").innerHTML=document.getElementById("countajax").innerHTML+" <SPAN class=maintext>-</SPAN><SPAN class=pricing> "+itemMenu+" </span>";
	nodespec= newNode.addItem(new TreeNode(itemMenu+" ["+formatNumber0(KOL)+"]", null, 'javascript:'+nameFunc+'('+mysplit3[0]+');', RegExpand, true, 'tmenu1sele'));
				RegimTailLocal=1;
				LocalFound=1;
			}
			else
			{
				nodespec= newNode.addItem(new TreeNode(itemMenu+" ["+formatNumber0(KOL)+"]", null, 'javascript:'+nameFunc+'('+mysplit3[0]+');', RegExpand, true, 'tmenu1text'));
			}
		nodespec.iconImageWidth=20;
		nodespec.iconImageHeight=20;
		nodespec.lineImageWidth=20;
		nodespec.lineImageHeight=20;
		}
	}
	} ////
		};
			if (mysplit2.length-1>KolStringMenu&&RegimTailZam==0)
			{
			RegimTailLocal=1;
			};
	if (RegimTailLocal==1)
	{
		if (LocalFound==0) 
		{
	nodespec= newNode.addItem(new TreeNode("See more ", null, 'javascript:'+nameFunc+'(-1);', RegExpand, true, 'tmenu1sele'));
		}
		else
		{
	nodespec= newNode.addItem(new TreeNode("View All ", null, 'javascript:'+nameFunc+'(0);', RegExpand, true, 'tmenu1text'));
		}
	}
	nodespec.iconImageWidth=20;
	nodespec.iconImageHeight=20;
	nodespec.lineImageWidth=20;
	nodespec.lineImageHeight=20;
	newNode.iconImageWidth=20;
	newNode.iconImageHeight=20;
	newNode.lineImageWidth=20;
	newNode.lineImageHeight=20;
}
}
function usmMenu1(mesto,mestomenu,arrSearch,SelectSearch,namemenu,allname,RegExpand,nameFunc,RegimTailZam,KolStringMenu)
{
 	        var PromCategory=mestomenu;
		var mysplit2=PromCategory.split("++");
 	        var LocalFound=0;
//Control on emtpy menu
		mykont=0;
            for (var i=0; i<mysplit2.length-1 ; i=i+1 )
	   {
		var mysplit3=mysplit2[i].split("~~");
		if (mysplit3[1]>0) mykont=1;
	   }
if (mykont>0)
{
newNode = objTreeMenu_3.addItem(new TreeNode("By <strong>"+namemenu+"</strong>", null, '#', RegExpand, true, 'tmenu0text'));
var nodespec="newNode_"+mesto;
	var RegimTailLocal=0;
        var PictureMenu=0;
            for (var i=0; i<mysplit2.length-1 ; i=i+1 )
		{
		var mysplit3=mysplit2[i].split("~~");

	if (mysplit3[0]>0&&mysplit3[1]>0) 
	{
	if (PictureMenu<KolStringMenu||RegimTailZam==1)
	{
	PictureMenu++;
		var  itemMenu="noname";
			for(var jn=0;jn<arrSearch.length;jn++)
			{
				if (arrSearch[jn][0]==mysplit3[0])
				{
					itemMenu=arrSearch[jn][1];
				}
			}

		var myfound=0;
			for(var jj=0;jj<SelectSearch.length;jj=jj+1)
			{
				if (SelectSearch[jj]==mysplit3[0]) {myfound=1;LocalFound=1;}
			}
var mynumlen=formatNumber0(mysplit3[1]).length;
var lenMenu=21;
if (itemMenu.indexOf("&")>0)
{
lenMenu=lenMenu+7;
	if (itemMenu.indexOf("&",itemMenu.indexOf("&")+1)>0)
	{
		lenMenu=lenMenu+7;

	}
}
if ((itemMenu.length+mynumlen)>lenMenu)
{                              
itemMenu=itemMenu.substring(0,lenMenu-mynumlen);
}

		if (myfound==1) 
		{
	nodespec= newNode.addItem(new TreeNode(itemMenu+" ["+formatNumber0(mysplit3[1])+"]", null, 'javascript:'+nameFunc+'('+mysplit3[0]+');', RegExpand, true, 'tmenu1sele'));
	RegimTailLocal=1;
		}
		else
		{
	nodespec= newNode.addItem(new TreeNode(itemMenu+" ["+formatNumber0(mysplit3[1])+"]", null, 'javascript:'+nameFunc+'('+mysplit3[0]+');', RegExpand, true, 'tmenu1text'));
		}
	nodespec.iconImageWidth=20;
	nodespec.iconImageHeight=20;
	nodespec.lineImageWidth=20;
	nodespec.lineImageHeight=20;
	}
	}
		};
			if (mysplit2.length-1>KolStringMenu&&RegimTailZam==0)
			{
			RegimTailLocal=1;
			};
	if (RegimTailLocal==1)
	{
		if (LocalFound==0) 
		{
	nodespec= newNode.addItem(new TreeNode("See more ", null, 'javascript:'+nameFunc+'(-1);', RegExpand, true, 'tmenu1sele'));
		}
		else
		{
	nodespec= newNode.addItem(new TreeNode("View All ", null, 'javascript:'+nameFunc+'(0);', RegExpand, true, 'tmenu1text'));
		}
	nodespec.iconImageWidth=20;
	nodespec.iconImageHeight=20;
	nodespec.lineImageWidth=20;
	nodespec.lineImageHeight=20;
	}
	newNode.iconImageWidth=20;
	newNode.iconImageHeight=20;
	newNode.lineImageWidth=20;
	newNode.lineImageHeight=20;
}
}
function myZamena2(Gde,Zamena)
{
var mesto1=GlobPar.indexOf(Gde);
 if (mesto1>-1)
 {
 var prom0=GlobPar.substring(0,mesto1);
 var prom1=GlobPar.substring(mesto1);
 var mesto2=prom1.indexOf(";")
	var prom2="";
	if (mesto2>-1)
	{
	 prom2=prom1.substring(mesto2+1);
	}
	GlobPar=prom0+prom2;
 }
GlobPar=GlobPar+Zamena;
}