function underBar(tar){
	           // if(tar=='undefined' || tar=="")
				// 	return;
				if(!(navigator.appVersion.indexOf('MSIE 6.0')>0))
				{
					return false;
				}
				else
				{
					var ele=document.getElementById('mainfloat');
					ele.style.position='absolute';
					//ele.style.zIndex=1000;
					//ele.style.top=document.body.clientHeight-ele.offsetHeight;
					//alert(document.getElementById('mainfloat').currentStyle.position);
					//document.getElementById('mainfloat').style.position='fixed';
					scrollTop=getScrollTop();
           			var a =scrollTop+document.documentElement.clientHeight-getid('mainfloat').offsetHeight;
					getid('mainfloat').style.top = a;
				}
				if(tar!=undefined) setTimeout("underBar(1)",1000);
}

function getid(tar)
{
return document.getElementById(tar);
}

function getScrollTop()
{
        var scrollPos; 
        if (typeof window.pageYOffset != 'undefined') { 
           scrollPos = window.pageYOffset; 
        } 
        else if (typeof document.compatMode != 'undefined' && 
                 document.compatMode != 'BackCompat') { 
           scrollPos = document.documentElement.scrollTop; 
        } 
        else if (typeof document.body != 'undefined') { 
           scrollPos = document.body.scrollTop; 
        } 
        return scrollPos;
}
/* 预装入图片 */
function imgPreloader()
{
	mImgs=new Array();
	for(var i=0;i<4;i++)
	{
		mImgs[i]=new Image();
		mImgs[i].src="arrow"+(i+1)+".png";
	}	
}
//impPreloader();
//var path="../../image/";
function arrowover()
{

	var img=document.getElementById("arrowimg");
	var s=img.src;
	if(s.indexOf("arrow1.png")!=-1)
		img.src=s.replace("arrow1","arrow2");//="image/arrow2.png";
	else
		img.src=s.replace("arrow3","arrow4");//="image/arrow4.png";
}
function arrowout()
{
	var img=document.getElementById("arrowimg");
	var s=img.src;
	if(s.indexOf("arrow2.png")!=-1)
		img.src=s.replace("arrow2","arrow1");//="image/arrow2.png";
	else
		img.src=s.replace("arrow4","arrow3");//="image/arrow4.png";
	
}
function arrowclick()
{
	var img=document.getElementById("arrowimg");
	var s=img.src;
	if(s.indexOf("arrow2.png")!=-1)
	{
		img.src=s.replace("arrow2","arrow4");
		//将层隐藏到左边
		//得到总的层的宽度mainfloat
		var mainfloat=document.getElementById("mainfloat");
		var loginright=document.getElementById("loginright");
		
		var left=mainfloat.offsetLeft;
		var width=mainfloat.offsetWidth;
		var cwidth=loginright.offsetWidth;
		//alert(width+","+cleft);
		mainfloat.style.left=(-(left+width-cwidth))+"px";
		//mainfloat.style.left=-792;
	}
	else
	{
		img.src=s.replace("arrow4","arrow2");
		//将层还原到中间
		//得到总的层的宽度mainfloat
		var mainfloat=document.getElementById("mainfloat");
		//var loginright=document.getElementById("loginright");
		
		//var left=mainfloat.offsetLeft;
		//var width=mainfloat.offsetWidth;
		//var cwidth=loginright.offsetWidth;
		//alert(width+","+cleft);
		mainfloat.style.left=0+"px";

	}
	
}
function resizeimg(img)
{
	//alert(imgid);
	var div=document.getElementById("loginleft");
	var width=div.offsetWidth;
	//var imgid);
	img.width=width/10;

}
function resizehype(img)
{
	var div=document.getElementById("loginright");
	var h=div.offsetHeight;
	var w=div.offsetWidth;
	var t=div.offsetTop;
	var l=div.offsetLeft;

	img.style.top=t+(h-img.offsetHeight)/2;
	img.style.left=l+(w-img.offsetWidth)/2;
	//alert(t+","+h+","+img.offsetHeight);
	//alert(img.currentStyle.top);

}
function getHost(host)
{
	var reg=/http:\/\/[^\/]+\//;
	//var ref=window.location;
	//var l=ref.toString();
	host=host.match(reg);
	if(host==null)
		return null;
	else
		return host[0];

}
function navi2(add)
{
/*	
	var ref=window.location.href;
	l=getHost(ref.toString());
	if(l==null)
	{
		alert("地址错误");
		return;
	}	
	*/
	switch(add)
	{
//		case 1:  //旧版网站
		   	//window.location="zd/yanfachu_20090527/index.php?action=content&m=3566";			
//			window.open("http://www.coscoqmc.com.cn/index.php","_blank");
//		    break;
		case 1:  //学术讲座
		   	window.location="zd/yanfachu_20090527/index.php?action=content&m=3566";			
		    break;
		case 2:  //招生就业
			window.location="zd/xuegongchu_20090527/index.php?action=content&m=3632";
			//window.open("zd/xuegongchu_20090527/index.php?action=content&m=3632","_blank");
		    break;
//		case 8:  //网络服务
//			window.location="zd/xiandaijiaoyujishuzhongxin_20090527/index.php?action=content&c=1591";
			//window.open("zd/xuegongchu_20090527/index.php?action=content&m=3632","_blank");
//		    break;
		case 3:  //生活助手
			//document.location=l+"help.php";
			var w=window.screen.availWidth;
			var h=window.screen.availHeight;
			//alert(w+","+h);
			//window.open("help.php","_blank",'width='+w+',height='+h+',status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes');
			window.open("help.php","_blank");
		    break;
		case 4:  //学报
			window.location="zd/yanfachu_20090527/index.php?action=content&c=1142";
			//window.open("zd/yanfachu_20090527/index.php?action=content&c=1142","_blank");
		    break;
		case 5:  //视频船院
			window.location="zd/xuanchuanbu_20090619/index.php?action=content&m=3471";
			//window.open("zd/xuanchuanbu_20090619/index.php?action=content&m=3463","_blank");
		    break;
		case 6:  //海事新闻
			window.location="zd/tushuguan_20090527/index.php?action=content&m=3126";
			//window.open("zd/tushuguan_20090527/index.php?action=content&m=3126","_blank");
		    break;
		case 7:  //培训信息
			window.location="zd/peixunchu_20090527/index.php?action=content&c=1196";
			//window.open("zd/peixunchu_20090527/index.php?action=content&c=1196","_blank");
		    break;
		default:
			//window.location=l;
	}
}
function help2(id)
{
	switch(id)
	{
		case 1: //办公电话
		   
		   break;
		case 2: //天气预报
		   document.getElementById("panel").src="http://www.weather.com.cn/html/weather/101120201.shtml";
		   break;
		case 3: //航班时刻
		   document.getElementById("panel").src="http://www.qdairport.com/";
		   break;
		case 4: //长途客运
		   document.getElementById("panel").src="http://www.qdjyjt.com/ticket.aspx";
		   break;
		case 5: //列车时刻
		   document.getElementById("panel").src="http://vip.hiao.com/2009/04/lcsk/";
		   break;
		case 6: //日历
		   document.getElementById("panel").src="html/calendar.htm";
		   break;
		case 7: //词句翻译
		   document.getElementById("panel").src="http://fy.iciba.com/";
		   break;
		case 8: //地图
		   document.getElementById("panel").src="http://ditu.google.cn/";
		   break;
		case 9: //机票查询
		   document.getElementById("panel").src="http://www.qunar.com/";
		   break;
		default:

	}
}
function isInnerIP()
{
	if(!isset($innerip)||$innerip==false)
	{
		alert("此站点仅供内网用户访问！");
		return false;
	}
	return true;

}
function InnerResource(id)
{
	//alert(inner);
	switch(id)
	{
		case 1:  //教务系统
			if(inner==true) //内网可以访问
				window.open("http://172.20.15.202/PantoSchool","_blank");
			else
				window.location="zd/nawangxinxiliulan_20090617/index.php?action=content&c=1552";
			break;
		case 2:  //ftp
			if(inner==true) //内网可以访问
				window.open("ftp://191.168.200.1/","_blank");
			else
				window.location="zd/nawangxinxiliulan_20090617/index.php?action=content&c=1552";
			break;
		default:
			break;

	}


}
