// JavaScript Document
/*
msg = "";
msg += "Internet2 hits 100Gbps, could scale 10x beyond that . . . ";
msg += "The CMS Tier2 center at University of Nebraska successfully recovered data by using Lambda Station . . . ";
msg += "Lambda Station demonstrates the capability to request a dynamic circuit across Internet2/ESNet networks . . . ";
*/

infoCount = 3;
info = new Array ( infoCount );
info[0] = "In the news: The CMS Tier2 center at University of Nebraska successfully recovered data by using Lambda Station";
info[1] = "The latest Lambda Station presentation: Lambda Station talk at winter Joint Techs 2008";
info[2] = "Upcoming events: Summer 2008 ESCC/Internet2 Joint Techs Workshop, Jul 20-23, 2008, Lincoln Nebraska, USA";

pos = 0;
scrollFlag = 1;
infoIndex = 0;
tickerCounter = 0;

/*
function TickerMsgOld()
{
	var newMsg=msg.substring(pos,msg.length) + msg.substring(0,pos);
	var td = document.getElementById ( "ticker" );
	
	if ( 1 == scrollFlag )
	{
		td.firstChild.nodeValue = newMsg;
		pos++;
	
		if ( pos > msg.length )
		{
			pos = 0;
		}
	}
	
	window.setTimeout ("TickerMsgOld()", 100 );
	
}
*/

function TickerMsg()
{
	var td = document.getElementById ( "ticker" );

	td.width = document.body.offsetWidth;
	
	if ( 1 == scrollFlag )
	{
		if ( tickerCounter < 25 )
		{
			td.firstChild.nodeValue = " ";
		}
		else
		{
			td.firstChild.nodeValue = info[infoIndex];
		}
		tickerCounter++;

		if ( tickerCounter >= 100 )
		{
			tickerCounter = 0;
			infoIndex++;

			if ( infoIndex >= infoCount )
			{
				infoIndex = 0;
			}
		}
	}

	window.setTimeout ("TickerMsg()", 100 );
}

function toggleScrollFlag()
{
	if ( 0 == scrollFlag )
	{
		scrollFlag = 1;
	}
	else
	{
		scrollFlag = 0;
	}
	
}


