theItemCount = TickerCounter

// Ticker startup
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>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
            return true;
	}
}
var myTimeout
// Ticker main run loop
function runTheTicker()
{
	// Go for the next story data block
	if(theCurrentLength == 0)
	{
		myTimeout = theCharacterTimeout;
		
		if (theCurrentStory!=theItemCount)
			theCurrentStory++;
		else
			theCurrentStory=0;
		
		theCurrentStory      = theCurrentStory % theItemCount;
		theStorySummary      = theSummaries[theCurrentStory].replace(/&quot;/g,'"');		
		theNewsID			 = theNewsIDs[theCurrentStory];
		if(theNewsID!="0")
		{
		theTargetLink         = "http://www.ahedegypt.org/Campaign/News.asp?NewsID="+theNewsID;
		theAnchorObject.href  = theTargetLink;
		theAnchorObject.style.cursor = "hand";
		theAnchorObject.style.textDecoration = "underline";
		theAnchorObject.target = "_top";
		
		}
		else
		{
		theAnchorObject.href = "#";
		theAnchorObject.style.cursor = "text";
		theAnchorObject.style.textDecoration = "none";
		theAnchorObject.target = "_self";
		}
	}
	// Stuff the current ticker text into the anchor
	theAnchorObject.innerHTML = theStorySummary.substring(0,theCurrentLength) + whatWidget();
	// Modify the length for the substring and define the timer
	if(theCurrentLength == theStorySummary.length)
	{
		myTimeout = theStoryTimeout;
		theCurrentLength = 0;
	}
	else
	{
		myTimeout = theCharacterTimeout;
		theCurrentLength++;
	}
	setTimeout("runTheTicker()", myTimeout);
}



// Widget generator
function whatWidget()
{
	if(theCurrentLength == theStorySummary.length)
	{
		return theWidgetNone;
	}

	if((theCurrentLength % 2) == 1)
	{
		return theWidgetOne;
	}
	else
	{
		return theWidgetTwo;
	}
}


startTicker();
	
//-->
