

var ticker_layer = false ; 
var step_time = 25 ; 
var freeze_time = 2000 ;
var news_index = 0 ; 
var title_index = 0 ;
var end_title = "_" ; 
var title_max_size = 71 ; 


function begin_roll_ticker(){ 
	window.setTimeout( "roll_ticker()" , step_time ) ; 
} 
	
function roll_ticker(){ 

	var title ; 
	if ( title_index == 0 ){ 
		while ( document.getElementById('n_auto').lastChild != null ){ 
			child = document.getElementById('n_auto').lastChild ; 
			document.getElementById('n_auto').removeChild( child ) ; 
		} 
	} 
	
	if ( news.length > news_index + 1 && news[news_index][0].length >= title_index ){ 
		title = news[ news_index ]; 
		document.getElementById('n_auto_anchor').setAttribute( "href" , title[1] ); 
		s_text = title[0].substring( title_index , title_index + 1 ) ; title_index++ ; 
		if ( document.getElementById('n_auto').lastChild != null ) { 
			if ( document.getElementById('n_auto').lastChild.nodeValue == "_" ){
				child = document.getElementById('n_auto').lastChild; 
				document.getElementById('n_auto').removeChild( child ) ; 
			} 
		} 
		txt = document.createTextNode( s_text ); 
		document.getElementById('n_auto').appendChild( txt ); 
		
		if ( title[0].length > title_index ) { 
			if ( title_index % 10 != 0 ){ 
				txt = document.createTextNode( "_" ); 
				document.getElementById('n_auto').appendChild( txt ) ; 
			} 
		} 
		window.setTimeout( "roll_ticker()" , step_time ) ; 
	} else { 
		news.length == news_index + 2 ? news_index = 0 : news_index++ ; 
		title_index = 0 ; 
		window.setTimeout( "roll_ticker()" , freeze_time ) ; 
	} 
}
window.onload = begin_roll_ticker;
