isNav = false;
isIE = false;

if (navigator.appName.indexOf("Microsoft") != -1)
{
	isIE = true;
}
else
{
	if (parseInt(navigator.appVersion) >= 5)
	{
		isIE = true;
	}
	else
	{
		isNav = true;
	}
}

if (isNav)
{
	setxs="show";
	setxh="hide";
}
else
{
	setxs="visible";
	setxh="hidden";
}

function getWidth()
{
	if (isNav)
	{
		return window.innerWidth
	} 
	else
	{
		return document.body.clientWidth
	}
}

function getScale()
{
	var scale;	
	scale = getWidth()
	if (scale <= 756)
	{
		scale=756;
	}
	centx = (scale - 756)/2
	centx = Math.floor(centx) 
	return centx;
}

function givecenter()
{
	var scale0 = getScale() + 149;
	var scale1 = getScale() + 230;
	var scale2 = getScale() + 311;
	var scale3 = getScale() + 392;
	var scale4 = getScale() + 453;
	var scale5 = getScale() + 534;
	var scale6 = getScale() + 615

	if(isNav)
	{
		document.layer00.moveTo(scale0,65)
		document.layer01.moveTo(scale1,65);
		document.layer02.moveTo(scale2,65);
		document.layer03.moveTo(scale3,65);
		document.layer04.moveTo(scale4,65);
		document.layer05.moveTo(scale5,65);
		document.layer06.moveTo(scale6,65);
	}
	else
	{
		document.all.layer00.style.pixelLeft =scale0;
		document.all.layer01.style.pixelLeft =scale1;
		document.all.layer02.style.pixelLeft =scale2;
		document.all.layer03.style.pixelLeft =scale3;
		document.all.layer04.style.pixelLeft =scale4;
		document.all.layer05.style.pixelLeft =scale5;
		document.all.layer06.style.pixelLeft =scale6;
	}
}

/* color change code begin */

function changeto(highlightcolor){
source=event.srcElement
if (source.tagName=="TR"||source.tagName=="TABLE")
return
while(source.tagName!="TD")
source=source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
return
if (event.toElement!=source)
source.style.backgroundColor=originalcolor
}

/* color change code end */

