!function(){"use strict";function e(e){e.fn._fadeIn=e.fn.fadeIn;var t=e.noop||function(){},o=/MSIE/.test(navigator.userAgent),n=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),i=(document.documentMode,e.isFunction(document.createElement("div").style.setExpression));e.blockUI=function(e){r(window,e)},e.unblockUI=function(e){l(window,e)},e.growlUI=function(t,o,n,i){var s=e('
');t&&s.append("=0;i--)l(e(n[i]),o)}(i)},remove:function(o){var n=u();t||r(n);if(o&&0===e(":focus",o).length)return void f(o);t.children().length&&t.remove()},error:function(e,t,o){return d({type:s.error,iconClass:u().iconClasses.error,message:e,optionsOverride:o,title:t})},getContainer:r,info:function(e,t,o){return d({type:s.info,iconClass:u().iconClasses.info,message:e,optionsOverride:o,title:t})},options:{},subscribe:function(e){o=e},success:function(e,t,o){return d({type:s.success,iconClass:u().iconClasses.success,message:e,optionsOverride:o,title:t})},version:"2.1.2",warning:function(e,t,o){return d({type:s.warning,iconClass:u().iconClasses.warning,message:e,optionsOverride:o,title:t})}};return a;function r(o,n){return o||(o=u()),(t=e("#"+o.containerId)).length?t:(n&&(t=function(o){return(t=e("
").attr("id",o.containerId).addClass(o.positionClass).attr("aria-live","polite").attr("role","alert")).appendTo(e(o.target)),t}(o)),t)}function l(t,o,n){var i=!(!n||!n.force)&&n.force;return!(!t||!i&&0!==e(":focus",t).length)&&(t[o.hideMethod]({duration:o.hideDuration,easing:o.hideEasing,complete:function(){f(t)}}),!0)}function c(e){o&&o(e)}function d(o){var s=u(),a=o.iconClass||s.iconClass;if(void 0!==o.optionsOverride&&(s=e.extend(s,o.optionsOverride),a=o.optionsOverride.iconClass||a),!function(e,t){if(e.preventDuplicates){if(t.message===n)return!0;n=t.message}return!1}(s,o)){i++,t=r(s,!0);var l=null,d=e(""),p=e(""),m=e(""),h=e(""),g=e(s.closeHtml),b={intervalId:null,hideEta:null,maxHideTime:null},v={toastId:i,state:"visible",startTime:new Date,options:s,map:o};return o.iconClass&&d.addClass(s.toastClass).addClass(a),o.title&&(p.append(s.escapeHtml?y(o.title):o.title).addClass(s.titleClass),d.append(p)),o.message&&(m.append(s.escapeHtml?y(o.message):o.message).addClass(s.messageClass),d.append(m)),s.closeButton&&(g.addClass("toast-close-button").attr("role","button"),d.prepend(g)),s.progressBar&&(h.addClass("toast-progress"),d.prepend(h)),s.newestOnTop?t.prepend(d):t.append(d),d.hide(),d[s.showMethod]({duration:s.showDuration,easing:s.showEasing,complete:s.onShown}),s.timeOut>0&&(l=setTimeout(k,s.timeOut),b.maxHideTime=parseFloat(s.timeOut),b.hideEta=(new Date).getTime()+b.maxHideTime,s.progressBar&&(b.intervalId=setInterval(I,10))),function(){d.hover(x,w),!s.onclick&&s.tapToDismiss&&d.click(k);s.closeButton&&g&&g.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&!0!==e.cancelBubble&&(e.cancelBubble=!0),k(!0)});s.onclick&&d.click(function(e){s.onclick(e),k()})}(),c(v),s.debug&&console&&console.log(v),d}function y(e){return null==e&&(e=""),new String(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function k(t){var o=t&&!1!==s.closeMethod?s.closeMethod:s.hideMethod,n=t&&!1!==s.closeDuration?s.closeDuration:s.hideDuration,i=t&&!1!==s.closeEasing?s.closeEasing:s.hideEasing;if(!e(":focus",d).length||t)return clearTimeout(b.intervalId),d[o]({duration:n,easing:i,complete:function(){f(d),s.onHidden&&"hidden"!==v.state&&s.onHidden(),v.state="hidden",v.endTime=new Date,c(v)}})}function w(){(s.timeOut>0||s.extendedTimeOut>0)&&(l=setTimeout(k,s.extendedTimeOut),b.maxHideTime=parseFloat(s.extendedTimeOut),b.hideEta=(new Date).getTime()+b.maxHideTime)}function x(){clearTimeout(l),b.hideEta=0,d.stop(!0,!0)[s.showMethod]({duration:s.showDuration,easing:s.showEasing})}function I(){var e=(b.hideEta-(new Date).getTime())/b.maxHideTime*100;h.width(e+"%")}}function u(){return e.extend({},{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'',newestOnTop:!0,preventDuplicates:!1,progressBar:!1},a.options)}function f(e){t||(t=r()),e.is(":visible")||(e.remove(),e=null,0===t.children().length&&(t.remove(),n=void 0))}}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)}),window.console&&window.console.log||(window.console={log:function(){}}),$(function(){$(document).ajaxError(function(e,t,o){var n="알수없는 오류가 발생하였습니다.";void 0!==t.responseJSON&&void 0!==t.responseJSON.message?n=t.responseJSON.message:500==t.status?n="서버 코드 오류가 발생하였습니다.\n관리자에게 문의하세요":401==t.status&&(n="해당 명령을 실행할 권한이 없습니다."),toastr.error(n,"오류 발생")}).ajaxStart(function(){$.blockUI({css:{width:"25px",top:"49%",left:"49%",border:"0px none",backgroundColor:"transparent",cursor:"wait"},message:'',baseZ:1e4,overlayCSS:{opacity:0}})}).ajaxComplete(function(){$.unblockUI()})});var APP={POPUP:null,REGEX:{}};APP.REGEX.uniqueID=/^[a-z][a-z0-9_]{2,19}$/g,function(e){APP.POPUP=function(t){var o=e.extend({},{title:"_blank",width:800,height:600,url:""},t);cw=screen.availWidth,ch=screen.availHeight,sw=o.width,sh=o.height,ml=(cw-sw)/2,mt=(ch-sh)/2;t="width="+sw+",height="+sh+",top="+mt+",left="+ml+",scrollbars=yes,resizable=no";var n=window.open(o.url,o.title,t);(null==n||void 0===n||null==n&&0==n.outerWidth||null!=n&&0==n.outerHeight)&&alert("팝업 차단 기능이 설정되어있습니다\n\n차단 기능을 해제(팝업허용) 한 후 다시 이용해 주십시오.")}}(jQuery),APP.SET_LANG=function(e){$.cookie("site_lang",e,{expires:30,path:"/"}),location.reload()},$('[data-toggle="btn-popup-close"]').click(function(e){var t=$(this).data("type"),o=$(this).data("idx"),n=$(this).data("cookie");"Y"==t?window.close():"N"==t&&$("#popup-"+o).remove(),1==n&&$.cookie("popup_"+o,1,{expires:1,path:"/"})}),$("a[data-toggle='sns-share']").click(function(e){e.preventDefault();var t=$(this),o=t.data("service"),n=t.data("url"),i=t.data("title"),s="",a=$("meta[name='og:image']").attr("content");if(o&&n&&i){if("facebook"==o)s="//www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(n);else if("twitter"==o)s="//twitter.com/home?status="+encodeURIComponent(i)+" "+n;else if("google"==o)s="//plus.google.com/share?url="+n;else if("pinterest"==o)s="//www.pinterest.com/pin/create/button/?url="+n+"&media="+a+"&description="+encodeURIComponent(i);else if("kakaostory"==o)s="https://story.kakao.com/share?url="+encodeURIComponent(n);else if("band"==o)s="http://www.band.us/plugin/share?body="+encodeURIComponent(i)+"%0A"+encodeURIComponent(n);else if("naver"==o)s="http://share.naver.com/web/shareView.nhn?url="+encodeURIComponent(n)+"&title="+encodeURIComponent(i);else{if("line"!=o)return!1;s="http://line.me/R/msg/text/?"+encodeURIComponent(i+"\n"+n)}return APP.POPUP({url:s}),!1}}),APP.MEMBER={},APP.MEMBER.init=function(){APP.MEMBER.InitLoginForm(),APP.MEMBER.initCheckExist(),APP.MEMBER.InitRegisterForm(),APP.MEMBER.InitMemberModifyForm()},APP.MEMBER.InitRegisterForm=function(){$('[data-form="form-register"]').submit(function(e){e.preventDefault();var t=$(this);$.ajax({type:"PUT",data:t.serialize(),url:base_url+"/ajax/members/info",success:function(e){1==e.result&&(alert(LANG.member_join_success),location.href=base_url+"/members/login")}})})},APP.MEMBER.InitMemberModifyForm=function(){$('[data-form="form-member-modify"]').submit(function(e){e.preventDefault();var t=$(this);$.ajax({type:"POST",data:t.serialize(),url:base_url+"/ajax/members/info",success:function(e){1==e.result&&(alert(e.message),location.reload())}})})},APP.MEMBER.InitLoginForm=function(){$('[data-role="form-login"]').submit(function(e){e.preventDefault();var t=$(this),o=t.find('[name="login_id"]'),n=t.find('[name="login_pass"]');return""==o.val().trim()?(alert(LANG.member_login_userid_required),o.focus(),!1):""==n.val().trim()?(alert(LANG.member_login_password_required),n.focus(),!1):void $.ajax({url:base_url+"ajax/members/login",type:"POST",data:t.serialize(),success:function(e){1==e.result&&(location.href=e.reurl?e.reurl:base_url)},error:function(e){n.val("")}})})},APP.MEMBER.initCheckExist=function(){$('[data-toggle="check-member-exist"]').each(function(){var e=$(this);e.on("click",function(){var t=$("#"+e.data("target")),o=e.data("check"),n=t.val();if(void 0===n||!n||!n.trim())return alert(LANG.member_join_user_id_required),t.focus(),!1;var i=APP.MEMBER.denyWordCheck(o,n);return"VALID_EMAIL"==i?(alert(LANG.member_join_no_valid_email_address),t.focus(),!1):i?APP.MEMBER.getInfo(o,n)?(alert(LANG.member_join_user_id_already_exists),t.focus(),!1):(alert(LANG.member_join_user_id_available),!0):(alert(LANG.member_join_user_id_contains_deny_word),t.focus(),!1)})})},APP.MEMBER.getInfo=function(e,t){var o=null;return $.ajax({url:base_url+"/ajax/members/info",type:"get",async:!1,cache:!1,data:{key:e,value:t},success:function(e){o=e.result}}),o},APP.MEMBER.denyWordCheck=function(e,t){var o=null;return $.ajax({url:base_url+"/ajax/members/word_check",type:"get",async:!1,cache:!1,data:{key:e,value:t},success:function(e){o=e.result}}),o},APP.MEMBER.POP_CHANGE_PHOTO=function(){APP.POPUP({url:"/members/photo_change",width:600,height:150})},$(document).ready(APP.MEMBER.init),APP.BOARD={},APP.BOARD.CATEGORY={},APP.BOARD.EXTRA={},APP.BOARD.COMMENT={},APP.BOARD.CATEGORY.count=function(e){if(void 0===e||!e)return 0;var t=0;return $.ajax({url:base_url+"/ajax/board/category_count",type:"get",cache:!1,async:!1,data:{bca_idx:e},success:function(e){t=e.result}}),t},APP.BOARD.CATEGORY.postCount=function(e){if(void 0===e||!e)return 0;var t=0;return $.ajax({url:base_url+"/ajax/board/category_post_count",type:"get",cache:!1,async:!1,data:{bca_idx:e},success:function(e){t=e.result}}),t},APP.BOARD.COMMENT.modify=function(e){APP.POPUP({title:"_blank",width:800,height:600,url:base_url+"/board/comment/modify/"+e})},APP.BOARD.COMMENT.reply=function(e,t){APP.POPUP({title:"_blank",width:800,height:600,url:base_url+"/board/comment/reply/"+e+"/"+t})},$(function(){var e=$('[data-form="post"]');e.length>0&&e.on("submit",function(){$.blockUI({css:{width:"25px",top:"49%",left:"49%",border:"0px none",backgroundColor:"transparent",cursor:"wait"},message:'',baseZ:1e4,overlayCSS:{opacity:0}})})});