﻿var popUpObj;
function showModalPopUp(url) {
    popUpObj = window.open(url,
    "ModalPopUp",
    "toolbar=no," +
    "scrollbars=yes," +
    "location=no," +
    "directories=no," +
    "statusbar=no," +
    "menubar=no," +
    "resizable=0," +
    "width=600," +
    "height=500," +
    "left=300," +
    "top=150"
    );
    popUpObj.focus();
    LoadModalDiv();
}
function showBetOnlinePopUp(url) {
    popUpObj = window.open(url,
    "ModalPopUp",
    "toolbar=no," +
    "scrollbars=yes," +
    "location=no," +
    "directories=no," +
    "statusbar=no," +
    "menubar=no," +
    "resizable=0," +
    "width=600," +
    "height=350," +
    "left=300," +
    "top=150"
    );
    popUpObj.focus();
    LoadModalDiv();
}
function LoadModalDiv() {
    var bcgDiv = document.getElementById("divBackground");
    bcgDiv.style.display = "block";
    if (bcgDiv != null) {
        if (document.body.clientHeight > document.body.scrollHeight) {
            bcgDiv.style.height = "300%";
        }
        else {
            bcgDiv.style.height = "300%";
        }
        bcgDiv.style.width = "100%";
    }
}

function HideModalDiv() {
    var bcgDiv = document.getElementById("divBackground");
    bcgDiv.style.display = "none";
}

function OnUnload() {
    if (false == popUpObj.closed) {
        popUpObj.close();
    }
    window.onunload = OnUnload;
}
function GetListAjax(url) {
    GetHtml(url, '#lstajax')
}
function GetListFreeGameAjax(url) {
    GetHtml(url, '#lstfreeajax')
}
function GetListAjax1(url) {
    GetHtml(url, '#lstajax1')
}
function GetListAjax2(url) {
    GetHtml(url, '#lstajax2')
}
function GetHtml(url, div) {
    $.get(encodeURI(url),
   
     function(data) {
        //get response text only
        var s = data.indexOf('<responseText>')
        var t = data.indexOf('</responseText>')
        var response = data.substring(s + 16, t)
        $(div).html(response)
        
        $('.nyroModal').nyroModal();
    })
}