

var X_AST = new Array();
var DATASDELAY = 4000;


function Articles_Auto_Move() {
    for (var i=0; i<X_AST.length; i++) {
        var textSMALLb = X_AST[i];
        if (textSMALLb > 0) scroll_Content(textSMALLb);
    }
}

function Tab_Hold(textSMALLb) {
    if (textSMALLb < 1) return;
    var id = "moduletable_momenteelhotcasino-" + textSMALLb;
    var ul = document.getElementById(id);
    if (!ul) return;
    for (var i=0; i<ul.childNodes.length; i++) {
        var o = ul.childNodes.item(i);
        if (!o) continue;
        o.className = "";
        if (!o.id) continue;
        id = o.id;
        id = id.substr(id.lastIndexOf("-")+1);
        if (!(id > 0)) continue;
        id = "chapter-" + textSMALLb + "-" + id;
        o = document.getElementById(id);
        if (!o) continue;
        o.style.display = "none";
    }
}

function Article_Start(textSMALLb, contentId) {

    if ((textSMALLb < 1) || (contentId < 1)) return;

    Tab_Hold(textSMALLb);

    var id = "descriptions-" + textSMALLb + "-" + contentId;
    var o = document.getElementById(id);
    if (!o) return;
    o.className = "moduletable_text";

    var id = "chapter-" + textSMALLb + "-" + contentId;
    var o = document.getElementById(id);
    if (!o) return;
    o.style.display = "block";
}

function scroll_Content(textSMALLb) {

    if (textSMALLb < 1) return;

    var number = 0;
    var id = "moduletable_momenteelhotcasino-" + textSMALLb;
    var ul = document.getElementById(id);
    if (!ul) return;
    for (var i=0; i<ul.childNodes.length; i++) {
        var o = ul.childNodes.item(i);
        if (!o || !o.id) continue;
        id = o.id;
        id = id.substr(id.lastIndexOf("-")+1);
        if (!(id > 0)) continue;
        if (o.className == "moduletable_text") {
            number = i;
        }
    }

    number++;
    if (number >= ul.childNodes.length) number = 0;

    var id = ul.childNodes.item(number).id;
    id = id.substr(id.lastIndexOf("-")+1);

    Tab_Hold();
    Article_Start(textSMALLb, id);
    
}

function Block_Data(textSMALLb) {
    for (var i=0; i<X_AST.length; i++) {
        if (X_AST[i] == textSMALLb) {
            X_AST[i] = 0;
        }
    }
}

function start_tab_switch(textSMALLb) {
    if (textSMALLb > 0) X_AST.push(textSMALLb);
}



if (DATASDELAY > 0) setInterval(Articles_Auto_Move, DATASDELAY);