function givelayer()
{
	var scale0 = getScale() + 155;
	var scale1 = getScale() + 237;
	var scale2 = getScale() + 315;
	var scale3 = getScale() + 400;
	var scale4 = getScale() + 482;
	var scale5 = getScale() + 565;
	var scale6 = getScale() + 645

	morex=" onmouseover=this.style.visibility="+"'"+setxs+"'"+" onmouseout=this.style.visibility="+"'"+setxh+"'"

	document.write("<span id=layer00 style=position:absolute;left:"+scale0+";top:65px;width:80;visibility:"+setxh+morex+">");
	document.write("<table width=80 cellpadding=0 cellspacing=0 border=0><tr><td height=29><a target=_self href=http://www.fudan.edu.cn/new_genview/genview.htm class=white><img src='img/blank.gif' border=0></a></td></tr></table>");
	document.write("<table id=ignore width=80 cellpadding=2 cellspacing=1 border=0 bgcolor=#616662 onMouseover=changeto('0144AC') onMouseout=changeback('EEEEEE')>");
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_genview/genview.htm class=g>总体介绍</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_genview/history.htm class=g>辉煌校史</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_genview/leader.htm class=g>现任领导</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_genview/hisleader.htm class=g>历任领导</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_genview/alumni.htm class=g>校董校友</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_genview/tongji.htm class=g>统计年鉴</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_genview/scene.htm class=g>校园景色</a></td></tr>");
	document.write("</table></span>");


	document.write("<span id=layer01 style=position:absolute;left:"+scale1+";top:65px;width:81;visibility:"+setxh+morex+">");
	document.write("<table width=81 cellpadding=0 cellspacing=0 border=0><tr><td height=29><a target=_self href=http://www.fudan.edu.cn/new_organize/organize.htm class=white><img src='img/blank.gif' border=0></a></td></tr></table>");
	document.write("<table id=ignore width=81 cellpadding=2 cellspacing=1 border=0 bgcolor=#616662 onMouseover=changeto('0144AC') onMouseout=changeback('EEEEEE')>");
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_organize/dangwu.htm class=g>党务部门</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_organize/xingzheng.htm class=g>行政部门</a></td></tr>");	
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_organize/other.htm class=g>其它部门</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_cohospital/cohospital.htm class=g>附属医院</a></td></tr>");
	document.write("</table></span>");

	document.write("<span id=layer02 style=position:absolute;left:"+scale2+";top:65px;width:81;visibility:"+setxh+morex+">");
	document.write("<table width=81 cellpadding=0 cellspacing=0 border=0><tr><td height=29><a target=_self href=http://www.fudan.edu.cn/new_dep/dep.htm class=white><img src='img/blank.gif' border=0></a></td></tr></table>");
	document.write("<table id=ignore width=91 cellpadding=2 cellspacing=1 border=0 bgcolor=#616662 onMouseover=changeto('0144AC') onMouseout=changeback('EEEEEE')>");
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_dep/depintro.htm class=g>各院系简介</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>　<a target=_self href=http://www.fudan.edu.cn/new_dep/deplink.htm class=g>各院系链接</a></td></tr>");
	document.write("</table></span>");

	document.write("<span id=layer03 style=position:absolute;left:"+scale3+";top:65px;width:81;visibility:"+setxh+morex+">");
	document.write("<table width=100 cellpadding=0 cellspacing=0 border=0><tr><td height=29><a target=_self href=http://www.fudan.edu.cn/new_teach/teach.htm class=white><img src='img/blank.gif' border=0></a></td></tr></table>");
	document.write("<table id=ignore width=100 cellpadding=2 cellspacing=1 border=0 bgcolor=#616662 onMouseover=changeto('0144AC') onMouseout=changeback('EEEEEE')>");
        document.write("<tr><td bgcolor=EEEEEE>&nbsp;<a target=_self href=http://www.fudan.edu.cn/new_teach/teacher.htm class=g>师资队伍</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>&nbsp;<a href=http://www.jwc.fudan.edu.cn class=g target=_blank>本科生培养</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>&nbsp;<a href=http://www.gs.fudan.edu.cn class=g target=_blank>研究生培养</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>&nbsp;<a href=http://www.gs.fudan.edu.cn/phwork/phwork.htm class=g target=_blank>博士后教育</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>&nbsp;<a href=http://www.cce.fudan.edu.cn class=g target=_blank>继续教育</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>&nbsp;<a href=http://dec.fudan.edu.cn class=g target=_blank>网络教育</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE>&nbsp;<a href=http://iso.fudan.edu.cn/ class=g target=_blank>留学生培养</a></td></tr>");
	document.write("</table></span>");
	
	document.write("<span id=layer04 style=position:absolute;left:"+scale4+";top:65px;width:81;visibility:"+setxh+morex+">");
	document.write("<table width=81 cellpadding=0 cellspacing=0 border=0><tr><td height=29><a target=_self href=http://www.fudan.edu.cn/new_research/research.htm class=white><img src='img/blank.gif' border=0></a></td></tr></table>");
	document.write("<table id=ignore width=95 cellpadding=2 cellspacing=1 border=0 bgcolor=#616662 onMouseover=changeto('0144AC') onMouseout=changeback('EEEEEE')>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_research/mainsub.htm class=g>国家重点学科</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_research/mainlab.htm class=g>国家重点实验室</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_research/center.htm class=g>研究机构</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_research/mainpro.htm class=g>科研项目</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_research/result.htm class=g>学术成果</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a href=http://www.fudanpress.com.cn/ class=g target=_blank>复旦大学出版社</a></td></tr>");
document.write("<tr><td bgcolor=EEEEEE><a href=http://www.fudan.edu.cn/new_research/magazine.htm class=g>复旦学报</a></td></tr>");
document.write("<tr><td bgcolor=EEEEEE><a href=http://www.fudan.edu.cn/wkxb/ class=g target=_blank>复旦学报社科版</a></td></tr>");
document.write("<tr><td bgcolor=EEEEEE><a href=http://www.fudan.edu.cn/new_research/kanwu.htm class=g>学术刊物</a></td></tr>");
document.write("<tr><td bgcolor=EEEEEE><a href=http://www.fudan.edu.cn/new_research/gongxiang.htm class=g>设备共享</a></td></tr>");
	document.write("</table></span>");
	
	document.write("<span id=layer05 style=position:absolute;left:"+scale5+";top:65px;width:81;visibility:"+setxh+morex+">");
	document.write("<table width=81 cellpadding=0 cellspacing=0 border=0><tr><td height=29><a target=_self href=http://www.fudan.edu.cn/new_stu/stu.htm class=white><img src='img/blank.gif' border=0></a></td></tr></table>");
	document.write("<table id=ignore width=85 cellpadding=2 cellspacing=1 border=0 bgcolor=#616662 onMouseover=changeto('0144AC') onMouseout=changeback('EEEEEE')>");
	document.write("<tr><td bgcolor=EEEEEE><a href=http://www.youth.fudan.edu.cn/intro.aspx target=_blank class=g>团委</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_stu/union.htm class=g>学生会</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_stu/club.htm class=g>学生社团</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_stu/xueshu.htm class=g>学生学术活动</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_stu/phy.htm class=g>学生体育活动</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_stu/wenyu.htm class=g>学生文娱活动</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a href=http://news.fudan.edu.cn/calendar/  target=_blank class=g>讲座信息预告</a></td></tr>");
	document.write("</table></span>");
	
	document.write("<span id=layer06 style=position:absolute;left:"+scale6+";top:65px;width:81;visibility:"+setxh+morex+">");
	document.write("<table width=81 cellpadding=0 cellspacing=0 border=0><tr><td height=29><a target=_self href=http://www.fudan.edu.cn/new_commu/commu.htm class=white><img src='img/blank.gif' border=0></a></td></tr></table>");
	document.write("<table id=ignore width=110 cellpadding=2 cellspacing=1 border=0 bgcolor=#616662 onMouseover=changeto('0144AC') onMouseout=changeback('EEEEEE')>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_commu/guonei.htm class=g>国内交流</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_commu/guoji.htm class=g>国际交流</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a href=http://www.fao.fudan.edu.cn class=g target=_blank>外事处</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a target=_self href=http://www.fudan.edu.cn/new_organize/duiwai.htm class=g>对外联络与发展处</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a href=http://iso.fudan.edu.cn/ class=g target=_blank>外国留学生工作处</a></td></tr>");
	document.write("<tr><td bgcolor=EEEEEE><a href=http://www.ies.fudan.edu.cn/ class=g target=_blank>国际文化交流学院</a></td></tr>");
	document.write("</table></span>");
}

