var FrontProducts_generalSearch01={patternDate:/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/,patternCurrency:/^\d{1,8}(\.\d{0,2})?$/,compId:"",mustInputKeyword:"false",inputkeyword:"",keyover:function(a,b){if(jQuery("#"+a+"_keyword").val()==b){jQuery("#"+a+"_keyword").val("");jQuery("#"+a+"_keyword").focus()}},keyout:function(a,b){if(this.trim(jQuery("#"+a+"_keyword").val())==""){jQuery("#"+a+"_keyword").val(b);jQuery("#"+a+"_keyword").addClass("input-keyword")}else{jQuery("#"+a+"_keyword").val(this.trim(jQuery("#"+a+"_keyword").val()));jQuery("#"+a+"_keyword").removeClass("input-keyword")}},trim:function(b,c){b=""+b;if(c=="l"||c=="L"){RegularExp=/^\s+/gi;return b.replace(RegularExp,"")}else{if(c=="r"||c=="R"){RegularExp=/\s+$/gi;return b.replace(RegularExp,"")}else{RegularExp=/^\s+|\s+$/gi;var a=b.replace(RegularExp,"");return a}}},validateForm:function(k,c,g){this.compId=k;this.mustInputKeyword=c;this.inputkeyword=g;if(this.checkKeywords()==false){return false}var j=jQuery("#"+this.compId+"_beginValue").val();var i=jQuery("#"+this.compId+"_endValue").val();var d=jQuery("#"+this.compId+"_propertyId").val();var b=jQuery("#"+this.compId+"_propertyType").val();var a=jQuery("#"+this.compId+"_areaType").val();var f=this.trim(jQuery("#"+this.compId+"_keyword").val());jQuery("#"+this.compId+"_keyword").val(f);if(f==this.inputkeyword){jQuery("#"+this.compId+"_keyword").val("")}var h="1";if(d!=null&&d!=""){if(b=="3"){h="3"}else{h="2"}}jQuery("#"+this.compId+"_searchType").val(h);if(a!=""){if(a=="BigDecimal"){if(this.checkNumber()==false){return false}}else{if(a=="Date"){if(this.isCheckAreaDate()==false){return false}}}}var e=jQuery("#"+this.compId+"_keyword").serialize();jQuery.ajax({type:"POST",url:"/FrontProducts.do?method=keywordStat",data:e,dataType:"text",cache:false,success:function(l){}});return true},checkKeywords:function(){if(this.mustInputKeyword=="true"){if(this.trim(jQuery("#"+this.compId+"_keyword").val())==this.inputkeyword||this.trim(jQuery("#"+this.compId+"_keyword").val())==""){alert(this.inputkeyword);jQuery("#"+this.compId+"_keyword").val("");jQuery("#"+this.compId+"_keyword").focus();return false}}return true},checkNumber:function(){if(jQuery("#"+this.compId+"_beginValue").val()&&!this.patternCurrency.test(jQuery("#"+this.compId+"_beginValue").val())){alert(i18n_products_error_beginValue);jQuery("#"+this.compId+"_beginValue").focus();return false}if(jQuery("#"+this.compId+"_endValue").val()&&!this.patternCurrency.test(jQuery("#"+this.compId+"_endValue").val())){alert(i18n_products_error_endValue);jQuery("#"+this.compId+"_endValue").focus();return false}if(jQuery("#"+this.compId+"_beginValue").val()&&jQuery("#"+this.compId+"_endValue").val()&&(parseInt(jQuery("#"+this.compId+"_beginValue").val())>parseInt(jQuery("#"+this.compId+"_endValue").val()))){alert(i18n_products_mustaboveprice);jQuery("#"+this.compId+"_endValue").focus();return false}return true},queryadvance:function(a,b){if(b=="_self"){location.href=/publicScripts/components/a}else{window.open(a)}},changecategory:function(b,d,c,a){jQuery.getJSON("/FrontProducts.do?method=doGetTemplatePropertiesByCategoryId",{pmcId:c},function(g){if(g){var f="";_getElementById(b,d,"template").innerHTML=f}})},isCheckAreaDate:function(){if(jQuery("#"+this.compId+"_beginValue").val()&&!this.patternDate.test(jQuery("#"+this.compId+"_beginValue").val())){alert(i18n_products_inputcorrectdate);jQuery("#"+this.compId+"_beginValue").focus();return false}if(jQuery("#"+this.compId+"_endValue").val()&&!this.patternDate.test(jQuery("#"+this.compId+"_endValue").val())){alert(i18n_products_inputcorrectdate);jQuery("#"+this.compId+"_endValue").focus();return false}if(jQuery("#"+this.compId+"_beginValue").val()&&jQuery("#"+this.compId+"_endValue").val()&&(jQuery("#"+this.compId+"_beginValue").val()>jQuery("#"+this.compId+"_endValue").val())){alert(i18n_products_mustlessenddate);jQuery("#"+this.compId+"_endValue").focus();return false}return true}};var FrontNews_detail01={fontSize:-1,notAllowed:function(){alert(i18n_FrontNews_detail01_norightfordownload);return false},changeLinkHref:function(a,e,d,b){var c=FrontNews_detail01.getCookie("c_memberInfo");if(a==null||a==""){$(b).click(FrontNews_detail01.notAllowed)}else{if(a=="0"||(a.indexOf("0")==0)){$(b).attr("href",e)}else{if(!c){$(b).attr("href",d);$(b).attr("target","_blank")}else{if(a=="1"){$(b).attr("href",e)}else{if(a.indexOf(c)!=-1){$(b).attr("href",e)}else{$(b).click(FrontNews_detail01.notAllowed)}}}}}},setFontSize:function(b,c){if(this.fontSize==-1){this.fontSize=c}var a=this.fontSize.substring(0,this.fontSize.lastIndexOf("px"));if(b=="big"){if(this.fontSize!=-1&&this.fontSize!=""){document.getElementById("infoContent").style.fontSize=parseInt(a)+2+"px"}else{document.getElementById("infoContent").style.fontSize="16px"}}else{if(b=="small"){if(this.fontSize!=-1&&this.fontSize!=""){document.getElementById("infoContent").style.fontSize=parseInt(a)-2+"px"}else{document.getElementById("infoContent").style.fontSize="12px"}}else{if(this.fontSize!=-1&&this.fontSize!=""){document.getElementById("infoContent").style.fontSize=this.fontSize}else{document.getElementById("infoContent").style.fontSize="14px"}}}},getCookie:function(d){var b=document.cookie;var e=b.indexOf(d);if(e!=-1){e+=d.length+1;var a=b.indexOf(";",e);if(a==-1){a=b.length}var c=unescape(b.substring(e,a))}return c},changeQuestionStatus:function(b,a){if(a=="fail"){var c=document.getElementById(b+"_showQuestionnaire");c.style.display="none"}},getPreAndNextInfoByAjax:function(b,c,a,f,e,d){$.post(b+"/FrontNews.do","method=getPreAndNextInfoByAjax&newsCategoryId="+c+"&newsId="+a+"&href_PreAndNext="+f+"&openPreAndNext="+e,function(h){var g=h.split("|---|");if(g[0]=="no"){$("#preInfo").html(d)}else{$("#preInfo").html(g[0])}if(g[1]=="no"){$("#nextInfo").html(d)}else{$("#nextInfo").html(g[1])}})},openKeywordUrl:function(a,b){a=a.split("%").join("%25");if(b==0){window.location=a}else{window.open(a)}}};