var refreshSeconds=10;
var daysBack=30;
var headLineCount=1;
var newsItems = new Array();
var newsItem;
var whichItem = 0;
document.write("
");
document.writeln;
setTimeout("refreshPage()", refreshSeconds * 1000);
//------ changes text of a at ID spanID. (Assumes there's ONLY text in the span.) ------//
function replaceSpan(spanID, newText){
//------ Make a new span with the new text ------//
var newSpan = document.createElement("span");
var newTextNode = document.createTextNode(newText );
newSpan.appendChild(newTextNode);
//------ get the span currently in the document at spanID ------//
var spanElm = document.getElementById(spanID);
var textChild = spanElm.childNodes[0]; // assume that span has only text within
//------ Replace the span in the doc ------//
var replaced = spanElm.replaceChild(newTextNode,textChild);
}
function newSpanItem(docSpan, dataSpan){
//------ Get the new title ------//
var newTitle = newsItems[dataSpan][1];
//------ calculate the ID of the proper news item ------//
spanID = "tenniswireNewsFeedSpan" + docSpan;
replaceSpan(spanID, newTitle);
}
function refreshPage(){
whichItem += 1;
if (whichItem >= newsItems.length) whichItem = 0;
document.getElementById('tenniswireNewsFeedHref0').href = newsItems[whichItem+0][0];newSpanItem(0, whichItem + 0); setTimeout("refreshPage()", refreshSeconds * 1000);
}