var FrontNews_search01 = {
    /* 提交查询数据项验证 */
    check: function(compId,isFillKeyword,kw){
        var infoform = document.getElementById(compId + "_" + "form");
        var name_show = infoform.newsKeywordDisplay;
        //alert(isFillKeyword+",,"+kw +",,,"+name_show.value);
       if(isFillKeyword=='Y' && kw==name_show.value){
             alert(i18n_FrontNews_search01_inputkeyword);
             name_show.focus();
             return false;
          	}
        if(isFillKeyword=='Y'){
	        if(this.trim(name_show.value)=="" ||this.trim(name_show.value)==null ||this.trim(name_show.value)==kw){
	         	 alert(i18n_FrontNews_search01_inputkeyword);
	             name_show.focus();
	             return false;
	          	}
         	}
         if(isFillKeyword=="" && kw==name_show.value){
				name_show.value="";
          	}
        if (specialCharactersCheck(this.trim(name_show.value))) {
            /* 请您输入汉字、字母或数字！ */
            alert(i18n_FrontNews_search01_keywordspecsymbol+this.trim(name_show.value));
            name_show.focus();
            return false;
        }
        /* 查询关键词转码 */
        var after = encodeURIComponent(this.trim(name_show.value));
        infoform.newsKeyword.value = after;
        return true;
    },
	//检查非法字符
   // hasSpecSymbolforInfo: function(v){
       // return !/^[a-zA-Z0-9０-９\u4E00-\u9FA5“”‘’"" '' ，。、；！（）〔〕%％..%《》:：？\?]*$/.test(v);
    //},
    //去除空格
    trim: function(Str, Flag){
    
        Str = "" + Str;
        if (Flag == "l" || Flag == "L")/*trim left side only*/ {
            RegularExp = /^\s+/gi;
            return Str.replace(RegularExp, "");
        }
        else 
            if (Flag == "r" || Flag == "R")/*trim right side only*/ {
                RegularExp = /\s+$/gi;
                return Str.replace(RegularExp, "");
            }
            else/*defautly, trim both left and right side*/ {
                RegularExp = /^\s+|\s+$/gi;
                return Str.replace(RegularExp, "");
            }
    }
    
}

