function check(input){
if(input.mailSelect.options.selectedIndex==0){
alert("提示：请正确选择你使用的邮箱");
return false;}
if(input.name.value==""){
alert("提示：邮箱用户名必须填写！");
input.name.focus();
return false;}
if(input.password.value=="" || input.password.value.length<1){
alert("提示：邮箱密码必须填写完整！");
input.password.focus();
return false;}
else{go();
return false;}}

function makeURL(){   
var objForm=document.mailForm;   
var intIndex=objForm.mailSelect.options.selectedIndex;   
var varInfo=objForm.mailSelect.options[intIndex].value;    /*获取的表单中邮件服务器及用户账号和密码信息*/   
var arrayInfo=varInfo.split(';');    /*将以上获取的信息进行分割，并赋给数组变量*/   
var strName=objForm.name.value,varPasswd=objForm.password.value;   
var length=arrayInfo.length,strProvider=arrayInfo[0],strIdName=arrayInfo[1],varPassName=arrayInfo[2];   
if(length==3){   
var strUrl=strProvider+'?'+strIdName+'='+strName+'&'+varPassName+'='+varPasswd;    /*合并字符串，得到形如“http://mail.sina.com.cn/cgi-bin/log...”的字符串型URL*/   
}
else{
if(arrayInfo[4]&&arrayInfo[3]=='suffix') strName+='@'+arrayInfo[4]
var strUrl='<form name="tmpForm" action="'+strProvider+'" method="post">';
if(arrayInfo[3]=='hidden') strUrl+='<input type="hidden" name="'+arrayInfo[4]+'" value="'+arrayInfo[5]+'">'
if(arrayInfo[4]=='hidden') strUrl+='<input type="hidden" name="'+arrayInfo[5]+'" value="'+arrayInfo[6]+'">'
if(arrayInfo[4]=='func') strUrl+='<input type="hidden" name="func" value="'+arrayInfo[5]+'">';
if(arrayInfo[5]=='args'){
	var hohoPreAdd=arrayInfo[6].split('|');
	strUrl+='<input type="hidden" name="'+hohoPreAdd[0]+'" value="'+hohoPreAdd[1]+'">';
	//alert(strUrl);  hoho:这里其实应该可以增加循环,用于多参数下.暂是无必要.
}
strUrl+='<input type="hidden" name="'+strIdName+'" value="'+strName+'"><input type="hidden" name="'+varPassName+'" value="'+varPasswd+'"></form>';   
}
return strUrl; 
}


function go(){   
var strLocation=makeURL();   
if(strLocation.indexOf('<form name="tmpForm"')!=-1){/*对于只能用“post”来获取表单数据的邮箱使用自动提交的临时表单*/   
outWin=window.open('','','scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes');   
doc=outWin.document;   
doc.open('text/html');   
doc.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="refresh" content="1;URL="><title>东宝区公众信息网(http://www.jmdbq.gov.cn)电子邮局快速登录系统</title></head><body onload="document.tmpForm.submit()">');   
doc.write('<p align="center" style="font-size: 20px; color: #FF0000">『<a href="http://www.jmdbq.gov.cn" target="_blank"><strong><font color="#0000FF">东宝区公众信息网 http://www.jmdbq.gov.cn</font></strong></a>』电子邮局快速登录系统，请稍候......</p>'+strLocation+'</body></html>');   
doc.close();   
}
else window.open(strLocation,'','scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes');   
}
function ClearPass(){
document.mailForm.password.value="";
}
function News_Window(theURL,winName,features) {
window.open(theURL,winName,features);
}
rnd.today=new Date(); 
rnd.seed=rnd.today.getTime(); 
function rnd() { 
        rnd.seed = (rnd.seed*9301+49297) % 233280; 
        return rnd.seed/(233280.0); 
}
function rand(number) { 
        return Math.ceil(rnd()*number); 
}
function GetCookie (name) { 
var arg = name + "="; 
var alen = arg.length; 
var clen = document.cookie.length; 
var i = 0; 
while (i < clen) { 
var j = i + alen; 
if (document.cookie.substring(i, j) == arg) 
return getCookieVal (j); 
i = document.cookie.indexOf(" ", i) + 1; 
if (i == 0) break; 
} 
return null;
}
function SetCookie (name, value) { 
var argv = SetCookie.arguments; 
var argc = SetCookie.arguments.length; 
var expires = (argc > 2) ? argv[2] : null; 
var path = (argc > 3) ? argv[3] : null; 
var domain = (argc > 4) ? argv[4] : null; 
var secure = (argc > 5) ? argv[5] : false; 
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
"; path=/" +
((domain == null) ? "" : ("; domain=" + domain)) + 
((secure == true) ? "; secure" : "");
}
function getCookieVal(offset ) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function chkinput(f){
var tmp = f.name.value;
if(!tmp) {
alert("请填写您要查询的内容!");
return false;}
var tmp2 = f.tiaojian.value;
if(!tmp2) {
alert("请选择您要查询的条件!");
return false;}
return true;}
function chkinput2(f){
var tmp = f.user.value;
if(!tmp) {
alert("帐号不能为空!");
return false;}
var tmp2 = f.pass.value;
if(!tmp2) {
alert("密码不能为空!");
return false;}
var tmp3 = f.site.value;
if(!tmp3) {
alert("您没有选择信箱!");
return false;}
return true;}
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}
function clearpass(){
 document.loginmail.pass.value="";
}
function amt(){
  var count = GetCookie('addhaozsfav');
  if(count == null) {
    var exp = new Date();
    exp.setTime(exp.getTime() + (1*24*60*60*1000));
    SetCookie('addhaozsfav','newfav',exp,null,'haozs.com');
    return 1;
  } else {
    return 0;
  }
}
function ihp(){
  var ishome = GetCookie('ishaozshome');
  if (ishome == null) {
    var ishomeExp = new Date();
    ishomeExp.setTime(ishomeExp.getTime() + (1*24*60*60*1000));
    SetCookie('ishaozshome','newhome',ishomeExp);
    return 1;
  } else {
    return 0;
  }
}
function tbwin(){
  var ishome = GetCookie('tbwin');
  if (ishome == null) {
    var ishomeExp = new Date();
    ishomeExp.setTime(ishomeExp.getTime() + (1*60*60*1000));
    SetCookie('tbwin','popuped',ishomeExp);
    return 1;
  } else {
    return 0;
  }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

