
	var dataArray = null;
	
	
	//	CNewsTicker::getObj
	//	Parameters:	String id
	//	return:		Object
	function getObj(id)
	{
		if(document.getElementById)
			return document.getElementById(id);
		else if(document.all)
			return document.all[id];
		else
			return null;
	}
	
	//	CNewsTicker::incPos
	//	Parameters:	void
	//	return:		void
	function incPos()
	{
		if(this.pos >= this.data.length - 1)
			this.pos = 0;
		else
			this.pos++;
	}

	//	function:	showItem
	//	Parameters:	int pos
	//	return:		void
	function showItem(pos)
	{
		if(this.typewriter)
		{
			if(this.typepos == -1)
			{
				this.typepos++;
				this.getObj(this.target).href = this.data[pos][0];
				this.getObj(this.target).innerHTML = "";
				
				var thisObj = this;
				setTimeout(function(){ thisObj.showItem(pos); }, this.typeinterval);
			}
			else if(this.typepos < this.data[pos][1].length)
			{
				this.typepos += 5;
				this.getObj(this.target).href = this.data[pos][0];
				this.getObj(this.target).innerHTML = this.data[pos][1].substr(0, this.typepos);
				
				var thisObj = this;
				setTimeout(function(){ thisObj.showItem(pos); }, this.typeinterval);
			}
			else
			{
				this.typepos = -1;
			}
		}
		else
		{
			this.getObj(this.target).href = this.data[pos][0];
			this.getObj(this.target).innerHTML = this.data[pos][1];
		}
	}
	
	//	CNewsTicker::showNext
	//	Parameters:	void
	//	return:		void
	function showNext()
	{
		this.showItem(this.pos);
		this.incPos();

		var thisObj = this;
		setTimeout(function(){ thisObj.showNext() }, this.interval * 1000);
	}
	
	//	CNewsTicker::run
	//	Parameters:	void
	//	return:		void
	function run()
	{
		this.showNext();
	}
	
	//	CNewsTicker::CNewsTicker
	//	Parameters:	int interval
	//				string target
	//				String[][] data
	function CNewsTicker(interval, target, typewriter, typeinterval, data)
	{
		// members
		this.interval = interval;
		this.target = target;
		this.typewriter = typewriter;
		this.typeinterval = typeinterval;
		this.data = data;
		this.pos = 0;
		this.typepos = -1;
		
		// methods
		this.run = run;
		this.incPos = incPos;
		this.showNext = showNext;
		this.showItem = showItem;
		this.getObj = getObj;
	}


	//	Function:	initNewsData
	//	Parameters:	void
	function initNewsData()
	{
		var count = 0;
		var i;
		
		for(i = 0; i < news.length; ++i)
		{
			if(news[i][4] == 1)
				count++;
		}
		
		if(count > 0)
		{
			var itemNum = 0;
			dataArray = new Array(count);
			
			for(i = 0; i < news.length; ++i)
			{
				if(news[i][4] == 1)
				{
					dataArray[itemNum] = new Array(news[i][3], news[i][2]);
					itemNum++;
				}
			}
		}
		else
		{
			dataArray = new Array(1);
			dataArray[0] = new Array("#", "There is no news at this time.");
		}
	}
	
	//	Function:	initNews
	//	Parameters:	void
	function initNews()
	{	
		if(!(is.nav && is.major < 5))
		{
			var type = true;
			
			if(is.mac && is.ie)
				type = false;
			
			var newsTick = new CNewsTicker(5, "newsTicker", type, 50, dataArray);
			newsTick.run();
		}
	}
	
	
	initNewsData();