// JavaScript Document

	var _Time_Out_Obj;//定义定时器对象
	var _Time_Out_Obj2;//定义定时器对象
	
//菜单开始
	var vartop=new Array(180,230,270,330,370,410,0,490);
	var varheight=new Array(60,70,90,230,80,60,0,50);
	var varwidth=new Array(180,180,150,180,150,110,0,180);
	var varsub=new Array(0,1,1,1,1,1,0,1);//是否显示子菜单
	var varcontent=new Array(8);
	
//	varcontent[0]="<table style='font-size:13px; font-family:宋体'><tr><td style='padding-left:10px'>Botany Institute of CAS</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px'>CNRRI Introduction</td></tr></table>";
	varcontent[1]="<table style='font-size:13px; font-family:宋体'><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"Organization%20Chart/PD.htm\")'>Present Directors</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"Organization%20Chart/AD.htm\")'><nobr>Administration Divisions</nobr></td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand'onclick='new_page(\"Organization%20Chart/SI.htm\")'>Supporting Institutions</td></tr></table>";
	varcontent[2]="<table style='font-size:13px; font-family:宋体'><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"CNRRI_Foundation/GP.htm\")'>Granted Projects</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"CNRRI_Foundation/DA.htm\")'>Donation Account</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand'onclick='new_page(\"CNRRI_Foundation/DDP.htm\")'>Directory of<br>Donating Persons </td></tr></table>";
	varcontent[3]="<table style='font-size:13px; font-family:宋体'><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"Research%20Centers/CNCRI.htm\")'>China National Center for Rice Improvement</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"Research%20Centers/keylab.htm\")'>State Key Laboratory of Rice Biology</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"Research%20Centers/RDCRPT.htm\")'>Research and Development Center of Rice Production Technology</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' width='100%' height='1' /></td></tr><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"Research%20Centers/RPQTC.htm\")'>Rice Product Quality Inspection and Supervision Testing Center</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"Research%20Centers/RSTIC.htm\")'><nobr>Rice Science &Technology</nobr> Information Center</td></tr></table>";
	varcontent[4]="<table style='font-size:13px; font-family:宋体'><!--<tr><td style='padding-left:10px'>Course Fee</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr>--><tr><td style='padding-left:10px;cursor:default' onmouseover=sub_guide_2nd('0') onmouseout=hide_sub_2nd()>Training Activities</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:default' onmouseover=sub_guide_2nd('1') onmouseout=hide_sub_2nd()>Training Courses</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand'onclick='new_page(\"training/other_info.htm\")' onmouseover=sub_guide_2nd('2') onmouseout=hide_sub_2nd()>Other Information</td></tr></table>";
	varcontent[5]="<table style='font-size:13px; font-family:宋体'><tr><td style='padding-left:10px;cursor:hand' onclick='javascript:window.open(\"http://www.ricescience.org/\")'>Rice Science</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px'>Rice in China</td></tr></table>";
	varcontent[7]="<table style='font-size:13px; font-family:宋体'><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"Exchange%20and%20collaboration/home.htm\")'><nobr>International Cooperation</nobr> and Ecchange</td></tr></table>";
	
//菜单结束


//二级子菜单开始
	var vartop2=new Array(380,400,0);
	var varheight2=new Array(70,150,0);
	var varwidth2=new Array(170,200,0);
	var varsub2=new Array(1,1,0);//是否显示二级子菜单
	var varcontent2=new Array(2);


	varcontent2[0]="<table style='font-size:13px; font-family:宋体'><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"training/Training%20Activities/Degree%20Program/home.htm\")'>Degree Program</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"training/Training%20Activities/Group%20Training%20Program/home.htm\")'>Group Training Program</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"training/Training%20Activities/Non-degree%20Program/home.htm\")'>Non-degree Program</td></tr></table>";
	varcontent2[1]="<table style='font-size:13px; font-family:宋体'><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"training/Training%20Courses/BSP.htm\")'>Course_Breeding & Seed Production of Hybrid Rice</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"training/Training%20Courses/HQRB.htm\")'>Course_High Quality Rice Breeding and Gain Quality Analysis</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"training/Training%20Courses/RB.htm\")'>Course_Rice Biotechnology</td></tr><tr><td><img src='def_img/sub_guide_underline.gif' height='1' width='100%' /></td></tr><tr><td style='padding-left:10px;cursor:hand' onclick='new_page(\"training/Training%20Courses/RPP.htm\")'>Course_Rice Production and Planting</td></tr></table>";
	varcontent2[2]="";
//二级子菜单结束

//参数设置结束

	//document.getElementById("Layer2").style.display="block"	

function releft(){//调整子菜单的左边距
//alert(document.body.clientWidth);
	if (document.body.clientWidth>778){
		document.getElementById("Layer1").style.left=(document.body.clientWidth-778)/2+200;
		document.getElementById("Layer2").style.left=(document.body.clientWidth-778)/2+205+varwidth[4];
	}
	else{
		document.getElementById("Layer1").style.left=200;
		document.getElementById("Layer2").style.left=220+varwidth[4];
	}
}
window.onresize=releft;
window.onload=releft;

function sub_show(No){
	window.clearTimeout(_Time_Out_Obj);//清除计时器
	if (varsub[No]==1){//是否显示子菜单
		document.getElementById("Layer1").style.top=vartop[No];
		document.getElementById("sub_guide").height=varheight[No];
		document.getElementById("sub_guide").width=varwidth[No];
		document.getElementById("sub_guide_below_mid").width=varwidth[No]-16;
		inner.innerHTML=varcontent[No];
		document.getElementById("sub_guide_right_mid").height=document.getElementById("sub_guide").height-13;
		document.getElementById("Layer1").style.display="block";
	}else{
		document.getElementById("Layer1").style.display="none";
	}
}

function sub_guide_2nd(No){
	window.clearTimeout(_Time_Out_Obj);//清除计时器
	window.clearTimeout(_Time_Out_Obj2);//清除计时器

	if (varsub2[No]==1){//是否显示二级子菜单
		document.getElementById("Layer2").style.top=vartop2[No];
		document.getElementById("sub_guide2").height=varheight2[No];
		document.getElementById("sub_guide2").width=varwidth2[No];
		document.getElementById("sub_guide_below_mid2").width=varwidth2[No]-16;
		inner2.innerHTML=varcontent2[No];
		document.getElementById("sub_guide_right_mid2").height=document.getElementById("sub_guide2").height-13;
		document.getElementById("Layer2").style.display="block";
	}else{
		document.getElementById("Layer2").style.display="none";
	}
}

function mouse_on_div(div_No){
	window.clearTimeout(_Time_Out_Obj);//清除计时器
	document.getElementById("Layer1").style.display="block";
	if (div_No=='2nd'){
		window.clearTimeout(_Time_Out_Obj2);//清除计时器
		document.getElementById("Layer2").style.display="block";
	}
}

function sub_hide(Layer){
	//if(Layer=="Layer1")
		_Time_Out_Obj = window.setTimeout(sub_hide4,200);
	//else
	//	_Time_Out_Obj = window.setTimeout(sub_hide4,200);
}

//function sub_hide2(){
//	document.getElementById("Layer1").style.display="none";
//}
function sub_hide3(){
	document.getElementById("Layer2").style.display="none";
}
function sub_hide4(){
	document.getElementById("Layer1").style.display="none";
	document.getElementById("Layer2").style.display="none";
}
function hide_sub_2nd(){
	_Time_Out_Obj2 = window.setTimeout(sub_hide3,200);
}

function new_page(url){
	//alert(url);
	document.getElementById("detail").src=url;	
}