var IsAlert = true; $(document).ready(function () { if (bLogin === 'false') { if (sLang === 'vi-VN') $(".loopmenu-nologin ul").css("margin-left", "40px"); else { $(".loopmenu-nologin ul").css("margin-left", "55px"); } } else { if (sLang === 'zh-CN' || sLang === 'zh-TW') { // $(".menu .loopmenu ul li a").css("padding-left", "65px"); // $(".menu .loopmenu ul li a").css("padding-right", "65px"); } else if (sLang === 'vi-VN') { //$(".menu .loopmenu ul li a").css("padding-left", "15px"); //$(".menu .loopmenu ul li a").css("padding-right", "15px"); } else { // $(".menu .loopmenu ul li a").css("padding-left", "56px"); // $(".menu .loopmenu ul li a").css("padding-right", "56px"); } } // else // $(".loopmenu-nologin ul").css("margin-left", "150px"); //Popup for 6 small game if ($("#aRouletteRule").length > 0) { $("#aRouletteRule, #aSicboRule, #aBacaratRule, #aDragonRule, #aSideRule, #aFantaRule").fancybox({ 'width': 1027, 'height': 552, 'autoScale': false, 'transitionIn': 'none', 'transitionOut': 'none', 'type': 'iframe', 'overlayOpacity': '0.5', 'overlayColor': '#000000', 'title': sTitlePage }); } if ($("#lnkContact").length > 0 || $("#FootContactUs").length > 0) { $("#lnkContact, #FootContactUs").fancybox({ 'width': 678, 'height': 504, 'autoScale': false, 'transitionIn': 'none', 'transitionOut': 'none', 'type': 'iframe', 'overlayOpacity': '0.5', 'overlayColor': '#000000', 'title': sTitlePage }); } //When click Submit Login $("input[id$='txtCaptcha']").keypress(function (event) { if (event.which == 13) { __doPostBack('ctl00$ctl07$btnLogin', ''); } }); //When hover Report tab var isHoverParent = false; var isHoverSub = false; $("#liReport").mouseover(function () { var position = $("#liReport").position(); // if (bSportBook === 'True') { $("#divSubReport").css({ "left": (position.left - 522) + "px" }); $("#divSubReport").css({ "top": (position.top) - 106 + "px" }); $("#divSubReport").css("display", ""); isHoverParent = true; // } // else { // if (sLang === 'en-US') { // $("#divSubReport").css({ "left": (position.left - 498) + "px" }); // $("#divSubReport").css({ "top": (position.top) - 106 + "px" }); // } // else { // $("#divSubReport").css({ "left": (position.left - 508) + "px" }); // $("#divSubReport").css({ "top": (position.top) - 106 + "px" }); // } // $("#divSubReport").css("display", ""); // isHoverParent = true; // } }).mouseout(function () { isHoverParent = false; $("#divSubReport").mouseover(function () { $("#divSubReport").show().css("display", ""); isHoverSub = true; }).mouseout(function () { $("#divSubReport").css("display", "none"); isHoverSub = false; }); if (isHoverParent === false && isHoverSub === false) $("#divSubReport").css("display", "none"); }); InitRefreshBalance(); }); function ShowLoading() { SetLoaddingCenter($("#divLoading")); $("#divLoading").removeClass("HideLoader"); $("#divLoading").addClass("Loader"); } function CloseLoading() { $("#divLoading").removeClass("Loader").addClass("HideLoader"); } function SetLoaddingCenter(obj) { $(obj).css("position", "absolute"); $(obj).css("top", (($(window).height() - $(obj).outerHeight()) / 2) + $(window).scrollTop() + "px"); $(obj).css("left", (($(window).width() - $(obj).outerWidth()) / 2) + $(window).scrollLeft() + "px"); } function KickOutFlash(sUserName) { $(document).ready(function () { var so = new SWFObject("Images/kickOutUsers.swf", "gsm", "100%", "100%", "8", ""); so.addVariable("rtmp", $("#hdfFMSAddress").val()); so.addVariable("username", sUserName); // var so = new SWFObject("http://bwin69.net/Images/kickOutUsers.swf", "gsm", "100%", "100%", "8", ""); // so.addVariable("rtmp", "113.21.208.5/Jewel4"); // so.addVariable("username", "payment03"); so.write("GSM_"); }); } //Popy added 09/27/2011 function ReloadCaptcha() { // generate a random number to add to image url to prevent caching var randomnumber = Math.floor(Math.random() * 1001); // change image src to the same url but with the random number on the end document.images["captcha"].src = document.images["captcha"].src + '?rand=' + randomnumber; } function CheckKickout() { $.post("Ajax/Kickout.aspx?" + new Date().getTime(), function (data) { if (data === "1") { if (IsAlert === true) { alert("You have just logged in from another location"); IsAlert = false; } //var sURL = window.location.href; //sURL = sURL.replace('?k=t', ''); //window.location.href = sURL; window.location.reload(true); } }) setTimeout('CheckKickout()', 5000); } var CheckRefreshLoop = null; var tTimeOut; function InitRefreshBalance() { if ($("#spBal").text() !== '') { tTimeOut = setTimeout("RefreshBalance()", 30000); } else clearTimeout(tTimeOut); } function RefreshBalance() { if ($("#spBal").text() !== '') { var dtTime = new Date(); $.post("Ajax/RefreshBalance.aspx?" + dtTime.getTime(), function (data) { if (data.length > 0) $("#spBal").text(data); }); tTimeOut = setTimeout("RefreshBalance()", 30000); } else clearTimeout(tTimeOut); } //Create, read, erase cookie function createCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } function eraseCookie(name) { createCookie(name, "", -1); }