
<!-- // Ticker startup

function startTicker()
{
	// Define run time values
	theCurrentStory     = -1;
	theCurrentLength    = 0;
	tickerPaused        = 0;
	// Locate base objects
	if (document.getElementById) {
		    theAnchorObject     = document.getElementById("tickerAnchor");
       		theAnchorObjectHid = document.getElementById('tickerAnchorHid');
			runTheTicker();
    }
	else {
            document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
            return true;
	}
}

var advStart;
// Ticker main run loop
function runTheTicker() {
	var myTimeout;
	// Go for the next story data block
	if(theCurrentLength == 0) {
		if (tickerPaused == 1) {
			setTimeout("runTheTicker()", myTimeout);
			return;
		}

		theCurrentStory++;
		theCurrentStory      = theCurrentStory % theItemCount;
		var pom = theSummaries[theCurrentStory].replace(/&quot;/g,'"');
		pom = pom.replace(/&#39;/g,"'");
		pom = pom.replace(/&#039;/g,"'");

		var theStorySummaryWIthoutStripped = pom;

		var stripped = stripHTML(pom);
		if(stripped == theStorySummaryWIthoutStripped) {
			theStorySummary = theStorySummaryWIthoutStripped;
			advStart = 0;
			thePrefix 	     = "";
			thePostfix 	     = "";
		} else {
			theStorySummary = stripped;
			advStart = theStorySummaryWIthoutStripped.length - stripped.length - 7;
			thePrefix 	     = theStorySummaryWIthoutStripped.substring(0,advStart);
			thePostfix 	     = "";
			advStart = 0;
		}

		theTargetLink        = theSiteLinks[theCurrentStory];
		theAnchorObject.href = theTargetLink;

	}

	// Stuff the current ticker text into the anchor
	var text = thePrefix + theStorySummary.substring(advStart,theCurrentLength) + whatWidget() + thePostfix;
	theAnchorObjectHid.innerHTML = text
	var widthpx = theAnchorObjectHid.offsetWidth
	//alert(advStart+"; "+widthpx+" - "+450)
    if(widthpx>=450) {
	   advStart++;
	   advStart++;
	}
	var text = thePrefix + theStorySummary.substring(advStart,theCurrentLength) + whatWidget() + thePostfix;
	theAnchorObject.innerHTML = text


	// Modify the length for the substring and define the timer
	if(theCurrentLength != theStorySummary.length) {
		theCurrentLength++;
		myTimeout = theCharacterTimeout;
	} else {
		theCurrentLength = 0;
		myTimeout = theStoryTimeout;
	}
	// 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;
	}
}

function pauseTicker(){
  tickerPaused = 1;
}

function unpauseTicker(){
  tickerPaused = 0;
}

function stripHTML(value){
	var re= /<\S[^><]*>/g;
	return value.replace(re, "");
}

// -->

