﻿var ComplicationSpecFieldList="";
var StrapSpecFieldList="";
var CaseMaterialSpecFieldList="";
var BrandsSpecFieldList="";
var CaseShapeSpecFieldList="";
var PriceSpecFieldList="";
var StoneSpecFieldList="";
var MetalSpecFieldList=""
var MetalSpecFieldList=""
var NewCheckBkoxList=""
var NewCheckBkoxListLong=""
var BrandListShowFromChild=true
var divMoreShow=false
var BrandCheckClick=false
var BrandCheckBackClick=false
function CheckboxChecked(id)
{

if(document.getElementById(id).type=='checkbox')
{
if(document.getElementById(id).checked==true)
{
document.getElementById(id).checked=false;
}
else
{
document.getElementById(id).checked=true;
}

}
}

function ax_close_display(id,Name)
{
var ppName =  document.getElementsByName(Name);
//UnCheckByGroup(ppName);
var pp = document.getElementById(id);
pp.style.visibility = "hidden";
if(id=='idBrands')
document.getElementById('IFrame1').contentWindow.DropDownShow();

}

function ax_Check_Expan_Off(List)
{
var chunks=List.split(".")
if(chunks.length>5)
{
document.getElementById("divMore").style.display = "inline"; 
}
}


function GetSpecFieldList(pp,NewchkID,Cookie)
{
var SpecFieldList="";
var SpecFieldList2="";
var SpecFieldList3="";
var num=1
//alert(window.location);
for (counter = 0; counter < pp.length; counter++)
{ 
var cookieskist=checkCookie("SpecFieldList"+NewchkID);
var cookieskist1=Cookie;
if (pp[counter].checked)
{

if(num<=4)
{
NewCheckBkoxList+="&bull; "+ pp[counter].value + "<br />"; 
num++;

}    
if(NewchkID=="chkBrands")
BrandCheckClick=true
// else
//   BrandCheckClick=false  
NewCheckBkoxListLong+="&bull; "+ pp[counter].value + "<br />";  
SpecFieldList+="."+pp[counter].id
SpecFieldList2+="."+pp[counter].id
AddClearLink(NewchkID);


}
else if(cookieskist !="" && cookieskist1 !="" )
{

if (cookieskist.indexOf(pp[counter].id)>-1&&cookieskist1.indexOf("Frame-ProductListing.aspx")>-1)
{
if(num<=4)
{
NewCheckBkoxList+="&bull; "+ pp[counter].value + "<br />"; 
num++;


}   
if(NewchkID=="chkBrands")
BrandCheckBackClick=true
pp[counter].checked=true;
NewCheckBkoxListLong+="&bull; "+ pp[counter].value + "<br />";  
SpecFieldList+="."+pp[counter].id
SpecFieldList3+="."+pp[counter].id
AddClearLink(NewchkID);

}


}


}
if (SpecFieldList2!="")
setCookie("SpecFieldList"+NewchkID,SpecFieldList2,1)

return SpecFieldList;
}


function AddClearLink(NewchkID)
{
if(NewchkID=="chkBrands")
BrandListShowFromChild=true;
document.getElementById('ClearAllFilter').style.display = "inline";
document.getElementById(NewchkID+"Clear").style.display = "inline";
}
function ClearSelection(NewchkID)
{

document.getElementById('ClearAllFilter').style.display = "none";
document.getElementById(NewchkID+"Clear").style.display = "none";

}

function  UnCheckByGroup(pp,NewchkID)
{
var SpecFieldList=""
for (counter = 0; counter < pp.length; counter++)
{

if (pp[counter].checked)
{
pp[counter].checked=false;       

}
if(checkCookie("SpecFieldList"+NewchkID)!="")
{
SpecFieldList+="."+pp[counter].id
Delete_Cookie( "SpecFieldList"+NewchkID, SpecFieldList) 

}
}
}

function SelectallByGroup(pp,NewchkID)
{
var SpecFieldList="";
var num=1;
for (counter = 0; counter < pp.length; counter++)
{              
pp[counter].checked=true
SpecFieldList+="."+pp[counter].id;
if(num<=4)
{
NewCheckBkoxList+="&bull; "+ pp[counter].value + "<br />"; 
num++;
}    

NewCheckBkoxListLong+="&bull; "+ pp[counter].value + "<br />";  




}
if (SpecFieldList!="")
setCookie("SpecFieldList"+NewchkID,SpecFieldList,1)
document.getElementById(NewchkID+"Clear").style.display = "inline";
return SpecFieldList;
}




///////////////////////////////////////
///////////////////////Jewelry/////////
///////////////////////////////////////





