function getCookie(e){
for(var t=document.cookie.split("; "),a=0;a<t.length;a++){
var n=t[a].split("=");if(e===n[0])return unescape(n[1])}
return null}


function setCookie(e,t,a){
var n=new Date;n.setDate(n.getDate()+a),document.cookie=e+"="+escape(t)+"; path=/; expires="+n.toGMTString()+";"}

function addPopup(e,t,a,n,i){
var o=document.getElementById(e);o.style.top=t+"px",o.style.left=a+"px",o.style.width=n+"px",o.style.height=i+"px",o.style.display="block",dragElement(document.getElementById(e))}

function hidePopup(e,t,a){
setCookie(e,t,a),document.getElementById(e).style.display="none"}

function popupClose(e){
document.getElementById(e).style.display="none"}

function dragElement(t){
var a=0,n=0,i=0,o=0;function e(e){
e=e||window.event,i=e.clientX,o=e.clientY,document.onmouseup=l,document.onmousemove=s}

function s(e){
e=e||window.event,a=i-e.clientX,n=o-e.clientY,i=e.clientX,o=e.clientY,t.style.top=t.offsetTop-n+"px",t.style.left=t.offsetLeft-a+"px"}

function l(){
document.onmouseup=null,document.onmousemove=null}

document.getElementById(t.id+"header")?document.getElementById(t.id+"header").onmousedown=e:t.onmousedown=e}

function levelUpCheck(){
"Y"===$("#is_level").val()&&$.ajax({
url:"/player/level/level.detail",type:"GET",data:{
}

,dataType:"json",headers:{
}

,success:function(e){
}

,error:function(){
}

,complete:function(){
}

}

)}

function addAmount(e,t){
var a=1===e?$("#depositAmount"):$("#withdrawalAmount"),e=Number(a.val());e+=1e4*t,isNaN(e)&&(e=0),a.val(e),a.focus()}

function resetAmount(e){
(1===e?$("#depositAmount"):$("#withdrawalAmount")).val("")}



function boardPopup(e,t,a){
parseInt($("#is_sign_in").val())&&("notice"===e?$(".notice-link"):$(".event-link")).click()}


