
var z = false;
var items;

function NewsScroll(ulposition, itemposition, items, item) {

    if (document.getElementById) {
        var i = document.getElementById('nothing');
        var o = document.getElementById('newsscroller');
    } else if (document.all) {
        var i = document.all['nothing'];
        var o = document.all['newsscroller'];
    } else {
        var i = document.getElementById('nothing');
        var o = document.getElementById('newsscroller');
    }
    

    if (itemposition == 15) {

        item = item+1;

        if (z == false) {
            
            if (items == item) {
                setTimeout("NewsScroll(0, 0, " + items +", 0)", 2000);
            } else {
                setTimeout("NewsScroll(" + ulposition +", 0, " + items +", " + item +")", 2000);
            }

        } else {

            item = item-1;

            setTimeout("NewsScroll(" + ulposition +", 14, " + items +", " + item +")", 10);

        }

    } else {

        if (z == false) {

            itemposition = itemposition+1;
            ulposition = ulposition+1;

            o.style.top = "-"+ulposition+"px";

            setTimeout("NewsScroll(" + ulposition +", " + itemposition +", " + items +", " + item +")", 70);


        } else {

            o.style.top = "-"+ulposition+"px";

            setTimeout("NewsScroll(" + ulposition +", " + itemposition +", " + items +", " + item +")", 10);

        }


    }
    
}

function InitAEvents () {

    if (document.getElementById) {
        var x = document.getElementById('newsscroller').getElementsByTagName('A');
    } else if (document.all) {
        var x = document.all['newsscroller'].all.tags('A');
    } else {
        var x = document.getElementById('newsscroller').getElementsByTagName('A');
    }

    for (var i=0;i<x.length;i++)
    {
        x[i].onmouseover = function () {StopScrolling()}
        x[i].onmouseout = function () {StartScrolling();}
    }

}

function InitJS() {

    var z = false;

    if (document.getElementById) {
        var x = document.getElementById('newsscroller').getElementsByTagName('A');
    } else if (document.all) {
        var x = document.all['newsscroller'].all.tags('A');
    } else {
        var x = document.getElementById('newsscroller').getElementsByTagName('A');
    }

    items = x.length - 1;

    InitAEvents();

    setTimeout("NewsScroll(0, 0, " + items + ", 0)", 2000);


}


function StopScrolling() {

    z = true;

}

function StartScrolling() {

    z = false;

}