function Jewelry_Load_Frame_Src(UrlParam,Mode)
{
Jewelry_ok_display(UrlParam,"By_Metal","chkMetal","","","1");
Jewelry_ok_display(UrlParam,"By_Stone","chkStone","","","1");
Jewelry_ok_display(UrlParam,"By_Brands","chkBrands","","","1");
Jewelry_ok_display(UrlParam,"By_Price","chkPrice","","","1");
var page="";
var sortstr="";
var cookieskist=checkCookie("J_Epageid");
var cookieskist1=checkCookie("CheckJ-EDetailBack");
if(cookieskist1=="")
{
Delete_Cookie( "J_Epageid", cookieskist) 
}
if(cookieskist !="" && cookieskist1 !="" )
{
if (cookieskist1.indexOf("Frame-ProductListing.aspx")>-1)
{
page=cookieskist;
sortstr=checkCookie("sortstr");
}


}
else if(cookieskist1 !="")
{
sortstr=checkCookie("sortstr");
}
document.getElementById("IFrame1").src=ServerPath+"Frame-ProductListing.aspx?sort="+sortstr+"&page="+page+"&Type=4235&Mode="+Mode+"&UrlParam="+UrlParam+"&Melist="+escape(MetalSpecFieldList)+"&Stlist="+escape(StoneSpecFieldList)+"&Blist="+escape(BrandsSpecFieldList)+"&Plist="+escape(PriceSpecFieldList);


}   
function Jewelry_CheckList_hidden() 
{

document.getElementById('idBrands').style.visibility= "hidden";
document.getElementById('idMetal').style.visibility= "hidden";
document.getElementById('idStone').style.visibility= "hidden";
document.getElementById('idPrice').style.visibility= "hidden";
}
function Jewelry_show_req(id) 
{
Jewelry_CheckList_hidden();
var pp = document.getElementById(id);
pp.style.visibility = "visible";
if( document.getElementById('IFrame1'))
{
if(id=='idBrands')
document.getElementById('IFrame1').contentWindow.DropDownHidden();
else
document.getElementById('IFrame1').contentWindow.DropDownShow();
}
}

function Jewelry_ok_display(UrlParam,Name,NewchkID,divId,Mode,ProductLoad)
{   
NewCheckBkoxListLong="";
NewCheckBkoxList="";
var checkbox_choices = 0;
var Cookie=checkCookie("CheckJ-EDetailBack");
var SpecFieldList="";
if (divId !="")
Delete_Cookie( "SpecFieldList"+NewchkID, SpecFieldList) 
var pp =  document.getElementsByName(Name);
//alert(pp.length);
if (Name=="By_Stone")
{
StoneSpecFieldList="";
StoneSpecFieldList=GetSpecFieldList(pp,NewchkID,Cookie);
if(StoneSpecFieldList=="")
{
UnCheckByGroup(pp,NewchkID);
document.getElementById(NewchkID+"Clear").style.display = "none";
}

}
else if (Name=="By_Metal")
{ 
MetalSpecFieldList=""
MetalSpecFieldList=GetSpecFieldList(pp,NewchkID,Cookie);
if(MetalSpecFieldList=="")
{
UnCheckByGroup(pp,NewchkID);
document.getElementById(NewchkID+"Clear").style.display = "none";
}
}     

else if(Name=="By_Brands")
{     
BrandsSpecFieldList="";
BrandsSpecFieldList=GetSpecFieldList(pp,NewchkID,Cookie);
if(BrandsSpecFieldList=="")
{
UnCheckByGroup(pp,NewchkID);
document.getElementById(NewchkID+"Clear").style.display = "none";
}

}
else if(Name=="By_Price")
{     
PriceSpecFieldList="";
PriceSpecFieldList=GetSpecFieldList(pp,NewchkID,Cookie);
if(PriceSpecFieldList=="")
{
Delete_Cookie( "SpecFieldList"+NewchkID, SpecFieldList) ;
UnCheckByGroup(pp,NewchkID);
document.getElementById(NewchkID+"Clear").style.display = "none";
}


}
if (divId !="")
{
document.getElementById(divId).style.visibility = "hidden";

}
if (NewCheckBkoxList=="")
{

document.getElementById(NewchkID).innerHTML="";
document.getElementById(NewchkID+"1").innerHTML="";
}
else
{ 
if ((NewCheckBkoxListLong !="" )&& (NewCheckBkoxListLong != NewCheckBkoxList))
{
document.getElementById(NewchkID).innerHTML=NewCheckBkoxList
document.getElementById(NewchkID+"1").innerHTML=NewCheckBkoxListLong
NewCheckBkoxListLong="";
}
else
{
document.getElementById(NewchkID).innerHTML=NewCheckBkoxList
document.getElementById(NewchkID+"1").innerHTML=NewCheckBkoxListLong
//Jewelry_Expand_Check();
}
}   

Jewelry_Expand_Check();
var sttr=StoneSpecFieldList + MetalSpecFieldList+ BrandsSpecFieldList+  PriceSpecFieldList
if ( sttr != "")
{
document.getElementById("IFrame1").src=ServerPath+"Frame-ProductListing.aspx?ProductLoad="+ProductLoad+"&Coo=1&Type=4235&Mode="+Mode+"&UrlParam="+escape(UrlParam)+"&Melist="+escape(MetalSpecFieldList)+"&Stlist="+escape(StoneSpecFieldList)+"&Blist="+escape(BrandsSpecFieldList)+"&Plist="+escape(PriceSpecFieldList)+"&BrandListShowFromChild="+BrandListShowFromChild;
}
else
{
if(divId=='idBrands')
document.getElementById('IFrame1').contentWindow.DropDownShow();
Jewelry_Uncheck(UrlParam,Name,NewchkID,divId,Mode);
}
}
function Jewelry_Expand_Check()
{

document.getElementById('StyleBarLong').style.display = 'none';
document.getElementById('StyleBar').style.display = 'inline';
ax_Check_Expan_Off(MetalSpecFieldList)
ax_Check_Expan_Off(StoneSpecFieldList)
ax_Check_Expan_Off(BrandsSpecFieldList)
ax_Check_Expan_Off(PriceSpecFieldList)
}


