var ctr1 = 0;
var ctr2 = 7;
var rotatingTextElement;
var counterElement;
var rotatingText = new Array();
var counter = new Array();
var rotateCountInterval;
var rotateTextInterval;

function initRotateText() {
    
    rotatingTextElement = document.getElementById("newItem1");
      rotatingText[0]="New link added to the \"More Sites\" page: \"Vintage Ball Gloves\" offering detailed information about vintage baseball glove evolution... -- <a href=\"http://www.vintageballgloves.com\">Click Here To Check It Out</a>" 
	      rotatingText[1]="New Blog: \"What major league baseball was like many years ago!\". -- <a id=\"test\" href=\"http://www.timelessbaseball.com/wordpress\">Click Here To Check It Out</a>"
   rotatingText[2]="New Interesting Webpage: Bleeding Yankee Blue - \"For the ultimate Yankee fan who\'s looking for News, Analysis and Humor\" -- <a href=\"http://www.bleedingyankeeblue.blogspot.com\">Click Here To View Site</a>!"
    rotatingText[3]="New blog post added: ...In keeping with our theme of ‘timeless baseball' I thought it might be of interest to remember some of my childhood days as the son of a major league baseball player... -- <a href=\"http://www.timelessbaseball.com/wordpress\">Click Here To View The Post</a>"
    rotatingText[4]="New blog post added: ...I’d like to discuss one of the GREATEST of all major league ballplayers the IMMORTAL Lou Gehrig and his final year in the New York Yankees line-up,1939... -- <a href=\"http://www.timelessbaseball.com/wordpress\">Click Here To View The Post</a>"


    
    rotateText();

    counter[0]="<a>Next Item in 0 Click Here to See it Now</a>";
    counter[1]="<a>Next Item in 1 Click Here to See it Now</a>";
    counter[2]="<a>Next Item in 2 Click Here to See it Now</a>";
    counter[3]="<a>Next Item in 3 Click Here to See it Now</a>";
    counter[4]="<a>Next Item in 4 Click Here to See it Now</a>";
    counter[5]="<a>Next Item in 5 Click Here to See it Now</a>";
    counter[6]="<a>Next Item in 6 Click Here to See it Now</a>";
    counter[7]="<a>Next Item in 7 Click Here to See it Now</a>";

    rotateTextInterval=setInterval(rotateText, 7000);
    rotateCountInterval=setInterval(changeFooter, 1000);
}

function reset() {
    clearInterval ( rotateTextInterval );
    clearInterval ( rotateCountInterval );
    rotateText();
    ctr2=7;
    counterElement.innerHTML = counter[7];
    rotateTextInterval=setInterval(rotateText, 7000);
    rotateCountInterval=setInterval(changeFooter, 1000);
}

function changeFooter() {
    counterElement = document.getElementById("newItemFooter");
    ctr2--;
    if(ctr2 <= 0) {
        ctr2 = 7;
    }
    counterElement.innerHTML = counter[ctr2];
}

function rotateText() {

    if(ctr1 >= rotatingText.length) {
        ctr1 = 0;
    }
    rotatingTextElement.innerHTML = rotatingText[ctr1];
    ctr1++;
    /*var ele = document.getElementById("test");
    if(ele != null) {
        ele.className += "fadeLink";

    }*/
}

window.onload = initRotateText;
