   function CmbSearch(sSearchWord,sfromweb)
    {
           if (sSearchWord == '' ||sSearchWord==null || sSearchWord.trim()==""  )
           {
        	   alert("关键词不能为空");
        	   return false
           }
           else if(sSearchWord.length>50)
           {
       		alert("您输入的检索词超过最大长度50！");
       		return false;
       	   }
          else
          {
               var searchwordwhere=sSearchWord.trim().trssearch().replaceteshustr();
               if(searchwordwhere=="" || searchwordwhere==null)
        	{
        	     alert("抱歉，您输入的内容不在查询范围内！");
        		return false;
        	}
                else if(null != sfromweb && "" != sfromweb)
                {
                window.open('http://search.cmbchina.com/cmb/jsp/portalsearch/doclist_of_search.jsp?fromweb=' + sfromweb + '&SearchWord='+ encodeURI(searchwordwhere));
                }
                else
                {
        	      window.open('http://search.cmbchina.com/cmb/jsp/portalsearch/doclist_of_search.jsp?SearchWord='+ encodeURI(searchwordwhere));
                }
        	   
           }          
     
 }
    
    
 String.prototype.trim = function()
{
    return this.replace(/(^[\s]*)|([\s]*$)/g, "");
}
String.prototype.trssearch = function()
{
    return this.replace(/\s+/g, "+");
}

String.prototype.replaceteshustr = function()
{
    return this.replace(/[@#\$%\^&\*!~'(（\-\/%.。，,?+]+/g, "");
}