function Jewelry_Uncheck(UrlParam,Name,NewchkID,ID,Mode)
{   

NewCheckBkoxList="";
var checkbox_choices = 0;
var pp =  document.getElementsByName(Name);
//alert(pp.length);


if (Name=="By_Metal")
{

MetalSpecFieldList=UnCheckByGroup(pp,NewchkID);
MetalSpecFieldList="";
}
else if (Name=="By_Stone")
{ 

StoneFieldList=UnCheckByGroup(pp,NewchkID);
StoneSpecFieldList=""
}
else if(Name=="By_Brands")
{     

BrandsSpecFieldList=UnCheckByGroup(pp,NewchkID);
BrandsSpecFieldList="";
BrandListShowFromChild=false;
}
else if(Name=="By_Price")
{     

PriceSpecFieldList=UnCheckByGroup(pp,NewchkID);
PriceSpecFieldList="";
}

document.getElementById(NewchkID+"Clear").style.display = "none";

if (NewCheckBkoxList=="")
{
document.getElementById(NewchkID).innerHTML="";
document.getElementById(NewchkID+"1").innerHTML="";
}
else
{
document.getElementById(NewchkID).innerHTML=NewCheckBkoxList
}

Jewelry_Expand_Check();
if(ID !="")
document.getElementById("IFrame1").src=ServerPath+"Frame-ProductListing.aspx?Type=4235&Mode="+Mode+"&UrlParam="+escape(UrlParam)+"&Melist="+escape(MetalSpecFieldList)+"&Stlist="+StoneSpecFieldList+"&Blist="+escape(BrandsSpecFieldList)+"&Plist="+escape(PriceSpecFieldList)+"&BrandListShowFromChild="+BrandListShowFromChild;




}




function Jewelry_Selectall_display(UrlParam,Name,NewchkID,divId,Mode)
{   

NewCheckBkoxListLong="";
NewCheckBkoxList="";
var checkbox_choices = 0;
var pp =  document.getElementsByName(Name);

if (Name=="By_Metal")
{
MetalSpecFieldList=""
MetalSpecFieldList=SelectallByGroup(pp,NewchkID)
}
else if (Name=="By_Stone")
{ 
StoneSpecFieldList="";
StoneSpecFieldList=SelectallByGroup(pp,NewchkID);
}
else if(Name=="By_Brands")
{     
BrandsSpecFieldList="";
BrandsSpecFieldList=SelectallByGroup(pp,NewchkID);

}
else if(Name=="By_Price")
{     
PriceSpecFieldList="";
PriceSpecFieldList=SelectallByGroup(pp,NewchkID);
}
if (divId !="")
document.getElementById(divId).style.visibility = "hidden";
document.getElementById(NewchkID).innerHTML=NewCheckBkoxList
document.getElementById(NewchkID+"1").innerHTML=NewCheckBkoxListLong

if ((NewCheckBkoxListLong !="" )&& (NewCheckBkoxListLong != NewCheckBkoxList))
{


NewCheckBkoxListLong="";
}

Jewelry_Expand_Check();
document.getElementById('ClearAllFilter').style.display = "inline";
document.getElementById("IFrame1").src=ServerPath+"Frame-ProductListing.aspx?Type=4235&Mode="+Mode+"&UrlParam="+escape(UrlParam)+"&Melist="+escape(MetalSpecFieldList)+"&Stlist="+StoneSpecFieldList+"&Blist="+escape(BrandsSpecFieldList)+"&Plist="+escape(PriceSpecFieldList);




}


