﻿

function activeLayer(name) {
    document.getElementById(name).style.visibility = "visible";
}

function deactiveLayer(name) {
    document.getElementById(name).style.visibility = "hidden";
}

function vaiA(name) {
    window.location.href = name;
}

function activeLayer(name) {
    document.getElementById(name).style.visibility = "visible";
}


function Browser() {
    this.n4 = (document.layers) ? 1 : 0;
    this.ie = (document.all) ? 1 : 0;
    this.n6 = (document.getElementById) ? 1 : 0;
}

function centra(id, left) {
    if (bw.n4) this.obj = document.layers[id];
    else if (bw.ie) this.obj = document.all[id].style;
    else if (bw.n6) this.obj = document.getElementById(id).style;
    this.obj.left = ((left > 0) ? left : 0) + 0;
    this.obj.top = 122;
    return this.obj;
}

function setup(prima) {
    bw = new Browser();
    if (bw.ie) wdth = Math.round(document.body.clientWidth);
    else if (bw.n4 || bw.n6) wdth = Math.round(window.innerWidth);
    if (prima && bw.n4) location.reload();
    lay = new centra('casino', Math.round((wdth / 2) - (890 / 2) + 659));
    lay2 = new centra('affiliazioni', Math.round((wdth / 2) - (890 / 2) + 247));
    lay3 = new centra('chisiamo', Math.round((wdth / 2) - (890 / 2) + 144));
}

function openLogin(value) {
    openLogin(value, 2);
    return;
}

function openLogin(value, ilingua) {

    if (value == 'login') winLogin = window.open(pathLogIn, 'Login', "left=250,top=150, width=200,height=200,resizable=yes,toolbar=no,status=no,menubar=no");
    else if (value == 'registra') winLogin = window.open(pathRegister, 'Registra', "left=250,top=150, width=800,height=800,resizable=yes,toolbar=no,status=no,menubar=no");
    else if (value == 'dimenticato') winLogin = window.open(pathRecPsw, 'Dimenticata', "left=250,top=150, width=800,height=400,resizable=yes,toolbar=no,status=no,menubar=no");
    else if (value == 'playnow') winLogin = window.open(pathPlayNow, 'PlayNow', "left=250,top=150, width=230,height=400,resizable=yes,toolbar=no,status=no,menubar=no");
    return;
}

function openNews() {

    window.location.replace('Content.aspx?vista=Diviso&tipo=News');
}


function openSupport() {

    window.location.replace('Content.aspx?vista=Unito&tipo=Support');
}

function openPromotion() {
   // if (ambiente == 1) {
        window.location.replace('Content.aspx?vista=Diviso&tipo=Promozioni');
    //}

}

function openLavoraConNoi(){
     window.location.replace('Content.aspx?vista=Unito&tipo=LavoraConNoi');
}


function openLoginLingua(value) {


    if (value == 'login') winLogin = window.open(pathLogIn, 'Login', "left=250,top=150, width=200,height=200,resizable=yes,toolbar=no,status=no,menubar=no");
    else if (value == 'registra') winLogin = window.open(pathRegister, 'Registra', "left=250,top=150, width=800,height=800,resizable=yes,toolbar=no,status=no,menubar=no");
    else if (value == 'dimenticato') winLogin = window.open(pathRecPsw, 'Dimenticata', "left=250,top=150, width=800,height=400,resizable=yes,toolbar=no,status=no,menubar=no");
    else if (value == 'playnow') winLogin = window.open(pathPlayNow, 'PlayNow', "left=250,top=150, width=230,height=400,resizable=yes,toolbar=no,status=no,menubar=no");
    return;
}

function openWSOP(){
    winLogin = window.open("http://pokerinvenice.com/pokerinvenice/wsop.aspx?lang="+strLinga, '', "left=250,top=150, width=900,height=842,resizable=yes,toolbar=no,status=no,menubar=no,scrollbars=yes");
    return;
}

function openClassificaWSOP(){
   window.location.replace("http://pokerinvenice.com/pokerinvenice/classificaWSOP.aspx?lang="+strLinga, '', "left=250,top=150, width=900,height=842,resizable=yes,toolbar=no,status=no,menubar=no,scrollbars=yes");
    return;
}

function openClassificaWSOPNews(){
   winLogin = window.open("http://pokerinvenice.com/pokerinvenice/classificaWSOP.aspx?lang="+strLinga, '', "left=250,top=150, width=900,height=842,resizable=yes,toolbar=no,status=no,menubar=no,scrollbars=yes");
    return;
}




function openPage(stringa) { return; }


function urlCasino(url) {

    var w = 900;
    var h = 600;
    var l = Math.floor((screen.width - w) / 2);
    var t = Math.floor((screen.height - h) / 2);
    var stile = "width=" + w + ",height=" + h + ",top=" + t + ",left=" + l + ", status=yes, menubar=no, toolbar=no scrollbar=no";
    var link = url;
    link = link + intLingua;
    window.open(link, "", stile);
}

function visibilitySubmit(buttonId, checkbox) {
    var submit = document.getElementById(buttonId);
    if (submit.disabled == true && checkbox.checked == true) {
        submit.disabled = false;
    }
    else if (submit.disabled == false && checkbox.checked == false) {
        submit.disabled = 'disabled';
    }
}

function flashClick(idFlash, idPulsante) {
    flashAdapter(idFlash + "_" + idPulsante);
}

function flashAdapter(id) {
    switch (id) {
        case "tournamentCasino_blackJack":
            urlCasino('https://private.pokerinvenice.com/games/casino/pages/blackJack/blackJack.jsp?lang=');
            // winOpenPrivate("blackJack_singlePlayer")
            break;
        case "tournamentCasino_puntaYBanco":
            urlCasino('https://private.pokerinvenice.com/games/casino/pages/multi/puntaybanco.jsp?lang=');
            break;
        case "tournamentCasino_roulette":
            urlCasino('https://private.pokerinvenice.com/games/casino/pages/multi/fair_roulette.jsp?lang=');
            break;
        case "tournamentCasino_30et40":
            urlCasino('https://private.pokerinvenice.com/games/casino/pages/multi/30et40.jsp?lang=');
            break;
        case "tournamentCasino_slot":
            urlCasino('https://private.pokerinvenice.com/games/casino/pages/slot/classic3reel.jsp?lang=');
            break;
        case "tournamentCasino_singleOrMulti":
            void (null);
            break;
        default:
            alert('Funzione non attiva.');
            break;
    }
}