// JavaScript Document

function addLoadEvent(func){
var oldonload=window.onload;
if(typeof window.onload!="function"){
window.onload=func;
}
else{
window.onload=function(){
oldonload();
func();
}
}
}

function initialClick(){
	var oTarget=document.getElementById("category").getElementsByTagName("li");
	for(var i=0;i<oTarget.length;i++){
		oTarget[i].className=oTarget[i].className.replace(new RegExp("( ?|^)show\\b"),"");
	}
}
function addClick(){
	var oSource=document.getElementById("category").getElementsByTagName("li");
	for(var j=0;j<oSource.length;j++){
		oSource[j].onclick=function(){
		    if(this.className.indexOf("show")==-1){
		    	initialClick();
			    this.className+=(this.className.length>0?" ":"")+"show";
				//var oTarget=getNextElement(this);
//				oTarget.nextSibling.className+=(oTarget.nextSibling.className.length>0?" ":"")+"show";
				//alert(oTarget.nextSibling.className);
		    }
		    else{
			    this.className=this.className.replace(new RegExp("( ?|^)show\\b"),"");
				//var oTarget=getNextElement(this);
//				oTarget.nextSibling.className=oTarget.nextSibling.className.replace(new RegExp("( ?|^)show\\b"),"");
		    }
		    //return false;
		}
	}
}
addLoadEvent(addClick);

