function searchall()
{
  gosearch2(document.form1.thesite.value);
  return false;
}
function gosearch(site)
{
  document.form1.thesite.value=site;
  gosearch2(site);
}
function gosearch2(site)
{
 if(document.form1.key.value!="")
 {  
  r=Math.round(Math.random()*(document.form1.num.value))+1;
  wintitle=site+r;
  if(site=="baidu")
    window.open("http://www.baidu.com/baidu?tn=9hecn_pg&word="+document.form1.key.value,wintitle);
  if(site=="googlecn")
    window.open("http://www.google.cn/search?ie=GB2312&oe=GB2312&hl=zh-CN&lr=lang_zh-CN&q="+document.form1.key.value,wintitle);
  if(site=="chinasearch")
    window.open("http://page.zhongsou.com/p?k=&w="+document.form1.key.value,wintitle);
  if(site=="sina")
    window.open("http://www.iask.com/w?k="+document.form1.key.value,wintitle);
  if(site=="sohu")
    window.open("http://www.sogou.com/web?query="+document.form1.key.value,wintitle);
  if(site=="yahoo")
    window.open("http://www.yahoo.com.cn/search?p="+document.form1.key.value,wintitle);
  if(site=="baidumusic")
    window.open("http://mp3.baidu.com/wstsearch?rn=&tn=baidump3&ct=134217728&lm=0&word="+document.form1.key.value,wintitle);
  if(site=="baidunews")
    window.open("http://news.baidu.com/ns?content=新闻全文搜索&ct=0&ie=gb2312&cl=2&tn=site5566&rn=30&word="+document.form1.key.value,wintitle);
  if(site=="baidugc") 
    window.open("http://mp3search.baidu.com/wstsearch?tn=baidump3lyric&ct=150994944&lm=-1&rn=&word="+document.form1.key.value,wintitle);
  if(site=="baidutu")
    window.open("http://image.baidu.com/i?ct=201326592&cl=2&lm=-1&tn=baiduimage&word="+document.form1.key.value,wintitle);
  if(site=="baiduflash")
    window.open("http://mp3.baidu.com/m?f=ms&tn=baidump3&ct=134217728&lf=&rn=&word="+document.form1.key.value+"&lm=6",wintitle);
  if(site=="baidumap")
    window.open("http://map.baidu.com/m?word="+document.form1.key.value,wintitle); 
 }
}
function checkme(obj,site)
{
  var obj2=obj.previousSibling;
  obj2.checked=true;
  document.form1.thesite.value=site;
  gosearch2(site);
}
var curPane="Search";
var curNav="Search";
function NavPane(Pane)
{
if(curPane==Pane)
return;
document.getElementById("Pane"+curPane).className="t3";
switch(Pane)
{
case "Url":
document.getElementById("PaneUrl").className="t2";
break;
case "Common":
document.getElementById("PaneCommon").className="t2";
break;
case "Mail":
document.getElementById("PaneMail").className="t2";
break;
case "Search":
document.getElementById("PaneSearch").className="t2";
break;
}
curPane=Pane;
}

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<3){
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[3]=='suffix') strName+='@'+arrayInfo[4]
var strUrl='<form name="tmpForm" action="'+strProvider+'" method="post"><input type="hidden" name="'+strIdName+'" value="'+strName+'"><input type="hidden" name="'+varPassName+'" value="'+varPasswd+'">';   
if(arrayInfo[3]=='hidden') strUrl+='<input type="hidden" name="'+arrayInfo[4]+'" value="'+arrayInfo[5]+'">'
strUrl+='</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"><title>邮箱登录</title></head><body onload="document.tmpForm.submit()">');   
doc.write('<p align="center" style="font-size: 14px; color: #FF0000">欢迎使用☆杏树网☆电子邮局快速登录系统，请稍候......</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);
}

if(top.location != self.location)
{
top.location=self.location
}


