﻿
function classShow(obj,code)
{
    var GetPara = location.search;
    var GetVal = GetPara.substring(GetPara.indexOf("=")+1);
    if(GetPara.length==0){
        GetVal = 0}
    else if(GetVal.length == 0){
        GetVal = 0}
    else if(GetVal.length>=6){
        GetVal = GetVal.substring(0,3)}
    else if(isNaN(GetVal)){
        GetVal = 0}
    else if(GetVal.length != 3)
        {GetVal = 0}
    
    code=code||"";
    if(code.length>0){
        GetVal=code;
    }    
    var ProductlistDIV = 
    {
    	
	    Ul : $("#"+obj).find("ul"),
	    FullHide : function(){$("#"+obj).find("ul").children(".child").hide()},	
	    findtext : function(rID){return "a[href='ArticleList.shtml?c=" + rID +"']"},
	    Init : function(rID){
            ProductlistDIV.FullHide();
		    if(rID != 0){ProductlistDIV.ShowChilds(rID)}
        },
	    ShowChilds : function(rID){
		    $.each(ProductlistDIV.Ul.find(ProductlistDIV.findtext(rID)).parent().nextAll(), function(i, n){
			    if($(n).filter(".child").html() != null){$(n).filter(".child").show();}
			    else{return false;}
		    });
	    }
    }
    ProductlistDIV.Init(GetVal);
}
