var configTitle = "KapalJudi Mobile";
var configCopyRight = "Copyright © kapaljudi.com. All rights reserved.";
var configWapDomain = "";
var configMemberDomain = "http://www.kapaljudi.casino/";
var configLiveChat = "http://v2.zopim.com/widget/livechat.html?api_calls=%5B%5D&hostname=www.kapaljudi.com&key=31aC9l5BiBtMDEMFxZwsggn30wqQgHYU&lang=en&";
var configAllowDomain = ["localhost", "mobile.kapaljudi.com", "mobile.kapaljudi.casino", "mobile.kapaljudi.org", "mobile.kapaljudi88.com",
"mobiletest.kapaljudi.com", "mobile.kapaljudi.asia", "mobile.kapaljudi88.net", "mobile.kapalasia.com", "mobile.kapalasia.net"];
var configDownloadIOS = "https://mo.bileapps.com/liga/kapaljudi.plist";
var configMobileDomain = "http://mobile.kapaljudi.com";
var configContactUs = "";
var Version = "4.0.2";
var prefix = "BBC@"; //XAA
var isMobileApp = false;
var isBlack = false;
var LigaSBdefault = false;
var IsLigaSB = false;

function SetConfig() {
    SetTitle();
    SetCopyRight();
    SetContactUS();
}

function downloadFile() {
    window.open( configMobileDomain + '/download.aspx?appNumber=1', '_system');
}

function redirectDownloadLink() {
    if (navigator.userAgent.match(/Android/i)) {
        window.open(configMobileDomain + '/download.aspx?appNumber=1', '_self ');
    }
    else {
        window.open('itms-services://?action=download-manifest&url=' + configDownloadIOS, '_self ');
    }
}

function SetTitle() {
if (document.title == "")	
    document.title = configTitle;
}

function GoWap() {
    window.open(configWapDomain, '_system', 'location=yes');
}
function GoDesktop() {
    window.open(configMemberDomain, '_system', 'location=yes');
}

function SetContactUS() {
    configContactUs += "<div class='list'>";
    configContactUs += "<ul class=''>";
    configContactUs += "<ul class='subList'>";
    configContactUs += "<li class=''>Customer Support : <a href='" + configLiveChat + "' target='blank'>Chat now! </a></li>";
    configContactUs += "</ul>";
    configContactUs += "</ul>";
    configContactUs += "</div>";
    document.getElementById("IDContactUs").innerHTML = configContactUs;
}

function SetCopyRight() {
    document.getElementById("copyright1").innerHTML = configCopyRight;
    document.getElementById("copyright2").innerHTML = configCopyRight;
    document.getElementById("copyright3").innerHTML = configCopyRight;
    document.getElementById("copyright4").innerHTML = configCopyRight;
    document.getElementById("copyright5").innerHTML = configCopyRight;
    document.getElementById("copyright6").innerHTML = configCopyRight;
    document.getElementById("copyright7").innerHTML = configCopyRight;
    document.getElementById("copyright8").innerHTML = configCopyRight;
    document.getElementById("copyright9").innerHTML = configCopyRight;
    document.getElementById("copyright10").innerHTML = configCopyRight;
    document.getElementById("copyright11").innerHTML = configCopyRight;
    document.getElementById("copyright12").innerHTML = configCopyRight;
    document.getElementById("copyright13").innerHTML = configCopyRight;
    document.getElementById("copyright14").innerHTML = configCopyRight;
    document.getElementById("copyright15").innerHTML = configCopyRight;
    document.getElementById("copyright16").innerHTML = configCopyRight;
    document.getElementById("copyright17").innerHTML = configCopyRight;
}

function CheckAllowDomain() {
    for (var i = 0; i < configAllowDomain.length; i++) {
        if (document.location.hostname == configAllowDomain[i])
            return true;
    }
    return false;
}