var NewsTicker = {

	init : function(){
	
		var scroll = document.getElementById('scroller');

		num = 0;
		tmpNum = 0;
		count = 0;
		
		if ( scroll && typeof scroll != 'undefined' ){
			
			var pars = scroll.childNodes;
			for(i=0; i < pars.length; i++ ){
				if ( pars[i].tagName == 'P' ){
					count++;
				}
			}
			tot = (count * -17);
			if ( count > 1 ){
				setTimeout('NewsTicker.moveIt()', 1000);
			}
		}
	},
	
	
	moveIt: function(){
		var scroll = document.getElementById('scroller');
		var debug = document.getElementById('homecontwrap');
		num = parseInt(scroll.style.top);
		
		if ( tmpNum > -17 ){
			tmpNum--;
			num--;
			scroll.style.top = num+'px';
			setTimeout('NewsTicker.moveIt()', 100);
		}
		else if ( num < tot ){
			tmpNum = 0;
			num = 0;
			scroll.style.top = '0px';
			setTimeout('NewsTicker.moveIt()', 1000);
		}
		else {
			tmpNum = 0;
			setTimeout('NewsTicker.moveIt()', 1000);
		}
		//debug.innerHTML = num+' '+tmpNum;
	}


}
