if (top.location !== self.location) top.location=self.location;
//
function changekey(i){
   var gk=event.keyCode;
   if(i==1){
      if((gk==13)&&(document.loginform.userName.value!="")){
          event.keyCode=9;
	  }
      return;
   }
   else if(i==2){
      if((gk==13)&&(document.loginform.userPassword.value!="")){
          checklogin();
	  }
	  return;
   }
   else if(i==3){
      if((gk==13)&&(document.searchform.keywords.value!=="")){
				searchsend();
	  }
	  return;
   }
   else{
	  return;
   }
}
function reset(){
       location="/login.jsp";
}
//提交登录表
function checklogin(){
   if(document.loginform.userName.value==""){
       alert("请输入您的用户账号！");
       document.loginform.userName.focus();
       return false;
   }
   if(document.loginform.userPassword.value==""){
       alert("请输入您的登录密码！");
       document.loginform.userPassword.focus();
       return false;
   }
   document.loginform.submit();
   return true;
}
//提交查询表
function searchsend(){
   var keywords=trim(document.searchform.keywords.value);
   if(keywords==""){
	   alert("请输入关键字！");
       document.searchform.keywords.focus();
	   return false;
   }
   document.searchform.keywords.value=keywords;
   document.searchform.submit();
   return true;
}
//提交投票表
function votesend(){
   document.voteform.submit();
   return true;
}
