<!--

function survote(theForm)
{
    if (theForm.ID.value == 0) return(false);

    for (var i=0; i<theForm.elements.length; i++)
    {
        var e = theForm.elements[i];
        if (e.name.substr(0, 5) == 'score' && e.checked == true) {
            score = e.value;
        }
    }
    href="survote.php?ID=" + theForm.ID.value + "&score=" + score;

    dlpopup(href, "survey");
}

function surview(theForm)
{
    if (theForm.ID.value == 0) return(false);

    href="surview.php?ID=" + theForm.ID.value;

    dlpopup(href, "survey");

}

function uform(theForm)
{
      if (empty(theForm.username.value))
      {
       alert("请输入用户姓名!!!");
       theForm.username.focus();
       return(false);
      }
      if ((theForm.password.value.length < 4) || (theForm.password.value.length > 20))
       {
          alert("请重新输入密码，密码的长度为4-20位任何字符!!!");
          theForm.password.focus();
          return(false);
       }
      theForm.submit();
}

function search() {

selectedindex = document.searchform.selected.selectedIndex;
selectedvalue = document.searchform.selected[selectedindex].value;
          key = document.searchform.keyword.value;

if(key == "") {
  alert("请输入关键词！");
  document.searchform.keyword.focus();
  return;
  }

if(selectedvalue == "yahoo") {
  parent.location="http://search.chinese.yahoo.com/search/gb?p="+key;
  }
if(selectedvalue == "sina") {
  parent.location="http://search.sina.com.cn/cgi-bin/search/search.cgi?_searchkey="+key;
  }

if(selectedvalue == "sohu") {
  parent.location="http://site.search.sohu.com/sitesearch.jsp?key_word="+key;
  }

if(selectedvalue == "163") {
  parent.location="http://www.yeah.net/cgi-bin/search.cgi?key="+key;
  }
}

function setdate(theForm) {
        getdatetime(theForm, "begin", 2);
        getdatetime(theForm, "end", 2);
}

function dlpopup(addr, name)
{
   window.open(addr, name, "toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,top=50,left=50,width=600,height=400");
}

function searchNewsSubmit(theForm) {
        if (!checkdate(theForm, "begin")) return(false);
        if (!checkdate(theForm, "end")) return(false);
        if (comparedate(theForm, "begin", "end" ,3) > 0) {
                alert("起始日期必须小于结束日期！");
                return(false);
        }

}

function trim(s)
{
    return s.replace(/(^\s*)|(\s*$)/g, "");
}

function empty(s)
{
   return s.match("^[ 　]{0,}$");

}
-->