function showsubmenu(sid) {
	whichEl = eval("submenu" + sid);
	if (whichEl.style.display == "none") {
		eval("submenu" + sid + ".style.display=\"\";");
	}else {
		eval("submenu" + sid + ".style.display=\"none\";");
	}
}

function setMenuStyle(str) {
	var whichEl,sid;
	
	try{
		document.all["menu_home"].className = "menuOff";
		document.all["menu_comp"].className = "menuOff";
		document.all["menu_news"].className = "menuOff";
		document.all["menu_coll"].className = "menuOff";
		document.all["menu_fash"].className = "menuOff";
		document.all["menu_hist"].className = "menuOff";
		document.all["menu_memb"].className = "menuOff";
		document.all["menu_"+str].className = "menuOn";
	}catch(e){}
	
	document.all["submenu1"].style.display = "";
	
	var sPath = document.location.pathname;
	sPath = sPath.substr(sPath.indexOf("/"));
	if(str == "comp") {
		document.all["submenu1"].style.display = "";
	}
}

function setSubMenuStyle(str) {
	try{
		document.all["sub1"].className = "subOff";
		document.all["sub2"].className = "subOff";
		document.all["sub3"].className = "subOff";
		document.all["sub4"].className = "subOff";
		document.all["sub"+str].className = "subOn";
	}catch(e){}
}

//check login
function checklogin(theform,str){	
	if(theform.name.value.length < 4){
		alert("请正确输入"+str+"名称！");
		theform.name.focus();
		return false;
	}
	if(theform.psw.value.length < 4) {
		alert("请正确输入"+str+"密码！");
		theform.psw.focus();
		return false;
	}
	if(theform.code.value.length != 4) {
		alert("请正确输入验证码！");
		theform.code.focus();
		return false;
	}
}

function ShowDialog(obj, url, width, height) {
	var arr = showModalDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;center:yes;resizable:no;px;help:no;scroll:no;status:no");
	if(arr != null) {
		obj.value=arr;
	}
}

function GotoURL(url, width, height) {
	var arr = showModalDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;center:yes;resizable:no;px;help:no;scroll:yes;status:no");
}

function CheckChildren() {
	if(self == top) {
		self.location.href = "index.asp";
	}	
}

function CheckParent() {
	if(self != top) {
		self.location.href = "index.asp";
	}	
}