/*下拉菜单*/
var oCarte = document.getElementById("carte");
if(oCarte) {
	var oSpan = oCarte.getElementsByTagName("span");
	var intT,intFirstHeight=0;
	for(var i = 0 ; i < oSpan.length ; i++) {
		var strLst = oSpan[i].getAttribute("lst");
		//数组，保存所有可以点击的项目
		if(strLst) {
			//var strLst = oSpan[i].getAttribute("lst");
			var oTmpDiv = document.getElementById(strLst);
			oSpan[i].setAttribute('dh',oTmpDiv.scrollHeight);
			oTmpDiv.style.display = 'none';
			
			oSpan[i].onclick = function() {
				intFirstHeight = 0;
				var iHeight;
				var clsName = this.className;
				var lst = this.getAttribute("lst");
				var oDiv = document.getElementById(lst);
	
				if(clsName == 'ctn') {
					this.className = 'cts';
					//this.setAttribute('dh',oDiv.scrollHeight);
					oDiv.style.display = 'none';
				}
				if(clsName == 'cts') {
					this.className = 'ctn';
					iHeight = this.getAttribute('dh');
					oDiv.style.height = '0px';
					oDiv.style.display = 'block';
					intT = window.setInterval("showMenu('"+lst+"',"+iHeight+")",1);
					//showMenu();
				}
			}//end function
		}//end if
	}//end for
}//end if

//下拉动态显示菜单
function showMenu(strDivID,intHeight){
	intFirstHeight += 10;
	document.getElementById(strDivID).style.height = intFirstHeight + 'px';
	if(intFirstHeight >= intHeight) window.clearInterval(intT);
}//end function

/*页面左右高度相同*/
/*document.body.onload = function(){
	var heightContent = oContent.scrollHeight;
	var heightCarte = oCarte.scrollHeight;
	var heightActual = heightContent + 30;
	if(heightContent > heightCarte) {
		oCarte.style.height = heightActual + "px";
	}
}*/