function Jewelry_ClearFilter(UrlParam,Mode)
{

window.location.reload(true);
}


function Jewelry_BrandList_display(brandIDlist,Name,NewchkID,divId)
{   
if(BrandListShowFromChild==false)
return;
NewCheckBkoxListLong="";
NewCheckBkoxList="";
var checkbox_choices = 0;
var pp =  document.getElementsByName(Name);
var num=1;
var BrandHiddenList="";
brandIDlist1=","+brandIDlist;
for (counter = 0; counter < pp.length; counter++)
{
if (brandIDlist1.indexOf(","+pp[counter].id+',')>-1)
{
//pp[counter].checked=true;
if(num<=4)
{

NewCheckBkoxList+="&bull;"+ pp[counter].value + "<br />"; 
num++;

}    
else
{
divMoreShow=true;
}
NewCheckBkoxListLong+="&bull;"+ pp[counter].value + "<br />";  
AddClearLink(NewchkID);
pp[counter].disabled=false;
document.getElementById("img"+pp[counter].id+"_off").style.display="none";
document.getElementById("span"+pp[counter].id+"_off").style.display="inline";
document.getElementById(pp[counter].id+"_off").style.color="white";
document.getElementById(pp[counter].id+"_off").style.cursor="pointer";

}
else
{
//               if(BrandCheckClick==false)
//               {
//                   pp[counter].disabled=true;
//                   document.getElementById("img"+pp[counter].id+"_off").style.display="inline";
//                   document.getElementById("span"+pp[counter].id+"_off").style.display="none";
//                   document.getElementById(pp[counter].id+"_off").style.color="gray";
//                   document.getElementById(pp[counter].id+"_off").style.cursor="default";
//                   document.getElementById(pp[counter].id+"_off").onclick="none";
//               }

if (BrandCheckBackClick==true)
{   
BrandHiddenList=","+checkCookie("J-EBrandHiddenList")
if(BrandHiddenList.indexOf(","+pp[counter].id+',')>-1)
{
pp[counter].disabled=true;
//pp[counter].style.backgroundColor="black";
document.getElementById("img"+pp[counter].id+"_off").style.display="inline";
document.getElementById("span"+pp[counter].id+"_off").style.display="none";
document.getElementById(pp[counter].id+"_off").style.color="gray";
document.getElementById(pp[counter].id+"_off").style.cursor="default";
document.getElementById(pp[counter].id+"_off").onclick="none";
BrandHiddenList=BrandHiddenList+pp[counter].id+","
setCookie("J-EBrandHiddenList",BrandHiddenList,1)
}
}
else if(BrandCheckClick==false)
{
pp[counter].disabled=true;
//pp[counter].style.backgroundColor="black";
document.getElementById("img"+pp[counter].id+"_off").style.display="inline";
document.getElementById("span"+pp[counter].id+"_off").style.display="none";
document.getElementById(pp[counter].id+"_off").style.color="gray";
document.getElementById(pp[counter].id+"_off").style.cursor="default";
document.getElementById(pp[counter].id+"_off").onclick="none";
BrandHiddenList=BrandHiddenList+pp[counter].id+","
setCookie("J-EBrandHiddenList",BrandHiddenList,1)


}
}

}
if (divId !="")
document.getElementById(divId).style.visibility = "hidden";
if (NewCheckBkoxList=="")
{

document.getElementById(NewchkID).innerHTML="";
document.getElementById(NewchkID+"1").innerHTML="";

}
else
{ 
if ((NewCheckBkoxListLong !="" )&& (NewCheckBkoxListLong != NewCheckBkoxList))
{
document.getElementById(NewchkID).innerHTML=NewCheckBkoxList
document.getElementById(NewchkID+"1").innerHTML=NewCheckBkoxListLong

}
else
{
document.getElementById(NewchkID).innerHTML=NewCheckBkoxList
document.getElementById(NewchkID+"1").innerHTML=NewCheckBkoxListLong
Jewelry_Expand_Check();

}
}

checkDivMoreShow()    

}




///////////////////////////////////////
////////////////Watch PArt ///////////
/////////////////////////////////////




