var timerid = null;
var timerRunning = false;
var left=10;
var top=10;
var stepx=1;
var stepy=1;

function jump(){
left=left+stepx;
top=top+stepy;
if(top>550) stepy=-1;
if(top<0) stepy=1;
if(left>830) stepx=-1;
if(left<0) stepx=1;
Layer1.style.left=left;
Layer1.style.top=top;
timeID=setTimeout("jump()",50);
}

function search4()
{
var wd=form1.key.value
if(form1.abc0.checked)
   window.open("http://search.sina.com.cn/cgi-bin/search/search.cgi?_searchkey="+form1.key.value,"mspg0");
if(form1.abc1.checked)
   window.open("http://site.search.sohu.com/sitesearch.jsp?page_index=0&key_word="+form1.key.value,"mspg1");
if(form1.abc2.checked)
   window.open("http://cn.search.yahoo.com/search/cn?p="+form1.key.value,"mspg2");
if(form1.abc3.checked)
   window.open("http://nisearch.163.com/Search?q="+form1.key.value,"mspg3");

if(form1.abc6.checked)
   window.open("http://www.google.com/search?q="+form1.key.value+"&ie=gb2312&hl=zh-CN&lr=,mspg6");
if(form1.abc7.checked)
   window.open("http://www1.baidu.com/baidu?tn=baidu&word="+form1.key.value,"mspg7");
return false;   
}

function register(){
 var isValid=checkun(document.logoform.username)&&checkpw(document.logoform.passwd)
 if(isValid){
 MM_goToURL('parent','register/zuce.asp');return document.MM_returnValue
 return true
 }
 return false
 }

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}


function sm(){
var sm=null;
sm=window.open("notice.htm","sm","width=450,height=600,resizable=0");
}

function stopclock (){
	if(timerRunning)
	clearTimeout(timeid);
	timerRunning = false;
}

