var theCharacterTimeout = 50;
var theSentenceTimeOut = 4000;
var theWidgetOne  = "_";
var theWidgetTwo  = "-";
var theWidgetNone = "";
var theLeadString = "&nbsp;";
//Fix here the number of items to be used, change the array size accordingly
var theItemCount = 3;

var theSentence = new Array();
var theLinks = new Array();
theSentence[0] = "National Prominence";
/*theLinks[0] = "#";*/
theSentence[1] = "Internationalization";
/*theLinks[1] = "#";*/
theSentence[2] = "Diversity";
/*theLinks[2] = "#";*/

function startTicker()
{
	// Define run time values
	theCurrentStory  = -1;
	theCurrentLength = 0;
	// Locate base objects
	if (document.getElementById) {	
		theAnchorObject = document.getElementById("tickerAnchor");
		runTheTicker();   	
	}
	else {
		document.write("<style>#divtickerAnchor{display:none;}</style>");
		return true;
	}
}
// Ticker main run loop
function runTheTicker()
{
	var myTimeout;
	var m = String();
	
	// Go for the next story data block
	if(theCurrentLength == 0)
	{
		theCurrentStory++;
		theCurrentStory = theCurrentStory % theItemCount;
		theStorySummary = theSentence[theCurrentStory].replace(/&quot;/g,'"');		
/*		
		theTargetLink        = theLinks[theCurrentStory];
*/
		//theAnchorObject.href = theTargetLink;
		thePrefix = "<span class=\"tickls\">" + theLeadString + "</span>";
	}
	
/*		
	if (theTargetLink.indexOf("void(0)").toString()=="-1")
	{
		
		//theAnchorObject.target="_blank";
		//theAnchorObject.innerHTML = thePrefix + theStorySummary.substring(0,theCurrentLength) + whatWidget();
		document.getElementById("divtickerAnchor").innerHTML = "<a href='" + theTargetLink + "'>" + thePrefix + theStorySummary.substring(0,theCurrentLength) + whatWidget() + "</a>";
	}
*/
	else
	{
		document.getElementById("divtickerAnchor").innerHTML = thePrefix + theStorySummary.substring(0,theCurrentLength) + whatWidget();
	}
	if(theCurrentLength != theStorySummary.length)
	{
		theCurrentLength++;
		myTimeout = theCharacterTimeout;
	}
	else
	{
		theCurrentLength = 0;
		myTimeout = theSentenceTimeOut;
		
	}
	// Call up the next cycle of the ticker
	setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
	if(theCurrentLength == theStorySummary.length)
	{
		return theWidgetNone;
	}
	if((theCurrentLength % 2) == 1)
	{
		return theWidgetOne;
	}
	else
	{
		return theWidgetTwo;
	}
}