﻿function LTrim(s){for(var i=0;i<s.length;i++)if(s.charAt(i)!=' ')return s.substring(i,s.length);return ""}function RTrim(s){for(var i=s.length-1;i>=0;i--)if(s.charAt(i)!=' ')return s.substring(0,i+1);return ""}function Trim(s){return RTrim(LTrim(s))}function notice(s){alert(s);document.form1.keyword.focus();return false}function getsearchword1(){var _keyword=document.form1.keyword.value;_keyword=Trim(_keyword);var _kwArray=_keyword.split(" ");var _searchword="";var _sword="";for(var i=0;i<_kwArray.length;i++){if(Trim(_kwArray[i])!=""){if(i==0){_searchword=Trim(_kwArray[0])}else{_searchword=_searchword+" "+Trim(_kwArray[i])}}}document.form1.query.value=_searchword}function getsearchword(){var _keyword=document.form1.keyword.value;_keyword=Trim(_keyword);var _kwArray=_keyword.split(" ");var _searchword="";var _sword="";for(var i=0;i<_kwArray.length;i++){if(i==0){_searchword=Trim(_kwArray[0])}else{_searchword=_searchword+"*"+Trim(_kwArray[i])}}if(_searchword!=""){_searchword="SEARCHVALUE=$^~"+_searchword+"$^~"}document.form1.searchword.value=_searchword}function submitsearch(){var _keyword=Trim(document.form1.keyword.value);if(document.form1.channelid.value!="10000"){if(_keyword.length>0){if(_keyword.indexOf("+")>=0){return notice("检索词中不能含有关键字'+'")}else if(_keyword.indexOf("*")>=0){return notice("检索词中不能含有关键字'*'")}else if(_keyword.indexOf("-")>=0){return notice("检索词中不能含有关键字'-'")}}else{return notice("检索词不能为空")}if(document.form1.channelid.value=="3001"||document.form1.channelid.value=="3002"){document.form1.action="http://sousuo.gov.cn/topsortsearch"}else{document.form1.action="http://sousuo.gov.cn/search"}if(document.form1.channelid.value=="3006"){document.form1.prepage.value="8"}else{document.form1.prepage.value="10"}getsearchword()}else{if(_keyword.length==0){alert("检索词不能为空");return false}else if(_keyword=="+"||_keyword=="-"||_keyword=="*"){alert("检索词不能含有"+_keyword+"号");return false}else{getsearchword1();document.form1.action="http://sousuo.gov.cn:85/gw_lh/united/js/lh_outline.jsp";return true}}}
function PageDate(){currentDate=new Date();with(currentDate){day=getDay();month=getMonth()+1;this.document.write(getFullYear()+'年'+month+'月'+getDate()+'日')}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(' 星期六')}if(day==0){document.write(' 星期日')}document.write('<br>')}PageDate();