$(document).ready(function(){
$(window).width()<=1120&&$(".wrapper").removeClass("affix"),$(window).resize(function(){
$(window).width()<=1120&&$(".wrapper").removeClass("affix")}

),1121<=$(window).width()&&(480<$(window).scrollTop()?$(".wrapper").addClass("affix"):$(".wrapper").removeClass("affix")),$(window).scroll(function(){
1121<=$(window).width()&&(480<$(window).scrollTop()?$(".wrapper").addClass("affix"):$(".wrapper").removeClass("affix"))}

),$(".login-btn").on("click",function(){
}

),$(".logout-btn").on("click",function(){
alertify.confirm("로그아웃","로그아웃 하시겠습니까?",function(){
$(".after-login").removeClass("active"),$(".before-login").addClass("active"),$("body").removeClass("active"),$(".sn-overlay").removeClass("active"),$(".wrapper_loading").removeClass("hidden"),window.location.href="/logout"}

,function(){
}

)}


),$(".sc-btn").on("mouseover",function(){
$(this).siblings(".sc-btn").addClass("off")}

),$(".sc-btn").on("mouseout",function(){
$(".sc-btn").removeClass("off")}

),$(".slot-toggle").on("click",function(){
$(this).addClass("active"),$(this).siblings("button").removeClass("active"),$(".slot-section").addClass("active"),$(".casino-section").removeClass("active"),$(".hotel-section").removeClass("active"),$(".sc-card").removeClass("is-flipped"),1180<=$(window).width()?$("html, body").animate({
scrollTop:$(".page-content").offset().top-87}

,500):$("html, body").animate({
scrollTop:$(".page-content").offset().top-97}

,500)}

),$(".hotel-toggle").on("click",function(){
$(this).addClass("active"),$(this).siblings("button").removeClass("active"),$(".hotel-section").addClass("active"),$(".casino-section").removeClass("active"),$(".slot-section").removeClass("active"),$(".sc-card").removeClass("is-flipped"),1180<=$(window).width()?$("html, body").animate({
scrollTop:$(".page-content").offset().top-87}

,500):$("html, body").animate({
scrollTop:$(".page-content").offset().top-97}

,500)}

),$(".casino-toggle").on("click",function(){
$(this).addClass("active"),$(this).siblings("button").removeClass("active"),$(".casino-section").addClass("active"),$(".slot-section").removeClass("active"),$(".hotel-section").removeClass("active"),$(".sc-card").addClass("is-flipped"),501<=$(window).width()?$("html, body").animate({
scrollTop:$(".page-content").offset().top-87}

,500):$("html, body").animate({
scrollTop:$(".page-content").offset().top-97}

,500)}

);var e=0;$(".casino-section .sc-btn").each(function(){
$(this).css("animation-delay",e+"s"),e+=.1}

);var t=0;$(".slot-section .sc-btn").each(function(){
$(this).css("animation-delay",t+"s"),t+=.1}

),$(window).scroll(function(){
100<$(this).scrollTop()?$(".scroll-top").fadeIn():$(".scroll-top").fadeOut()}

),$(".scroll-top").on("click",function(){
return $("html, body").animate({
scrollTop:0}

,600),!1}

),$(".scroll-top").on("click",function(){
window.scrollTo({
top:0,behavior:"smooth"}

)}

),$(".login-link").on("click",function(){
$(".loginModal").modal("show"),$(".loginModal").siblings(".modal").modal("hide")}

),$(".join-link").on("click",function(){
$(".joinModal").modal("show"),$(".joinModal").siblings(".modal").modal("hide")}

),$(".deposit-link").on("click",function(){
$(".depositModal").modal("show"),$(".depositModal").siblings(".modal").modal("hide")}

),$(".withdraw-link").on("click",function(){
$(".withdrawModal").modal("show"),$(".withdrawModal").siblings(".modal").modal("hide")}

),$(".event-link").on("click",function(){
$(".eventModal").modal("show"),$(".eventModal").siblings(".modal").modal("hide"),1===$(".event-table tbody tr").length&&"데이터를 가져오는 중입니다."===$(".event-table tbody tr td").text()&&postAjax(1,"EV")}

),$(".eventview-link").on("click",function(){
$(".eventviewModal").modal("show"),$(".eventviewModal").siblings(".modal").modal("hide")}

),$(".notice-link").on("click",function(){
$(".noticeModal").modal("show"),$(".noticeModal").siblings(".modal").modal("hide"),1===$(".notice-table tbody tr").length&&"데이터를 가져오는 중입니다."===$(".notice-table tbody tr td").text()&&postAjax(1,"NT")}

),$(".noticeview-link").on("click",function(){
$(".noticeviewModal").modal("show"),$(".noticeviewModal").siblings(".modal").modal("hide")}

),$(".faq-link").on("click",function(){
$(".faqModal").modal("show"),$(".faqModal").siblings(".modal").modal("hide"),1===$(".faq-basic tbody tr").length&&"데이터를 가져오는 중입니다."===$(".faq-basic tbody tr td").text()&&postAjax(1,"FQ","basic")}

),$(".mypage-link").on("click",function(){
$(".myPageModal").modal("show"),$(".myPageModal").siblings(".modal").modal("hide")}

),$(".deposit-hist-link").on("click",function(){
$(".depositHistModal").modal("show"),$(".depositHistModal").siblings(".modal").modal("hide")}

),$(".withdraw-hist-link").on("click",function(){
$(".withdrawHistModal").modal("show"),$(".withdrawHistModal").siblings(".modal").modal("hide")}

),$(".bonus-link").on("click",function(){
$(".bonusModal").modal("show"),$(".bonusModal").siblings(".modal").modal("hide")}

),$(".board-link").on("click",function(){
$(".boardModal").modal("show"),$(".boardModal").siblings(".modal").modal("hide")}

),$(".slot-section .sc-btn .play-btn").on("click",function(){
$(".gamelistModal").modal("show")}

),$(".modal-nav a").on("click",function(){
$(this).addClass("active"),$(this).parent().siblings().find("a").removeClass("active");var e=$(this).parent().index()+1;$(this).parentsUntil(".modal-dialog").find(".modal-tab:nth-child("+e+")").addClass("active"),$(this).parentsUntil(".modal-dialog").find(".modal-tab:nth-child("+e+")").siblings().removeClass("active")}

),$(".with-depth .depth-click").on("click",function(){
$(this).toggleClass("active"),$(this).siblings(".depth-click").removeClass("active"),$(this).next(".dropdown").find(".message-content").slideToggle(),$(this).next(".dropdown").siblings(".dropdown").find(".message-content").slideUp()}

),$(".bs-table tr td .delete-btn").on("click",function(){
$(this).parentsUntil("tbody").css("display","none"),$(this).parentsUntil("tbody").next(".dropdown").css("display","none")}

),$(".mypage-btn").on("click",function(){
$(this).toggleClass("opened"),$(".sidebar").slideToggle()}

),$(".sn-overlay, .main-menu a, .mypage-link, .login-link, .join-link").on("click",function(){
$(".left-menu-btn").removeClass("opened"),$(".right-menu-btn").removeClass("opened"),$(".sidebar-left").removeClass("active"),$(".sidebar-right").removeClass("active"),$(".sn-overlay").removeClass("active"),$("body").removeClass("active")}

),$(window).resize(function(){
1161<=$(window).width()&&($(".left-menu-btn").removeClass("opened"),$(".right-menu-btn").removeClass("opened"),$(".sidebar-left").removeClass("active"),$(".sidebar-right").removeClass("active"),$(".sn-overlay").removeClass("active"),$("body").removeClass("active"))}

)}

),$(document).ready(function(){
var e;$("input[name='use-point-value']").number(!0),$("#loginForm").submit(function(){
$(this).on("keyup keypress",function(e){
if(13===(e.keyCode||e.which))return e.preventDefault(),!1}

),$(this).parsley().validate(),$(this).parsley().isValid()&&$(".wrapper_loading").removeClass("hidden")}

),$("#loginFormMobile").submit(function(){
$(this).parsley().validate(),$(this).parsley().isValid()&&$(".wrapper_loading").removeClass("hidden")}

),$("#signUpForm").submit(function(){
$(this).on("keyup keypress",function(e){
if(13===(e.keyCode||e.which))return e.preventDefault(),!1}

),$(this).parsley().validate(),$(this).parsley().isValid()&&!$("input:text[name='mb_tel']").hasClass("parsley-error")&&$(".wrapper_loading").removeClass("hidden")}

),$("#depositForm").submit(function(e){
$(this).on("keyup keypress",function(e){
if(13===(e.keyCode||e.which))return e.preventDefault(),!1}

);var t=Math.abs($("[name=deposit_amount]").val());isNaN($(".after-login .player-balance").text().replace(/원/gi,"").replace(/,/gi,"").replace(/(\s*)/gi,""))?(alertify.alert("알림","보유금 갱신 중입니다. 잠시후 다시 시도하세요."),e.preventDefault()):0<t%1e4||isNaN(t)?(alertify.alert("알림","입금금액은 만원단위로 입력하세요."),e.preventDefault()):($(this).parsley().validate(),$(this).parsley().isValid()&&$(".wrapper_loading").removeClass("hidden"))}

),$("#withdrawalForm").submit(function(e){
$(this).on("keyup keypress",function(e){
if(13===(e.keyCode||e.which))return e.preventDefault(),!1}

);var t=Math.abs($("[name=withdrawal_amount]").val()),a=parseFloat($("#withdrawalForm .player-balance-input").val().replace(/,/gi,"").replace(/(\s*)/gi,""));isNaN(a)?(alertify.alert("알림","조회중입니다. 잠시만기다려주세요."),e.preventDefault()):a<t?(alertify.alert("알림","신청금액이 보유금액보다 많습니다. 보유금액을 확인하세요."),e.preventDefault()):0<t%1e4||isNaN(t)?(alertify.alert("알림","출금금액은 만원단위로 입력하세요."),e.preventDefault()):($(this).parsley().validate(),$(this).parsley().isValid()&&$(".wrapper_loading").removeClass("hidden"))}

),$("#passwordForm").submit(function(){
$(this).on("keyup keypress",function(e){
if(13===(e.keyCode||e.which))return e.preventDefault(),!1}

),$(this).parsley().validate(),$(this).parsley().isValid()&&$(".wrapper_loading").removeClass("hidden")}

),$("#writeForm").submit(function(){
$(this).on("keyup keypress",function(e){
if(13===(e.keyCode||e.which))return e.preventDefault(),!1}

),$(this).parsley().validate(),$(this).parsley().isValid()?$(".wrapper_loading").removeClass("hidden"):alertify.alert("알림","입력항목을 확인하세요.")}

),$(".modal-menu li a, .sidebar-left li a").on("click",function(){
var e;void 0===$(this).data("target")||$(this).hasClass("slot-division")||(e=$(this).data("target"),1===parseInt($(e).children().length)&&(void 0===$(this).data("category")?postAjax(1,$(this).data("id")):postAjax(1,$(this).data("id"),$(this).data("category"))),".message-list"===e&&"데이터를 가져오는 중입니다."===$(".message-list table .title-td").text()&&postAjax(1,$(this).data("id")))}

),$(".deposit-hist-link").on("click",function(){
"데이터를가져오는중입니다."===$(".deposit-list table tbody").children().text().replace(/(\s*)/gi,"")&&postAjax(1,"DP")}

),$(".more-link").on("click",function(){
$(this).hasClass("event-section")?$(".subpage-link.event-link").click():$(this).hasClass("notice-section")&&$(".subpage-link.notice-link").click()}

),parseInt($("#is_sign_in").val())&&($(".wager-reload").on("click",function(){
$(".balance").hasClass("wager-reload")&&$(".point").hasClass("wager-reload")&&($(".wrapper_loading").removeClass("hidden"),wagerCheck(),$(this).removeClass("wager-reload"),setTimeout(function(){
$(".balance").hasClass("wager-reload")||$(".balance").addClass("wager-reload"),$(".point").hasClass("wager-reload")||$(".point").addClass("wager-reload")}

,6e4))}

),(e=new Pusher("76cf54d2768b927d38ab",{
cluster:"ap1",encrypted:!1}

)).subscribe("ARIALogin-alert").bind("ARIALoginEvent",function(e){
var t=parseInt($("#val-idx").val());parseInt(e.notifyUserIdx)===t&&(alertify.alert("알림","중복으로 로그인되어 현재 위치에서 로그아웃 합니다."),$("#alertMSG")[0].play(),$(".wrapper_loading").removeClass("hidden"),statusUpdate("logOff"),setTimeout(function(){
window.location.href="/logout"}

,600))}

),e.subscribe("masterAuth-alert").bind("MasterAuthEvent",function(e){
var t,a=parseInt($("#val-idx").val());parseInt(e.notifyUserIdx)===parseInt(a)&&(alertify.alert("알림",e.notifyMessage),$("#newMSG")[0].play(),"normal"===e.notifyType?(t=$(".message-count"),a=parseInt(t.text().replace(/[\(\)\ ]/gi,""))+1,t.html("( "+a+" )"),t.css("animation","letter_anim 1s ease infinite"),messageReload()):"finance"===e.notifyType?wagerCheck():"ban"===e.notifyType&&($(".wrapper_loading").removeClass("hidden"),window.location.href="/logout"))}

))}

);