function addloadevent(thefunc){
var oldfunc=window.onload;
if (typeof oldfunc!='function'){
window.onload=thefunc;
}
else{
window.onload=function(){
		oldfunc();
		thefunc();
		}
	}
}

function showfirst(){
var catlist=document.getElementById("catlist");
var allcats=catlist.getElementsByTagName("div");
for(var i=0;i<allcats.length;i++){
	var obj=allcats[i];
	obj.onmouseover=function(){
		this.style.backgroundColor='#f1fceb';
		this.style.cursor='pointer';
		catid=this.getAttribute("id");
		outid=catid.replace("cat","sub");
		var outdiv=document.getElementById(outid);
		outdiv.style.display="block";
	}
	obj.onmouseout=function(){
		this.style.backgroundColor="";
		this.style.color="";
		catid=this.getAttribute("id");
		outid=catid.replace("cat","sub");
		var outdiv=document.getElementById(outid);
		outdiv.style.display="none";
	}
}
var curid=catlist.getAttribute("name");
if(curid){
outid="sub"+curid
var outdiv=document.getElementById(outid);
outdiv.style.display="block";
}
}
addloadevent(showfirst);