function givemenu()
{
    document.write("<table border=0 cellpadding=0 cellspacing=1><tr>");
    document.write("<td width=80 height=20 align=center class=white><a target=_self href=http://www.fudan.edu.cn/englishnew class=white>&nbsp;<font face=Arial>English</font></a>&nbsp; | &nbsp;</td>");
    document.write("<td width=80 height=20 align=center class=white><a target=_self href=http://www.fudan.edu.cn class=white>返回首页</a>&nbsp; | &nbsp;</td>");
	document.write("<td width=81 align=center class=white><a href=javascript: class=white onMouseOver='layer00.style.visibility=setxs' onMouseOut='layer00.style.visibility=setxh'>复旦概况</a>&nbsp; | &nbsp;</td>");
	document.write("<td width=81 align=center class=white><a href=javascript: class=white onMouseOver='layer01.style.visibility=setxs' onMouseOut='layer01.style.visibility=setxh'>组织机构</a>&nbsp; | &nbsp;</td>");
	document.write("<td width=81 align=center class=white><a href=javascript: class=white onMouseOver='layer02.style.visibility=setxs' onMouseOut='layer02.style.visibility=setxh'>院系专业</a>&nbsp; | &nbsp;</td>");
	document.write("<td width=81 align=center class=white><a href=javascript: class=white onMouseOver='layer03.style.visibility=setxs' onMouseOut='layer03.style.visibility=setxh'>教学一览</a>&nbsp; | &nbsp;</td>");
	document.write("<td width=81 align=center class=white><a href=javascript: class=white onMouseOver='layer04.style.visibility=setxs' onMouseOut='layer04.style.visibility=setxh'>科学研究</a>&nbsp; | &nbsp;</td>");
	document.write("<td width=81 align=center class=white><a href=javascript: class=white onMouseOver='layer05.style.visibility=setxs' onMouseOut='layer05.style.visibility=setxh'>校园文化</a>&nbsp; | &nbsp;</td>");
        document.write("<td width=81 align=left class=white><a href=javascript: class=white onMouseOver='layer06.style.visibility=setxs' onMouseOut='layer06.style.visibility=setxh'>交流合作</a></td></tr>");
	
	document.write("</tr></table>");
}
