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"){locations.href=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 FrontDownloads_list01={changeLinkHref:function(a,f,e,h,d,c,b,i){var g=FrontDownloads_list01.getCookie("c_memberInfo");if(a==null||a==""){$(h).click(FrontDownloads_list01.notAllowed)}else{if(a=="0"||c=="false"){$(h).click(function(){FrontDownloads_list01.setDownloadTimes1(i,b)});$(h).attr("href",f)}else{if(!FrontDownloads_list01.isMemberLogin()){$(h).attr("href",e);$(h).attr("target","_blank");$(h).attr("click",FrontDownloads_list01.setDownloadTimes("",b));if(d!=null&&d!=""){$(d).hide()}}else{if(a=="1"){$(h).attr("href",f);$(h).attr("click",FrontDownloads_list01.setDownloadTimes("",b))}else{if(a.indexOf(g)!=-1){$(h).attr("href",f);$(h).attr("click",FrontDownloads_list01.setDownloadTimes("",b))}else{if(d!=null&&d!=""){$(d).hide()}}}}}}},setDownloadTimes:function(b,a){$.post(b+"/FrontDownloads.do","method=getDownloadTimesByAjax&downloadsId="+a,function(c){$("#downloadTimes"+a).html(c)})},setDownloadTimes1:function(b,a){setTimeout(function(){$.post(b+"/FrontDownloads.do","method=getDownloadTimesByAjax&downloadsId="+a,function(c){$("#downloadTimes"+a).html(c)})},1000)},notAllowed:function(){alert(i18n_downloads_FrontDownloads_list01_noPermissionDownload);return false},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},openFile:function(c,d,b,h,f,a){var e="/downloadRepository/"+b+"."+h;if(a=="false"){if(f=="_self"){window.locations.href=e}else{window.open(e)}}else{if(a=="true"||a=="none"){if(d=="0"){if(f=="_self"){window.locations.href=e}else{window.open(e)}}else{var g=FrontDownloads_list01.getCookie("c_memberInfo");if(!FrontDownloads_list01.isMemberLogin()){FrontDownloads_list01.loginSkip(c,"_blank");return false}else{if(d=="1"){if(f=="_self"){window.locations.href=e}else{window.open(e)}}else{if(d.indexOf(g)!=-1){if(f=="_self"){window.locations.href=e}else{window.open(e)}}else{alert(i18n_downloads_FrontDownloads_list01_noPermission)}}}}}}},intoDownloadDetail:function(b,d,a,c,f){if(a=="true"||a=="none"){if(d!="0"){var e=FrontDownloads_list01.getCookie("c_memberInfo");if(!FrontDownloads_list01.isMemberLogin()){FrontDownloads_list01.loginSkip(b,"_self")}else{if(d=="1"){window.open(c,f)}else{if(d.indexOf(e)==-1){alert(i18n_downloads_FrontDownloads_list01_noPermission)}else{window.open(c,f)}}}}else{window.open(c,f)}}else{window.open(c,f)}},loginSkip:function(a,c){var b=window.locations.pathname;window.open(a+"?returnUrl="+b,c)},isMemberLogin:function(){var a;jQuery.ajax({url:"/FrontDownloads.do?method=checkMember",type:"post",cache:false,async:false,dataType:"text",success:function(b){if(b=="true"){a=true}else{a=false}}});return a}};