/*邮箱登陆*/
function $(o){
 var o=document.getElementById(o)?document.getElementById(o):o;
 return o;
}

document.getElementsByClassName = function(className,oBox) {
 this.d= oBox || document;
 var children = this.d.getElementsByTagName('*') || document.all;
 var elements = new Array();
 for (var i = 0; i < children.length; i++) {
 var child = children[i];
 var classNames = child.className.split(' ');
 for (var j = 0; j < classNames.length; j++) {
 if (classNames[j] == className) {
 elements.push(child);
 break;
 }
 }
 }
 return elements;
}

$Cls = function (s,o){
return document.getElementsByClassName(s,o);
};

function ExCls(o,a,b){
 o.className=(o.className.indexOf(a)!=-1)?b:a;
}

function addCls(o,s){
 if (o.className.length>0) {
	 o.className+=" "+s;
 } else {
	 o.className=s;
 }
}

function delCls(o,s){
 o.className=o.className.replace(s,"");
  o.className=o.className.replaceAll("  ","");
}


function SetCookie(name,value){
     var argv=SetCookie.arguments;
     var argc=SetCookie.arguments.length;
     var expires=(2<argc)?argv[2]:null;
     var path=(3<argc)?argv[3]:null;
     var domain=(4<argc)?argv[4]:null;
     var secure=(5<argc)?argv[5]:false;
     document.cookie=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"");
} 
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));
	  SetCookie("My265Mail",i.MailBox.value,expdate,"/","265.com",false);
 }
 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["26500"]=new Array("https://edit.bjs.yahoo.com/config/login","login","passwd",".done,http://edit.bjs.yahoo.com/config/mail?.intl=cn; .intl,cn; .src,ym",".my265");
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 CP(input){
 input.Password.value="";
}

function _Void() { return; }
/*折叠*/
function showtab(i){
	switch(i){
		case 1:
		document.getElementById('tab1').className="show";
		document.getElementById('tab2').className="hide";
		break;
		case 2:
		document.getElementById('tab1').className="hide";
		document.getElementById('tab2').className="show";
		break;
	}
}
function showtab2(i){
	switch(i){
		case 3:
		document.getElementById('tab3').className="show";
		document.getElementById('tab4').className="hide";
		document.getElementById('tab5').className="hide";
		break;
		case 4:
		document.getElementById('tab3').className="hide";
		document.getElementById('tab4').className="show";
		document.getElementById('tab5').className="hide";
		break;
		case 5:
		document.getElementById('tab3').className="hide";
		document.getElementById('tab4').className="hide";
		document.getElementById('tab5').className="show";
		break;
	}
}