﻿var waitTime = 7000;
var animateTime = 1000;

$(document).ready(function(){
		$("#tickerContainer div").css("display", "none");
		$("#tickerContainer").css("display", "block").show();
		doLoop();
});

function doLoop(){
		var total = $("#tickerContainer div").size();
		var i = 0;

		while(i<=total){
			setTimeout("displayLink("+i+")", i*waitTime);
			i++;
			if (i>total){
				setTimeout("doLoop()", total*waitTime);	
			}
		}

}

function displayLink(count){
		$("#tickerContainer div:eq("+count+")").show(animateTime);
		$("#tickerContainer div:eq("+count+")").animate({opacity: 1}, {duration: waitTime - (2*animateTime)});
		$("#tickerContainer div:eq("+count+")").hide(animateTime);

}