var layerT;
function chDiv(obj){
	if (obj=='0'){
	clearTimeout(layerT);
	}else{
		layerT = setTimeout(function(){chDiv2(obj);},300);
	}
}
function chDiv2(obj){
	var objPar=obj.parentNode;
	var un=obj.getAttribute("un");
	var un2=objPar.getAttribute("staus");
	
	document.getElementById(un2+"n").className="";
	document.getElementById(un2).style.display="none"
	document.getElementById(un+"n").className="now";
	document.getElementById(un).style.display="";
	
	objPar.setAttribute("staus",un);
}

var tMenu=new Array();
var tempHeight=new Array();
function showMenu(obj){
	var un=obj.getAttribute("un");
	var objPar=obj.parentNode.parentNode;
	var height1=objPar.offsetHeight;
	
	if(document.getElementById(un).style.display=="block"){
		document.getElementById(un).style.display="none";
	}
	else{
		document.getElementById(un).style.display="block";
	}
	
	var height2=objPar.offsetHeight;
	var height3=height2-height1;
	
	document.getElementById(un+"_m").style.display='none';
	document.getElementById(un).style.display="block";
	
	if (height3>0){
		objPar.style.height=height1+"px";
		objPar.style.overflow='hidden';
	}
	else{
		objPar.style.height=height1;
	}
	tempHeight[un]=0;
	scroolIt(un,height3);
}

var objPar=new Array();
var waittime=2;
function scroolIt(objName,objheight){
	objPar[objName]=document.getElementById(objName).parentNode.parentNode;
	if(document.getElementById(objName).parentNode.tagName.toLowerCase()=="dl"){
		objPar[objName]=document.getElementById(objName).parentNode;
		waittime=1;
	}
	objPar[objName].setAttribute("objheight",-objheight);
	clearInterval(tMenu[objName]);
	
	if (objheight>0){
		if (tempHeight[objName]<objheight){
			tempHeight[objName]=tempHeight[objName]+Math.abs(objheight)/5;
			objPar[objName].style.height=objPar[objName].offsetHeight+Math.abs(objheight)/5+"px";
			tMenu[objName] = setInterval(function(){scroolIt(objName,objheight);},waittime);
		}
		else{
			objPar[objName].style.height="auto";
			objPar[objName].style.overflow='visible';
			tempHeight[objName]=0;
		}
	}
	else{
		if (tempHeight[objName]>objheight){
			tempHeight[objName]=tempHeight[objName]-Math.abs(objheight)/5;
			objPar[objName].style.overflow='hidden';
			objPar[objName].style.height=objPar[objName].offsetHeight-Math.abs(objheight)/5+"px";
			tMenu[objName] = setInterval(function(){scroolIt(objName,objheight);},waittime);
		}
		else{
			document.getElementById(objName).style.display="none";
			objPar[objName].style.overflow='visible';
			objPar[objName].style.height="auto";
			tempHeight[objName]=0;
			document.getElementById(objName+"_m").style.display='';
		}
	}
}

var slTime=new Array();
function scroolTime(objName,type){
	var waittime2=3000;
	if (type=='on'){
		clearTimeout(slTime[objName]);
	}
	else if (type=='out'){
		var un=objName;
		
		var objPar=document.getElementById(objName).parentNode.parentNode;
		if(document.getElementById(objName).parentNode.tagName.toLowerCase()=="dl"){
			objPar=document.getElementById(objName).parentNode;
			waittime2=5000;
		}
		//var un=document.getElementById(objName).getAttribute("id");
		var objheight=objPar.getAttribute("objheight");
		if (objheight<0){
			slTime[objName] = setTimeout(function(){scroolIt(un,objheight);},waittime2);
		}
	}
}