var IE4 = document.all;
var IE5 = (IE4 && navigator.appVersion.indexOf("MSIE 5.0") != -1);
var NN7 = (!IE4 && document.getElementById);
var NN4 = document.layers;
if (!(NN7 || IE4) && location.href.indexOf("nonstandard.htm") == -1) location.replace("nonstandard.htm");
if (IE4 && navigator.userAgent.indexOf("Opera") != -1) {
	NN7 = true;
	IE4 = false;
}
var mac = (IE4 && navigator.appName.indexOf("Mac") != -1?true:false);

function getStyleObject(obj) {
	var theObj = (IE4?document.all[obj]:document.getElementById(obj));
	return (theObj?theObj.style:null);
}

function getObject(obj) {
	return (IE4?document.all[obj]:document.getElementById(obj));
}

if (typeof ending == "undefined" || !ending)
	ending = "Read";

var tickerID1,tickerID2;
function runTicker() {
	if (runTicker.n <= stories[runTicker.story].title.length) {
		if (runTicker.on) {
			getObject("tickerlink").innerHTML = stories[runTicker.story].title.substring(0,runTicker.n);
//		getObject("tickerlink").innerHTML += stories[runTicker.story].title.charAt(runTicker.n);
			runTicker.n++;
			runTicker.on = 0;
		} else {
			getObject("tickerlink").innerHTML += "_";
			runTicker.on = 1;
		}
	} else {
//		if (stories[runTicker.story].title.length < 40)
			getObject("tickerlink").innerHTML += " >>>";
		runTicker.n = 0;
		clearInterval(tickerID1);
		tickerID2 = setTimeout("startTicker()",5000);
	}	
}
runTicker.story = 0;
runTicker.n = 0;
runTicker.on = 0;

var counter = 0;
function startTicker() {
	if (counter < 10) {
		counter++;
		if (runTicker.story == stories.length -1)
			runTicker.story = 0;
		else
			runTicker.story++;
		getObject("newsticker_body").innerHTML = "<span class=\"tickerpadding\"><a id=\"tickerlink\" href=\"" + stories[runTicker.story].url + "\"></a></span>";

		tickerID1 = setInterval("runTicker()",50);
	}
}

function initTicker() {
	getObject("newsticker_body").innerHTML = "<span class=\"tickerpadding\"><a id=\"tickerlink\" href=\"" + stories[0].url + "\">" + stories[0].title + " >>></a></span>";

	tickerID2 = setTimeout("startTicker()",10000);
}

initTicker();