//点击按钮 交换图片
function switchCell(n) {
	nc=document.getElementsByName("panelcell"); 
	cg=document.getElementsByName("tabtable"); 
	if(nc){
		for(i=0;i<nc.length;i++){
			nc.item(i).className="PanelOffStyle";
			cg.item(i).style.display = "none";
		}
		nc.item(n-1).className="PanelOnStyle";
		cg.item(n-1).style.display = "inline";
	}
}
function switchCell1(n) {
	nc=document.getElementsByName("panelcell1"); 
	cg=document.getElementsByName("tabtable1"); 
	if(nc){
		for(i=0;i<nc.length;i++){
			nc.item(i).className="PanelOffStyle";
			cg.item(i).style.display = "none";
		}
		nc.item(n-1).className="PanelOnStyle";
		cg.item(n-1).style.display = "inline";
	}
}
function switchCell2(n) {
	nc=document.getElementsByName("panelcell2"); 
	cg=document.getElementsByName("tabtable2"); 
	if(nc){
		for(i=0;i<nc.length;i++){
			nc.item(i).className="PanelOffStyle";
			cg.item(i).style.display = "none";
		}
		nc.item(n-1).className="PanelOnStyle";
		cg.item(n-1).style.display = "inline";
	}
}


function $(o){
 var o=document.getElementById(o)?document.getElementById(o):o;
 return o;
}
function check(i){
 if(i.MailBox.options.selectedIndex==0){
	 alert("提示：请正确选择你使用的邮箱");
	 return false;
 } else {
	  var expdate=new Date();
	  expdate.setTime(expdate.getTime()+(24*60*60*1000*30));
	 
 }
 if(i.Username.value=="" || i.Username.value=="请在此输入您的用户名"){
	 alert("提示：邮箱用户名必须填写！");
	 i.Username.focus();
	 return false;
 }
 if(i.Password.value=="" || i.Password.value.length<3){
	 alert("提示：邮箱密码必须填写完整！");
	 i.Password.focus();
	 return false;
 }
var MailList = new Array(); 

MailList["26501"]=new Array("http://reg.163.com/in.jsp?url=http://fm163.163.com/coremail/fcg/ntesdoor2?language=0&style=1","username","password");
MailList["26502"]=new Array("http://vip.163.com/logon.m","username","password","enterVip,true; style,");
MailList["26503"]=new Array("http://entry.126.com/cgi/login","user","pass","domain,126.com; language,0; bCookie,");
MailList["26504"]=new Array("http://mail.sina.com.cn/cgi-bin/login.cgi","u","psw","logintype,uid; product,mail");
MailList["26505"]=new Array("http://vip.sina.com.cn/cgi-bin/login.cgi","user","pass");
MailList["26506"]=new Array("http://passport.sohu.com/login.jsp","loginid","passwd","fl,1; vr,1|1; appid,1000; ru,http://login.mail.sohu.com/servlet/LoginServlet; eru,http://login.mail.sohu.com/login.jsp; ct,1173080990; sg,5082635c77272088ae7241ccdf7cf062","@sohu.com");
MailList["26507"]=new Array("http://passport.sohu.com/login.jsp","loginid","passwd","fl,1; vr,1|1; appid,1013; ru,http://vip.sohu.com/login/viplogin11.jsp; eru,; ct,1173857434; sg,885ebb7884194ee547f224fc8a6a5877","@vip.sohu.com");
MailList["26508"]=new Array("http://passport.21cn.com/maillogin.jsp","LoginName","passwd","NeedMoreSecurity,on; NeedIpCheck,on");
MailList["26509"]=new Array("http://g2wm.263.net/xmweb","usr","pass","domain,263.net; func,login");
MailList["26510"]=new Array("http://bjweb.163.net/cgi/163/login_pro.cgi","user","pass","type,0; style,10");
MailList["26511"]=new Array("http://mail.china.com//coremail/fcg/login","user","pass");
MailList["26512"]=new Array("http://reg.mail.188.com/servlet/coremail/login","user","pass","domain,188.com; language,0; style,-1");
MailList["26513"]=new Array("http://edit.bjs.yahoo.com/config/login","login","passwd",".intl,cn; .done,http://mail.yahoo.com");
MailList["26515"]=new Array("https://www.google.com/accounts/ServiceLoginAuth","Email","Passwd","continue,http://mail.google.com/mail?zy=l; service,mail; hl,zh-CN");
var iMail = i.MailBox.value;
var UserName = $("Username").value;
if (MailList[iMail] != null) {
    var cMail = MailList[iMail];
    i.action = cMail[0];
    $("Username").name = cMail[1];
    $("Password").name = cMail[2];
    if (cMail[3] != null) {
    	var aPairs = cMail[3].split("; ");
    	for (var j=0; j< aPairs.length; j++) {
    		var aPair = aPairs[j].split(",");
    		var el = document.createElement("INPUT");
    		el.type="hidden";
    		el.name=aPair[0];
    		el.value=aPair[1];
    		$("MailCheck").appendChild(el);
    	}
    }
    if (cMail[4] != null)
        $("Username").value = UserName + cMail[4];
} else {
 alert("请选择正确的邮箱！");
}
i.submit();
$("Username").value = UserName;
$("Password").value = "";
}


function setHomePage(obj){
var url='http://www.zhaojiaoyu.cn';
try{
obj.style.behavior='url(#default#homepage)';obj.setHomePage(url);

}
catch(e){
if(window.netscape){
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}catch (e){alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'");
}
var prefs=Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',url);
}
}
};


function setFavorite(){
var url='http://xsc.yrcti.edu.cn/';var title='黄河水利职业技术学院·学生工作部，资助中心';
try{
window.external.addFavorite(url,title);
}
catch(e){
try{
window.sidebar.addPanel('黄河水利职业技术学院·学生工作部，资助中心', url,title);
}
catch (e){
alert("加入收藏失败，请使用Ctrl+D进行添加");
}
}
}


function show(a) 
{ 
document.all.x.style.display="";
  document.all.x.style.left = event.clientX-150;
  document.all.x.style.top = event.clientY-40;
  document.all.x.innerHTML=a.slt;
 } 
function hidden() 
{
  document.all.x.innerHTML="";
  document.all.x.style.display="none";
} 
 
function showw() 
{ 
  document.all.weather.style.display="";
  document.all.weather.style.left = event.clientX-200;
  document.all.weather.style.top = event.clientY-10; 
 } 
function hiddenw() 
{
  document.all.weather.style.display="none";
} 