var myTop=0;
var topStart=550;
var topFinish=-151;
var moveDelay=50;
var displayDelay=8000;
var contentCount=1;

function scrollMe() {
    myObj=document.getElementById('holder');
    if(myObj) moveIt();
}


function positionMe() {
    myObj.style.top=myTop+'px';
}

function startTimer(howLong) {
    animTimer=setTimeout("moveIt()",howLong);
}

function drawContent(myId, myTitle, myCopy, myImage, myLang, table2) {
    myStr = (table2) ? "<table class='table2'" : "<table "
    myStr = myStr + "width='100%'  border='0' cellpadding='0' cellspacing='0'><tr><td valign='top' class='mainCopy'>"
                  +"<a href='/news_main.php?id="+myId+"' target='_top'><strong>"+myTitle+"</strong></a><br>"+myCopy+" <a href='/news_main.php?id="+myId+"' target='_top'><strong>"+myLang+"</strong></a></td></tr></table>";

    return myStr;
}

function replaceContent() {
    if(contentCount>=myContent.length) contentCount=0;

    thisImg = (myContent[contentCount][3]!=0) ? myContent[contentCount][3] : false;
    output = drawContent(myContent[contentCount][0], myContent[contentCount][1], myContent[contentCount][2], thisImg,myContent[contentCount][3],false);

    contentCount++;
    myObj.innerHTML=output;
}

function moveIt() {
    // are we at 0?
    if(myTop==0) {
        positionMe();
        startTimer(displayDelay);

    // are we at destination?
    } else if(myTop<topFinish) {
        myTop=topStart;
        positionMe();
        replaceContent();
        startTimer(moveDelay);

    // increment movement
    } else {
        positionMe();
        startTimer(moveDelay);
    }

    // increment count
    myTop=myTop-5;

}