/****************************************************************************************
'||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'     *##  *##
'     ##   ##             Copyright 2007 H & B Solutions
'    ##***##              All Rights Reserved
'   ##   ##               
' *##  *#&##**%           Authors: Hernandez, Bailey
'        ##   ##          Date:    Oct 2007
'       ##***%            Version: 0.01
'      ##    ##  
'    *##****^  Solutions
'||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
*****************************************************************************************/

/****************************************************
This variables will set the delay and amount of news.
*****************************************************/
var ArrInd;
var TimeDelay;
var strInternal;
var spanCurrent;
var spanTotal;
spanCurrent = "";
spanTotal = "";
ArrInd = 0;
TimeDelay = 5000; //*** In Milliseconds 1000 = 1 second.****
//****************************************************

/********************************************************
Initialize strInternal and kicks off the News ticker.
*********************************************************/
function StartNews(strObj, strCurrent, strTotal){
	strInternal = strObj;
	spanCurrent = strCurrent;
	spanTotal = strTotal;
	writeSpan();
}//End Start News


/********************************************************
Writes the news information to the News span object in the page.
*********************************************************/
function writeSpan(){
	//************* Write the Amount of news where available ********
	if ( (spanCurrent != "") && (spanTotal != "") ){
		document.getElementById(spanCurrent).innerHTML = ArrInd + 1;
		document.getElementById(spanTotal).innerHTML = NewsArray.length;
	}
	//****************************************************************

	//*************Write the information to the Span Object and increment the Array seed*************
	document.getElementById(strInternal).innerHTML = "" + NewsArray[ArrInd];
	ArrInd++;
	//************************************************************************************************

	//*************Reset the Array Seed*************
	if (ArrInd == NewsArray.length)
		ArrInd = 0;
	//**********************************************
	
	//*************Show the News for N seconds*************
	setTimeout('writeSpan()',TimeDelay);
	//*****************************************************	
}//Write Span Ends