function Watch_CheckList_hidden()
{
document.getElementById('idBrands').style.visibility= "hidden";
document.getElementById('idCaseMaterial').style.visibility= "hidden";
document.getElementById('idComplication').style.visibility= "hidden";
document.getElementById('idStraps').style.visibility= "hidden";
document.getElementById('idCaseShape').style.visibility= "hidden";
document.getElementById('idPrice').style.visibility= "hidden";
}
function Watch_show_req(id) 
{
Watch_CheckList_hidden();
var pp = document.getElementById(id);
pp.style.visibility = "visible";
if( document.getElementById('IFrame1'))
{
if(id=='idBrands')
document.getElementById('IFrame1').contentWindow.DropDownHidden();
else
document.getElementById('IFrame1').contentWindow.DropDownShow();
}

}
function Watch_ok_display(UrlParam,Name,NewchkID,divId,Mode,ProductLoad)
{   

NewCheckBkoxListLong="";
NewCheckBkoxList="";
var checkbox_choices = 0;
var pp =  document.getElementsByName(Name);
var Cookie=checkCookie("CheckW-EDetailBack");
var SpecFieldList="";

if (divId !="")
Delete_Cookie( "SpecFieldList"+NewchkID, SpecFieldList) 
if (Name=="By_Complication")
{

ComplicationSpecFieldList="";
ComplicationSpecFieldList=GetSpecFieldList(pp,NewchkID,Cookie);
if(ComplicationSpecFieldList=="")
{
UnCheckByGroup(pp,NewchkID);
document.getElementById(NewchkID+"Clear").style.display = "none";
}

}
else if (Name=="By_Strap")
{ 

StrapSpecFieldList="";
StrapSpecFieldList=GetSpecFieldList(pp,NewchkID,Cookie);
if(StrapSpecFieldList=="")
{
UnCheckByGroup(pp,NewchkID);
document.getElementById(NewchkID+"Clear").style.display = "none";
} 
}
else if (Name=="By_CaseMaterial")
{
CaseMaterialSpecFieldList="";
CaseMaterialSpecFieldList=GetSpecFieldList(pp,NewchkID,Cookie);
if(CaseMaterialSpecFieldList=="")
{
UnCheckByGroup(pp,NewchkID);
document.getElementById(NewchkID+"Clear").style.display = "none";
}
}
else if(Name=="By_Brands")
{    

BrandsSpecFieldList="";
BrandsSpecFieldList=GetSpecFieldList(pp,NewchkID,Cookie);
if(BrandsSpecFieldList=="")
{
UnCheckByGroup(pp,NewchkID);
document.getElementById(NewchkID+"Clear").style.display = "none";
}

}
else if(Name=="By_CaseShape")
{     
CaseShapeSpecFieldList="";
CaseShapeSpecFieldList=GetSpecFieldList(pp,NewchkID,Cookie);
if(CaseShapeSpecFieldList=="")
{
UnCheckByGroup(pp,NewchkID);
document.getElementById(NewchkID+"Clear").style.display = "none";
}

}
else if(Name=="By_Price")
{     
PriceSpecFieldList="";
PriceSpecFieldList=GetSpecFieldList(pp,NewchkID,Cookie);
if(PriceSpecFieldList=="" && divId !="")
{
UnCheckByGroup(pp,NewchkID);
document.getElementById(NewchkID+"Clear").style.display = "none";
}

}

if (divId !="")
document.getElementById(divId).style.visibility = "hidden";
if (NewCheckBkoxList=="")
{

document.getElementById(NewchkID).innerHTML="";
document.getElementById(NewchkID+"1").innerHTML="";

}
else
{    document.getElementById(NewchkID).innerHTML=NewCheckBkoxList
document.getElementById(NewchkID+"1").innerHTML=NewCheckBkoxListLong
if ((NewCheckBkoxListLong !="" )&& (NewCheckBkoxListLong != NewCheckBkoxList))
{

NewCheckBkoxListLong="";
}

}
var sttr=ComplicationSpecFieldList + StrapSpecFieldList+ CaseMaterialSpecFieldList+ BrandsSpecFieldList+ CaseShapeSpecFieldList+ PriceSpecFieldList
Watch_Expand_Check();
if ( sttr != "")
{
document.getElementById("IFrame1").src=ServerPath+"Frame-ProductListing.aspx?ProductLoad="+ProductLoad+"&Coo=1&Type=1&Mode="+Mode+"&UrlParam="+escape(UrlParam)+"&Comlist="+escape(ComplicationSpecFieldList)+"&Slist="+StrapSpecFieldList+"&Clist="+escape(CaseMaterialSpecFieldList)+"&Blist="+escape(BrandsSpecFieldList)+"&CSlist="+escape(CaseShapeSpecFieldList)+"&Plist="+escape(PriceSpecFieldList)+"&BrandListShowFromChild="+BrandListShowFromChild;
}
else
{
if(divId=='idBrands')
document.getElementById('IFrame1').contentWindow.DropDownShow();
Watch_Uncheck(UrlParam,Name,NewchkID,divId,Mode);
}



}
function Watch_Uncheck(UrlParam,Name,NewchkID,ID,Mode)
{   

NewCheckBkoxList="";
var checkbox_choices = 0;
var pp =  document.getElementsByName(Name);
if (Name=="By_Complication")
{
ComplicationSpecFieldList=UnCheckByGroup(pp,NewchkID);
ComplicationSpecFieldList="";

}
else if (Name=="By_Strap")
{ 
StrapSpecFieldList=UnCheckByGroup(pp,NewchkID);
StrapSpecFieldList="";

}
else if (Name=="By_CaseMaterial")
{
CaseMaterialSpecFieldList=UnCheckByGroup(pp,NewchkID);
CaseMaterialSpecFieldList="";

}
else if(Name=="By_Brands")
{    
BrandsSpecFieldList=UnCheckByGroup(pp,NewchkID); 
BrandsSpecFieldList="";
BrandListShowFromChild=false;
}
else if(Name=="By_CaseShape")
{     
CaseShapeSpecFieldList=UnCheckByGroup(pp,NewchkID); 
CaseShapeSpecFieldList="";

}
else if(Name=="By_Price")
{     
PriceSpecFieldList=UnCheckByGroup(pp,NewchkID); 
PriceSpecFieldList="";

}

document.getElementById(NewchkID+"Clear").style.display = "none";
if (NewCheckBkoxList=="")
{
document.getElementById(NewchkID).innerHTML="";
document.getElementById(NewchkID+"1").innerHTML="";
}
else
{
document.getElementById(NewchkID).innerHTML=NewCheckBkoxList
}

Watch_Expand_Check();
if(ID!="")
document.getElementById("IFrame1").src=ServerPath+"Frame-ProductListing.aspx?Type=1&Mode="+Mode+"&UrlParam="+escape(UrlParam)+"&Comlist="+escape(ComplicationSpecFieldList)+"&Slist="+StrapSpecFieldList+"&Clist="+escape(CaseMaterialSpecFieldList)+"&Blist="+escape(BrandsSpecFieldList)+"&CSlist="+escape(CaseShapeSpecFieldList)+"&Plist="+escape(PriceSpecFieldList)+"&BrandListShowFromChild="+BrandListShowFromChild;


}
function Watch_Expand_Check()
{

document.getElementById('StyleBarLong').style.display = 'none';
document.getElementById('StyleBar').style.display = 'inline';
//document.getElementById("divMore").style.display = "inline"; 
// document.getElementById("divLess").style.display = "none"; 
ax_Check_Expan_Off(ComplicationSpecFieldList)
ax_Check_Expan_Off(StrapSpecFieldList)
ax_Check_Expan_Off(CaseMaterialSpecFieldList)
ax_Check_Expan_Off(CaseShapeSpecFieldList)
ax_Check_Expan_Off(BrandsSpecFieldList)
ax_Check_Expan_Off(PriceSpecFieldList)
}
function Watch_ClearFilter(UrlParam,Mode)
{


window.location.reload(true);
}