function startclock () {
	stopclock();
	showtime();
}
function showtime() {
    var today1 = new Date()
    var hour = today1.getHours()
    var minute = today1.getMinutes()
    var second=today1.getSeconds()
    timeValue = ((hour<10)?"  ":" ")+hour
	timeValue += ((minute < 10) ? ":0" : ":") + minute
	timeValue += ((second < 10) ? ":0" : ":") + second
	document.clock.thetime.value = timeValue;
    timerid = setTimeout("showtime()",1000);
	timerRunning = true;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function isNotEmpty(fieldName,warnMsg){
    var inputStr=fieldName.value;
    if(inputStr!=null && inputStr!=""){
          return true
    }
    alert(warnMsg)
    fieldName.focus()
    fieldName.select()
    return false
 }
 
 function isInteger(fieldName,warnMsg){
    var inputStr=(fieldName.value).toString();
    for(var i=0;i<inputStr.length;i++){
        var oneChar=inputStr.charAt(i)
        if(i==0 && oneChar=="-"){
           continue
        }
        if(oneChar<"0"||oneChar>"9"){
           alert(warnMsg)
           fieldName.value=fieldName.defaultValue
           fieldName.focus()
           fieldName.select()
           return false
        }
    }
    return true
 }
 function isInRange(fieldName,lowBond,highBond,warnMsg){
    var inputStr=fieldName.value
    var num=parseInt(inputStr)
    if(num<lowBond||num>highBond){
        alert(warnMsg)
        fieldName.value=fieldName.defaultValue
        fieldName.focus()
        fieldName.select()
        return false
    }
    return true
 }
function hasStr(fieldName,patternStr,warnMsg){
    var inputStr=fieldName.value
    if(inputStr.indexOf(patternStr)==-1){
         alert(warnMsg)
         fieldName.focus()
         fieldName.select()
         return false 
    }
    return true
 }
function isInLength(fieldName,minLength,maxLength,warnMsg){
    var inputStr=fieldName.value
    if(inputStr.length>maxLength||inputStr.length<minLength){
         alert(warnMsg)
         fieldName.value=fieldName.defaultValue
         fieldName.focus()
         fieldName.select()
         return false
    }
    return true
 }
function checkEmail(fieldName){
     
    if(hasStr(fieldName,"@","请输入一个有效的email地址。")!=true){
         fieldName.focus()
         fieldName.select()
        return false
    }
    if(hasStr(fieldName,".","请输入一个有效的email地址。")!=true){
         fieldName.focus()
         fieldName.select()
        return false
    }
    var emailstr=fieldName.value
    if(emailstr.indexOf("dfg")!=-1){
    	   alert("请输入一个有效的email地址。")    	   
         fieldName.focus()
         fieldName.select()
        return false
    }
    return true
 }
 
function checkaddress(fieldName){
    var str=fieldName.value     
    if(str.indexOf("groups.google.com")!=-1){
    	   alert("请输入一个有效的地址。")
         fieldName.focus()
         fieldName.select()
        return false
    }
    return true
 }
 
function checkeEmail(fieldName){
     
    if(hasStr(fieldName,"@","Please input a valid email address.")!=true){
         fieldName.focus()
         fieldName.select()
        return false
    }
    if(hasStr(fieldName,".","Please input a valid email address.")!=true){
         fieldName.focus()
         fieldName.select()
        return false
    }
    var emailstr=fieldName.value
    if(emailstr.indexOf("dfg")!=-1){
    	   alert("Please input a valid email.")    	   
         fieldName.focus()
         fieldName.select()
        return false
    }
    return true
 }

function checkTheme(fieldName){
 if(isNotEmpty(fieldName,"主题不能空，请正确填写。")!=true){
         fieldName.focus()
         fieldName.select()
         return false
  }
  return true
 }

function checkName(fieldName){
 if(isNotEmpty(fieldName,"姓名栏不能空，请正确填写。")!=true){
         fieldName.focus()
         fieldName.select()
         return false
  }
  return true
 }
 
 function checkeName(fieldName){
 if(isNotEmpty(fieldName,"Please enter your full name.")!=true){
         fieldName.focus()
         fieldName.select()
         return false
  }
  return true
 }

function checkPostcode(fieldName){
 if(isNotEmpty(fieldName,"邮编不能空，请正确填写。")!=true){
         fieldName.focus()
         fieldName.select()
         return false
  }
  if(isInteger(fieldName,"请正确填写邮政编码。")!=true){
         fieldName.focus()
         fieldName.select()
        return false
  } 
  if(isInLength(fieldName,6,6,"请正确填写邮政编码。")!=true){
         fieldName.focus()
         fieldName.select()
        return false
  }
  return true
}
function checktelzip(fieldName){
 if(isNotEmpty(fieldName,"区号不能空，请正确填写。")!=true){
         fieldName.focus()
         fieldName.select()
         return false
  }
if(isInteger(fieldName,"请输入正确的区号。")!=true){
         fieldName.focus()
         fieldName.select()
        return false 
  }
 if(hasStr(fieldName,"0","请输入正确的区号。")!=true){
         fieldName.focus()
         fieldName.select()
       return false  
  }
    return true
}
function checkzip(fieldName){
if(isInteger(fieldName,"请输入正确的区号。")!=true){
         fieldName.focus()
         fieldName.select()
        return false 
  }
 if(hasStr(fieldName,"0","请输入正确的区号。")!=true){
         fieldName.focus()
         fieldName.select()
       return false  
  }
    return true
}
function checkTel(fieldName){
 if(isNotEmpty(fieldName,"电话栏不能空，请正确填写。")!=true){
         fieldName.focus()
         fieldName.select()
         return false
  }
 if(isInteger(fieldName,"请正确填写电话号码。")!=true){
         fieldName.focus()
         fieldName.select()
      return false
  }
 if(isInLength(fieldName,6,8,"请正确填写电话号码。")!=true){
         fieldName.focus()
         fieldName.select()
     return false
  } 
  return true
 
}

function checkeTel(fieldName){
 if(isNotEmpty(fieldName,"Please enter your telephone.")!=true){
         fieldName.focus()
         fieldName.select()
         return false
  }
 if(isInteger(fieldName,"Please enter a valid telephone.")!=true){
         fieldName.focus()
         fieldName.select()
      return false
  }
 if(isInLength(fieldName,6,8,"Please enter a valid telephone.")!=true){
         fieldName.focus()
         fieldName.select()
     return false
  } 
  return true
 
}

function checkForm(fieldName){
 var form=document.infoform1
 var isValid=checkName(form.Name)&&checkTel(form.Telephone)&&checktelzip(form.Telezone)&&checkaddress(form.Address)
  return isValid 
}

function checkeForm(fieldName){
 var form=document.infoform1
 var isValid=checkeName(form.Name)&&checkeTel(form.Telephone)
  return isValid 
}

function checkChatForm(chatform){
 var form=chatform
 var isValid=checkTheme(form.theme)
  return isValid 
}

function checkForm02(fieldName){
 var form=document.chatform1
 var isValid=checkName(form.newuser)&&checkName(form.newtheme)
  return isValid 
}

function checkForm3(fieldName){
 var form=document.sear
 var isValid=checksearch(form.cont)
  return isValid 
}

function checksearch(fieldName){
 if(isNotEmpty(fieldName,"搜索框不能空，请正确填写。")!=true){
         fieldName.focus()
         fieldName.select()
         return false
  }
  return true
 }

function checkun(fieldName){
 if(isNotEmpty(fieldName,"用户名不能空，请正确填写。")!=true){
         fieldName.focus()
         fieldName.select()
         return false
  }
     return true
 }
 
 function checkpw(fieldName){
 if(isNotEmpty(fieldName,"密码不能空，请正确填写。")!=true){
         fieldName.focus()
         fieldName.select()
         return false
  }
  if(isInLength(fieldName,4,16,"密码只能填4-16位。")!=true){
         fieldName.focus()
         fieldName.select()
     return false
  } 
    return true
 }
 
function comparepw(){
 if(document.registerform.pw01.value!=document.registerform.pw02.value){
 alert("密码输入不对，请重新填写。")
 document.registerform.pw01.value=""
 document.registerform.pw02.value=""
     return false
  } 
    return true
 } 
 
 function checkmail(fieldName){
    if(isNotEmpty(fieldName,"Email不能空，请正确填写。")!=true){
         fieldName.focus()
         fieldName.select()
         return false
  } 
    if(hasStr(fieldName,"@","请输入一个合法的email地址。")!=true){
         fieldName.focus()
         fieldName.select()
        return false
    }
    if(hasStr(fieldName,".","请输入一个合法的email地址。")!=true){
         fieldName.focus()
         fieldName.select()
        return false
    }
    return true
 }
 
 function checkregisterform(form){
 var isValid=checkun(form.username00)&&checkpw(form.pw01)&&comparepw()&&checkName(form.truename)&&checkmail(form.mail)&&checkTel(form.telephone)&&checktelzip(form.Telezone)&&checkPostcode(form.postcode)
   return isValid 
}

 function checklogoform(form){
 var isValid=checkun(form.username)&&checkpw(form.passwd)
   return isValid 
}

function checkpwform(form){
 var isValid=checkmail(form.email)
   return isValid 
}

function number(index1){
if (index1){
document.write(index1)
}
}
function showdate() {
var today1 = new Date()
var year=today1.getFullYear()
var month = today1.getMonth()+1
var date = today1.getDate()
var day = today1.getDay()
document.write("<small><font style='font-family:新宋体;font-size:13px;color:#ff0000'>")
number(year)
document.write("年")
number(month)
document.write("月")
number(date)
document.write("日</font></small>&nbsp;")
document.write("<small><font style='font-family:新宋体;font-size:13px;color:#ff0000'>")
if (day == 0) document.write("星期日")
if (day == 1) document.write("星期一")
if (day == 2) document.write("星期二")
if (day == 3) document.write("星期三")
if (day == 4) document.write("星期四") 
if (day == 5) document.write("星期五")
if (day == 6) document.write("星期六")
document.write("</font></small>")
}