/***********************************************
* ProHTML Ticker script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var speed = 5000 //miliseconds (1000 = 1 seconds)
var currentDiv = -1;
var nextDiv = 0;
var totalDivs = 0;
var interval

function HideAllSlides() {
	var i = 0;
	while (document.getElementById("slidecontent" + i)) {
		document.getElementById("slidetitle" + i).style.color = "#ffffff";
		document.getElementById("slidecontent" + i).style.display = "none";
		i++;
	}
}
function TitleOver(index) {
	clearTimeout(interval);
	nextDiv = index;
	ShowSlide(index);
}
function ShowSlide(nDiv) {
	HideAllSlides();
	document.getElementById("slidetitle" + nDiv).style.color = "#f5821f";
	document.getElementById("slidecontent" + nDiv).style.display = "block";
	currentDiv = nDiv;
}
function StartShow() {
	if (currentDiv != nextDiv) {
		ShowSlide(nextDiv);
	}
	nextDiv = (currentDiv < totalDivs - 1)? currentDiv + 1 : 0
	interval = setTimeout("StartShow()", speed);
}
function Initialize() {
	while (document.getElementById("slidecontent" + totalDivs) != null) {
		totalDivs++;
	}
	StartShow();
}

if (window.addEventListener) {
	window.addEventListener("load", Initialize, false)
} else if (window.attachEvent) {
	window.attachEvent("onload", Initialize)
}
