var dateCount = 0;
var currentDate = 1;

function dateTicker()
{
	dateCount = 0;
	$("#dateticker").css( "top", "0px");
	$("#dateticker").css("left", "940px");
	$("#dateticker").css("position", "absolute");
	$("#dateticker").css("color", "white");
	$("#dateticker").css("width", "199px");
	$("#dateticker").css("height", "72px");
	$("#dateticker").css("padding-top", "10px");

	$("#dateticker").css("overflow", "hidden");
	
	$("#datetickercontent").css("width", "199px");


	$.ajax({
        type: "GET",
	url: "/dates.xml",
	dataType: "xml",
	success: function(xml) {

							$(xml).find('date').each(function(){
									dateCount++;
									var c = $("#datetickercontent").html() + "<div id='datelm"+dateCount+"' style='float:left;width:195px;height:82px;'>"+ $(this).attr('text')+ "</div>"
									$("#datetickercontent").html(c); 
								});

							setTimeout("dateTickerMotion();", 4000); 
	}
});

}

function dateTickerMotion()
{
	
	$('#datelm'+currentDate).slideToggle();

	if (currentDate == dateCount)
	{
		currentDate = 1;
		for (var i = 1; i<=dateCount; i++)
		{
			$('#datelm'+i).slideToggle();
		}
	}
	else
	{
		currentDate++;
	}
		setTimeout("dateTickerMotion();", 4000); 

}	
	
 


