// JavaScript Document
    function checkAllNo(name)
    {
        var names=document.getElementsByName(name);
        var len=names.length;
        if(len>0){
            var i=0;
            for(i=0;i<len;i++){
            names[i].checked=false;}
        }
    }

function ShowSubCate(tdid){
	var i=1;
	for (i=1;i<=11;i++){
		document.getElementById("cls"+i).style.background="url(images/p_c_bg_de0.jpg) no-repeat";
		document.getElementById("cls"+i).style.color="#000000";
		document.getElementById("sub"+i).style.display="none";
	}
	document.getElementById("cls"+tdid).style.background="url(images/p_c_bg_on0.jpg) no-repeat";
	document.getElementById("cls"+tdid).style.color="#FFFFFF";
	document.getElementById("sub"+tdid).style.display="block";	
	
	checkAllNo("selectCate");
}

function ShowSubBrand(tdid){
	var i=1;
	for (i=1;i<=26;i++){
		document.getElementById("brd"+i).style.color="#000000";
		document.getElementById("brdsub"+i).style.display="none";
	}
	document.getElementById("brd"+tdid).style.color="#FF0801";
	document.getElementById("brdsub"+tdid).style.display="block";	
	checkAllNo("selectBrand");
}

function toggleAllCate(obj){
    var ckbs=obj.parentElement.parentElement.getElementsByTagName("input");
    for(i=0;i<ckbs.length;i++)
    ckbs[i].checked=obj.checked;
    OnCateLink();
}
function OnCateLink(){
    
    
    var links=document.all.tags("input")
    var total=links.length
    var id="0";
    var cate="0";
    var brand="0";
	        for (i=0;i<total;i++)
            {
                if(links[i].id=="selectPrice")
                {
                    if(links[i].checked==true)
                    {
                        id=id+","+links[i].value;
                          
                    }
                }
                if(links[i].id=="selectCate")
                {
                    if(links[i].checked==true)
                    {
                        cate=cate+","+links[i].value;
                          
                    }
                }
                if(links[i].id=="selectBrand")
                {
                    if(links[i].checked==true)
                    {
                        brand=brand+","+links[i].value;
                          
                    }
                }
            }
   var skey=document.getElementById("wd").value;
	var ProNo=document.getElementById("proNo").value;
    var price1=document.getElementById("lprice").value;
    var price2=document.getElementById("rprice").value;
	var jcid=document.getElementById("HiCid").value;
    
    if(price1==""){price1=0}
    if(price2==""){price2=0}
   
     
	window.parent.frames("mainlist").window.location.href="list.aspx?cid="+jcid+"&brand="+brand+"&price1="+price1+"&price2="+price2+"&prono="+ProNo+"&wd="+skey;
}

function KeywordS(){
    var skey=document.getElementById("wd").value;
	var ProNo=document.getElementById("proNo").value;
    var price1=document.getElementById("lprice").value;
    var price2=document.getElementById("rprice").value;
	var jcid=document.getElementById("HiCid").value;
    window.parent.frames("mainlist").window.location.href="list.aspx?cid="+jcid+"&price1="+price1+"&price2="+price2+"&prono="+ProNo+"&wd="+skey;
}

function PriceS(){
    var price1=document.getElementById("lprice").value;
    var price2=document.getElementById("rprice").value;
    window.parent.frames("mainlist").window.location.href="list.aspx?price1="+price1+"&price2="+price2;
}
function SetCid(cid)
{
	document.getElementById("HiCid").value=cid;
	
}



//function JHshNumberText()
//{
//    if ( !(((window.event.keyCode >= 48) && (window.event.keyCode <= 57)) || (window.event.keyCode == 13)))
//    {
//        window.event.keyCode = 0 ;
//    }
//}
