"undefined"==typeof AwcCasinoHandler&&(AwcCasinoHandler={}); (function(){AwcCasinoHandler.init=function(b,c){AwcCasinoHandler.bindEvent();AwcCasinoHandler.login(b,c)};AwcCasinoHandler.bindEvent=function(){$j("#iframeDiv").hide();$j(window).on("beforeunload",function(b){Trace.log("Close window and logout user!")});$j(".pop-close").on("click",function(){AwcCasinoHandler.logout()})};AwcCasinoHandler.login=function(b,c){$j.ajax({type:"POST",url:"/exchange/member/vendorController/login",data:{platform:b,gameType:c,vendorSite:VendorSiteType.AWC.value},beforeSend:function(){JsCache.get("#loading").show()}, complete:function(){JsCache.get("#loading").hide()},success:function(a){if(null!=a)if(a.error)NoticeHandler.alwaysShowError(a.error);else if(a.success)if(PageConfig.ENABLE_CASINO_OPEN_LINK_IN_IFRAME){var d=$j("#iframeDiv");d.append('');d.show()}else window.open(a.success,"_parent",config="height=100%,width=100%,location=no")}})};AwcCasinoHandler.logout=function(){$j.ajax({type:"POST",url:"/exchange/member/vendorController/logout", data:{vendorSite:VendorSiteType.AWC.value},beforeSend:function(){JsCache.get("#loading").show()},complete:function(){JsCache.get("#loading").hide()},success:function(b){alert("Logout success");window.close()}})}})();