

var ARTICLE_ARTICLE = new Array();
var TAB_HOLD = 4000;


function Roller_Data(topcasinotable) {
    if (topcasinotable > 0) ARTICLE_ARTICLE.push(topcasinotable);
}

function Articles_Auto_Scroller() {
    for (var i=0; i<ARTICLE_ARTICLE.length; i++) {
        var topcasinotable = ARTICLE_ARTICLE[i];
        if (topcasinotable > 0) scroll_Data(topcasinotable);
    }
}

function show_this_Data(topcasinotable, contentId) {

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

    Tab_Block(topcasinotable);

    var id = "textWorter-" + topcasinotable + "-" + contentId;
    var o = document.getElementById(id);
    if (!o) return;
    o.className = "postmetadata";

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

function scroll_Data(topcasinotable) {

    if (topcasinotable < 1) return;

    var bignumber = 0;
    var id = "background_main-" + topcasinotable;
    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 == "postmetadata") {
            bignumber = i;
        }
    }

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

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

    Tab_Block();
    show_this_Data(topcasinotable, id);
    
}

function Tab_Block(topcasinotable) {
    if (topcasinotable < 1) return;
    var id = "background_main-" + topcasinotable;
    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 = "feeds_widget_line2-" + topcasinotable + "-" + id;
        o = document.getElementById(id);
        if (!o) continue;
        o.style.display = "none";
    }
}

function Paus_Tabbing(topcasinotable) {
    for (var i=0; i<ARTICLE_ARTICLE.length; i++) {
        if (ARTICLE_ARTICLE[i] == topcasinotable) {
            ARTICLE_ARTICLE[i] = 0;
        }
    }
}



if (TAB_HOLD > 0) setInterval(Articles_Auto_Scroller, TAB_HOLD);