function Watch_Selectall_display(UrlParam,Name,NewchkID,divId,Mode)
{   
NewCheckBkoxListLong="";
NewCheckBkoxList="";
var checkbox_choices = 0;
var pp =  document.getElementsByName(Name);
//alert(pp.length);
if (Name=="By_Complication")
{
ComplicationSpecFieldList="";
ComplicationSpecFieldList=SelectallByGroup(pp,NewchkID)
}
else if (Name=="By_Strap")
{ 

StrapSpecFieldList="";
StrapSpecFieldList=SelectallByGroup(pp,NewchkID)

}
else if (Name=="By_CaseMaterial")
{
CaseMaterialSpecFieldList="";
CaseMaterialSpecFieldList=SelectallByGroup(pp,NewchkID)
}
else if(Name=="By_Brands")
{     
BrandsSpecFieldList="";
BrandsSpecFieldList=SelectallByGroup(pp,NewchkID)

}
else if(Name=="By_CaseShape")
{     
CaseShapeSpecFieldList="";
CaseShapeSpecFieldList=SelectallByGroup(pp,NewchkID)
}
else if(Name=="By_Price")
{     
PriceSpecFieldList="";
PriceSpecFieldList=SelectallByGroup(pp,NewchkID)
}
if (divId !="")
document.getElementById(divId).style.visibility = "hidden";
if ((NewCheckBkoxListLong !="" )&& (NewCheckBkoxListLong != NewCheckBkoxList))
{
document.getElementById(NewchkID).innerHTML=NewCheckBkoxList
document.getElementById(NewchkID+"1").innerHTML=NewCheckBkoxListLong
NewCheckBkoxListLong="";
}
else
{
document.getElementById(NewchkID).innerHTML=NewCheckBkoxList
document.getElementById(NewchkID+"1").innerHTML=NewCheckBkoxListLong

}
document.getElementById('ClearAllFilter').style.display = "inline";
Watch_Expand_Check();
document.getElementById("IFrame1").src=ServerPath+"Frame-ProductListing.aspx?Type=1&Mode="+Mode+"&UrlParam="+escape(UrlParam)+"&Comlist="+escape(ComplicationSpecFieldList)+"&Slist="+StrapSpecFieldList+"&Clist="+escape(CaseMaterialSpecFieldList)+"&Blist="+escape(BrandsSpecFieldList)+"&CSlist="+escape(CaseShapeSpecFieldList)+"&Plist="+escape(PriceSpecFieldList);




}
function Watch_Load_Frame_Src(UrlParam,Mode,siteUrl,pagenum)
{

Watch_ok_display(UrlParam,"By_Complication","chkComplications","","","1");
Watch_ok_display(UrlParam,"By_Strap","chkStraps","","","1");
Watch_ok_display(UrlParam,"By_CaseShape","chkCaseShape","","","1");
Watch_ok_display(UrlParam,"By_Price","chkPrice","","","1");
Watch_ok_display(UrlParam,"By_CaseMaterial","chkCaseMaterial","","","1");
Watch_ok_display(UrlParam,"By_Brands","chkBrands","","","1");
var page="";
var sortstr="";
var cookieskist=checkCookie("W_Epageid");
var cookieskist1=checkCookie("CheckW-EDetailBack");
if(cookieskist1=="")
{
Delete_Cookie( "W_Epageid", cookieskist) 
}
if(cookieskist !="" && cookieskist1 !="" )
{

if (cookieskist1.indexOf("Frame-ProductListing.aspx")>-1)
{

page=cookieskist;
sortstr=checkCookie("sortstr");
}


}
else if(cookieskist1 !="")
{
sortstr=checkCookie("sortstr");
}

document.getElementById("IFrame1").src=ServerPath+"Frame-ProductListing.aspx?sort="+sortstr+"&page="+page+"&Type=1&Mode="+Mode+"&UrlParam="+UrlParam+"&Comlist="+escape(ComplicationSpecFieldList)+"&Slist="+StrapSpecFieldList+"&Clist="+escape(CaseMaterialSpecFieldList)+"&Blist="+escape(BrandsSpecFieldList)+"&CSlist="+escape(CaseShapeSpecFieldList)+"&Plist="+escape(PriceSpecFieldList);

}   
function Watch_BrandList_display(brandIDlist,Name,NewchkID,divId)
{   
if(BrandListShowFromChild==false)
return;
//    var cookieskist=checkCookie("EBrandHiddenList");
//    var Cookie=checkCookie("CheckW-EDetailBack");
NewCheckBkoxListLong="";
NewCheckBkoxList="";
var checkbox_choices = 0;
var pp =  document.getElementsByName(Name);
var num=1;
var BrandHiddenList="";
brandIDlist1=","+brandIDlist;


for (counter = 0; counter < pp.length; counter++)
{
if (brandIDlist1.indexOf(","+pp[counter].id+',')>-1)
{

if(num<=4)
{
NewCheckBkoxList+="&bull; "+ pp[counter].value + "<br />"; 
num++;

} 
else
{   
divMoreShow=true;
}
NewCheckBkoxListLong+="&bull; "+ pp[counter].value + "<br />";  
AddClearLink(NewchkID);

pp[counter].disabled=false;
document.getElementById("img"+pp[counter].id+"_off").style.display="none";
document.getElementById("span"+pp[counter].id+"_off").style.display="inline";
document.getElementById(pp[counter].id+"_off").style.color="white";
document.getElementById(pp[counter].id+"_off").style.cursor="pointer";


}
else
{

if (BrandCheckBackClick==true)
{   
BrandHiddenList=","+checkCookie("W-EBrandHiddenList")
if(BrandHiddenList.indexOf(","+pp[counter].id+',')>-1)
{
pp[counter].disabled=true;
//pp[counter].style.backgroundColor="black";
document.getElementById("img"+pp[counter].id+"_off").style.display="inline";
document.getElementById("span"+pp[counter].id+"_off").style.display="none";
document.getElementById(pp[counter].id+"_off").style.color="gray";
document.getElementById(pp[counter].id+"_off").style.cursor="default";
document.getElementById(pp[counter].id+"_off").onclick="none";
BrandHiddenList=BrandHiddenList+pp[counter].id+","
setCookie("W-EBrandHiddenList",BrandHiddenList,1)
}
}
else if(BrandCheckClick==false)
{
pp[counter].disabled=true;
//pp[counter].style.backgroundColor="black";
document.getElementById("img"+pp[counter].id+"_off").style.display="inline";
document.getElementById("span"+pp[counter].id+"_off").style.display="none";
document.getElementById(pp[counter].id+"_off").style.color="gray";
document.getElementById(pp[counter].id+"_off").style.cursor="default";
document.getElementById(pp[counter].id+"_off").onclick="none";
BrandHiddenList=BrandHiddenList+pp[counter].id+","
setCookie("W-EBrandHiddenList",BrandHiddenList,1)


}
}

}

if (divId !="")
document.getElementById(divId).style.visibility = "hidden";
if (NewCheckBkoxList=="")
{

document.getElementById(NewchkID).innerHTML="";
document.getElementById(NewchkID+"1").innerHTML="";

}
else
{ 
if ((NewCheckBkoxListLong !="" )&& (NewCheckBkoxListLong != NewCheckBkoxList))
{
document.getElementById(NewchkID).innerHTML=NewCheckBkoxList
document.getElementById(NewchkID+"1").innerHTML=NewCheckBkoxListLong       
}
else
{
document.getElementById(NewchkID).innerHTML=NewCheckBkoxList
document.getElementById(NewchkID+"1").innerHTML=NewCheckBkoxListLong
Watch_Expand_Check();

}
}
checkDivMoreShow()


}
function checkDivMoreShow()
{
divMoreShow=false;
Check_Expan(ComplicationSpecFieldList,".")
Check_Expan(StrapSpecFieldList,"|")
Check_Expan(CaseMaterialSpecFieldList,".")
Check_Expan(CaseShapeSpecFieldList,".")
Check_Expan(BrandsSpecFieldList,".")
Check_Expan(PriceSpecFieldList,".")
Check_Expan(MetalSpecFieldList,".")
Check_Expan(StoneSpecFieldList,".")
if(divMoreShow==true)
{
if(document.getElementById('StyleBarLong').style.display == "none" )
{
document.getElementById("divLess").style.display = "none";
document.getElementById("divMore").style.display = "inline";
}


}
else
{
if(NewCheckBkoxListLong=="")
{
document.getElementById("divLess").style.display = "none";
document.getElementById("divMore").style.display = "none";
NewCheckBkoxListLong="";
// divMoreShow=false;
}
else if(NewCheckBkoxListLong==NewCheckBkoxList) 
{
document.getElementById("divLess").style.display = "none";
document.getElementById("divMore").style.display = "none";
NewCheckBkoxListLong="";
//divMoreShow=false;
}

else
{
document.getElementById("divLess").style.display = "none";
document.getElementById("divMore").style.display = "inline";
//divMoreShow=true;
}

}



}


function Check_Expan(List,Param)
{

var chunks=List.split(Param)
if(chunks.length>5)
{
divMoreShow=true;
}
}

///////////////////////////////////////
///////cookies  part /////////////////
///////////////////////////////////////




function getCookie(c_name)
{
if (document.cookie.length>0)
{ 
c_start=document.cookie.indexOf(c_name + "=")
if (c_start!=-1)
{ 
c_start=c_start + c_name.length+1 
c_end=document.cookie.indexOf(";",c_start)
if (c_end==-1) c_end=document.cookie.length
return unescape(document.cookie.substring(c_start,c_end))
} 
}
return ""
}

function setCookie(c_name,value,expiredays)
{

var futdate = new Date()		//Get the current time and date
var expdate = futdate.getTime()  //Get the milliseconds since Jan 1, 1970
expdate += 3600*1000  //expires in 1 hour(milliseconds)

//exdate.setDate(exdate.getDate()+expiredays)
futdate.setTime(expdate)

document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : "; expires="+ futdate.toGMTString())
}

function checkCookie(CookiesName)
{
username=getCookie(CookiesName)

return username;
}
function Delete_Cookie( name, value) 
{

document.cookie=name+ "=" +escape(value)+ "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

