function LTrim(s) { for(var i=0;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.topsearch.keyword.focus(); return false; } function getsearchword() { var _keyword = document.topsearch.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 != "") { document.topsearch.searchword.value=_searchword; } else { return notice("搜索词不能为空"); } } function srh(){ if (document.searchshenpi.apply_id.value == "" ||document.searchshenpi.apply_id.value=="请输入查询号") { alert("请输入申报号!"); document.searchshenpi.apply_id.focus(); return false; } else{ document.searchshenpi.submit(); } } function submitsearch() { if (document.topsearch.channelid.value=="75002"){ document.topsearch.action="http://202.101.105.176/czjs/transearchword.jsp"; //document.topsearch.action="http://202.101.105.176/search/bmsearch.jsp?channelid=75002"; } if (document.topsearch.channelid.value=="75448"){ // document.topsearch.action="http://202.101.105.176/czjs/transearchword_zfwj.jsp"; document.topsearch.action="http://202.101.105.176/search/zfwjjs_govfilegailan.jsp?channelid=75448"; } if (document.topsearch.channelid.value=="75449"){ //document.topsearch.action="http://202.101.105.176/czjs/transearchword_flfg.jsp"; document.topsearch.action="http://202.101.105.176/search/flfg_gl.jsp?channelid=75449"; } if (document.topsearch.channelid.value=="75192"){ document.topsearch.action="http://202.101.105.176/search/search.jsp?channelid=75192"; } var _keyword = Trim(document.topsearch.keyword.value); 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("搜索词不能为空"); } getsearchword(); } function onChangeSel(obj) { var val = $(obj).find("option:selected").val(); var href= ''; if(val=='75192' || val=='75002' || val=='75448' || val=='75449'){ href = "http://202.101.105.176/search/index_adv.jsp?channelid="+val; } $("#advsearch").attr('href', href); } function submitKey() { if ( window.event.keyCode==13 ) preSubmit(); } function preSubmit(){ if(document.login_form.username==""){ alert("请输入用户名!"); return false; } if(document.login_form.password==""){ alert("请输入密码!"); return false; } return true; } function chkForm(){ var strpro=document.searchwsbs.property.value; var strsearchword=document.searchwsbs.searchword1.value; if(strpro=="") { document.searchwsbs.searchword.value=strsearchword; return true ; }else { if(strsearchword=="") { document.searchwsbs.searchword.value="类别="+strpro+""; } else { document.searchwsbs.searchword.value=strsearchword+" and 类别="+strpro+""; } return true; } } function chkForm2(){ var strdep=document.searchbgxz.department.value; var strsearchword=document.searchbgxz.searchword1.value; if((strdep=="")&&(strsearchword=="")) { alert("请选择部门或输入查询关键词!"); document.searchbgxz.searchword1.focus(); return(false); } if((strdep=="")&&(strsearchword!="")) { document.searchbgxz.searchword.value=strsearchword; return(true); } if((strdep!="")&&(strsearchword=="")) { document.searchbgxz.searchword.value="docchannel="+strdep; return(true); } if((strdep!="")&&(strsearchword!="")) { document.searchbgxz.searchword.value=strsearchword+" and docchannel="+strdep; return(true); } }