//声明全局变量
window.isshow = 2;
window.getHeight = 0;
window.browserVersion = "";
submenuHidden(4);
function menuOver(id){
	$("#menuItem"+id).css("background","url('images/menu"+id+"Hover.jpg')");
	if(window.isshow==2|window.isshow==4|window.isshow==5|window.isshow==7|window.isshow==8){
		submenuHidden(window.isshow);
		}
	if(id==2|id==4|id==5|id==7|id==8){
		submenuShow(id);
		window.isshow =id;
	}
	
	//menuIe6Arr = ["80px","140px","260px","340px","350px"];
	//menuIe7Arr = ["160px","180px","400px","620px","650px"];
	//menuFfArr = ["120px","200px","400px","620px","650px"];
	menuIe6Arr = ["80px","200px","260px","340px","350px"];
	menuIe7Arr = ["160px","400px","400px","620px","650px"];
	menuFfArr = ["120px","270px","400px","620px","650px"];
	getVersion();
	if(window.browserVersion == 6.0){
		navArr = menuIe6Arr;
		}
	else if(window.browserVersion == 7.0){
		navArr = menuIe7Arr;
		}
	else{
		navArr = menuFfArr;
		}
	
	if(id==2){document.getElementById("subMenuItem2").style.marginLeft = navArr[0];}
	else if(id==4){document.getElementById("subMenuItem4").style.marginLeft = navArr[1];}
	else if(id==5){document.getElementById("subMenuItem5").style.marginLeft = navArr[2];}
	else if(id==7){document.getElementById("subMenuItem7").style.marginLeft = navArr[3];}
	else if(id==8){document.getElementById("subMenuItem8").style.marginLeft = navArr[4];}
	
	/*
	if(id==2){document.getElementById("subMenuItem2").style.marginLeft = "160px";}
	else if(id==4){document.getElementById("subMenuItem4").style.marginLeft = "280px";}
	else if(id==5){document.getElementById("subMenuItem5").style.marginLeft = "520px";}
	else if(id==7){document.getElementById("subMenuItem7").style.marginLeft = "680px";}
	else if(id==8){document.getElementById("subMenuItem8").style.marginLeft = "690px";}
	*/
	}
function menuOut(id){
	document.getElementById("menuItem"+id).style.background = "url('images/menu"+id+".jpg')";
	//$(document).bind("click",submenuHidden(2));
	/*if(id==2|id==4|id==5|id==7|id==8){
		//$("#subMenu").blur( function () { alert("Hello World!"); } ); 
		}*/
	}
function changeURL(url){
	parent.frames["mainFrame"].window.location = url;
	//parent.document.getElementById("main").style.height = 1800;
	//alert(parent.frames["mainFrame"].window.document.body.scrollHeight);
	//parent.window.location = window.location+"#"+url;
	//parent.frames.style.height = parent.frames["mainFrame"].contentWindow.document.body.scrollHeight+800+"px";
	//parent.frames.style.height = 1800+"px";
	//alert(parent.frames["mainFrame"].document.body.scrollHeight);
	//parent.window.location=url; 
	}
function controlParHeight(){
	var mainFrameHeight = 0;
	mainFrameHeight = $(document).height();
	//alert(mainFrameHeight);
	parent.document.getElementById("main").style.height = mainFrameHeight+430+"px";
	alert(mainFrameHeight+430+"px");
	}
function ctrlParHeight(){
	var mainFrameHeight = 0;
	mainFrameHeight = $(document).height();
	parent.parent.document.getElementById("main").style.height = mainFrameHeight+430+"px";
	}
function submenuHiddenTimer(){
	window.clearTimeout(timer2);//clearInterval(timer1);
	var timer2 = setTimeout('submenuHidden(window.isshow)',3000);
	}
function submenuShow(id){
	$("#subMenuItem"+id).css("display","block");
	//$("#subMenuItem"+id).css("background","#FF6600");
	}
function submenuHidden(id){
	$("#subMenuItem"+id).css("display","none");
	}
function submenuHidden2(){
	$("#subMenuItem"+window.isshow).css("display","none");
	}
function getVersion(){
	window.browserVersion = navigator.appVersion.split(";")[1].split("MSIE")[1];
	}