
var _ISD_UI_Ticker_theCharacterTimeout = 25;
var _ISD_UI_Ticker_theStoryTimeout     = 3000;
var _ISD_UI_Ticker_tickerAnchor        = "_ISD_UI_Ticker_tickerAnchor";
var _ISD_UI_Ticker_theWidgetOne        = " |";
var _ISD_UI_Ticker_theWidgetTwo        = " |";
var _ISD_UI_Ticker_theWidgetNone       = "";
var _ISD_UI_Ticker_theItemCount				 = 10;

// Ticker startup
function _ISD_UI_Ticker_startTicker(redirectPath)
{
	
	// Define run time values
	_ISD_UI_Ticker_theCurrentStory     = -1;
	_ISD_UI_Ticker_theCurrentLength    = 0;
	// Locate base objects
	if (document.getElementById) 
	{	
		_ISD_UI_Ticker_theAnchorObject     = document.getElementById(_ISD_UI_Ticker_tickerAnchor);
		_ISD_UI_Ticker_runTheTicker(redirectPath);   	
	}
	else 
	{
		document.write("<style>.tickerContent{display:none;}.ticko{border:0px; padding:0px;}</style>");
    return true;
	}
}
var _ISD_UI_Ticker_myTimeout;
// Ticker main run loop
function _ISD_UI_Ticker_runTheTicker(redirectPath)
{
	// Go for the next story data block
	if(_ISD_UI_Ticker_theCurrentLength == 0)
	{
		_ISD_UI_Ticker_myTimeout = _ISD_UI_Ticker_theCharacterTimeout;
		
		if (_ISD_UI_Ticker_theCurrentStory!=_ISD_UI_Ticker_theItemCount)
			_ISD_UI_Ticker_theCurrentStory++;
		else
			_ISD_UI_Ticker_theCurrentStory=0;
		
		_ISD_UI_Ticker_theCurrentStory  = _ISD_UI_Ticker_theCurrentStory % _ISD_UI_Ticker_theItemCount;
		_ISD_UI_Ticker_theStorySummary  = _ISD_UI_Ticker_theSummaries[_ISD_UI_Ticker_theCurrentStory];		
		theNewsID				= _ISD_UI_Ticker_theNewsIDs[_ISD_UI_Ticker_theCurrentStory];
		
		if(theNewsID!="0" && theNewsID!="")
		{
			theTargetLink         = redirectPath + theNewsID;
			_ISD_UI_Ticker_theAnchorObject.href  = theTargetLink;
			_ISD_UI_Ticker_theAnchorObject.style.cursor = "hand";
			_ISD_UI_Ticker_theAnchorObject.style.color = "";
			_ISD_UI_Ticker_theAnchorObject.target = "_top";
			
		}
		else
		{
			_ISD_UI_Ticker_theAnchorObject.href = "#";
			_ISD_UI_Ticker_theAnchorObject.style.cursor = "text";
			//_ISD_UI_Ticker_theAnchorObject.style.color = "#FE3637";
			_ISD_UI_Ticker_theAnchorObject.style.textDecoration = "none";
			_ISD_UI_Ticker_theAnchorObject.target = "_self";
		}
	}
	
	// Stuff the current ticker text into the anchor
	_ISD_UI_Ticker_theAnchorObject.innerHTML = _ISD_UI_Ticker_theStorySummary.substring(0, _ISD_UI_Ticker_theCurrentLength) + _ISD_UI_Ticker_whatWidget();
	// Modify the length for the substring and define the timer
	if(_ISD_UI_Ticker_theCurrentLength == _ISD_UI_Ticker_theStorySummary.length)
	{
		_ISD_UI_Ticker_myTimeout = _ISD_UI_Ticker_theStoryTimeout;
		_ISD_UI_Ticker_theCurrentLength = 0;
	}
	else
	{
		_ISD_UI_Ticker_myTimeout = _ISD_UI_Ticker_theCharacterTimeout;
		_ISD_UI_Ticker_theCurrentLength++;
	}
	setTimeout("_ISD_UI_Ticker_runTheTicker('" + redirectPath + "')", _ISD_UI_Ticker_myTimeout);
}

// Widget generator
function _ISD_UI_Ticker_whatWidget()
{
	if(_ISD_UI_Ticker_theCurrentLength == _ISD_UI_Ticker_theStorySummary.length)
	{
		return _ISD_UI_Ticker_theWidgetNone;
	}

	if((_ISD_UI_Ticker_theCurrentLength % 2) == 1)
	{
		return _ISD_UI_Ticker_theWidgetOne;
	}
	else
	{
		return _ISD_UI_Ticker_theWidgetTwo;
	}
}

function _ISD_UI_Ticker_setTickerCounter(recordCount)
{
	_ISD_UI_Ticker_theItemCount = recordCount;
}

//_ISD_UI_Ticker_startTicker('/NCY/News/View.aspx?ObjectID=');
	
//-->

