    function do_scroll_resume() {
    	//set status to running
    	scroll_running = true;
    }
    function do_scroll_pause() {
    	//set status to pause
    	scroll_running = false;
    }
    function do_scroll() {
    	//if scroller is running, then move a little up
    	scroll_top += scroll_running ? -0.5 : 0;
    	//set the positions
    	$('.newsitems').css( 'position','relative' ).css( 'top', ''+scroll_top+"px" );
        //$('.newsitems').css( 'top', ''+scroll_top+"px" );	
    	//if the top position is way beyond the total height of ticker
    	//then start over again from bottom
    	if( scroll_top<-1*news_height ) scroll_top = ticker_height;
    	//set the timer to invoke scroll again
    	setTimeout( 'do_scroll()', 40 );
    }

$(document).ready(function(){

    //height of the news ticker widget
    ticker_height = $('.news_scroller').height() + 20;
    //height of all the news elements combined
    news_height=$('.newsitems').height();
    //alert(news_height);
    //scroll top offset
    scroll_top = 0;
    //scroll status
    scroll_running = true;
    


	//when mouse is over the scroller, pause
	$('.news_scroller').mouseover( do_scroll_pause );
	//when mouse is out of the scroller, resume
	$('.news_scroller').mouseout( do_scroll_resume );
	//start the scrolling
	do_scroll();
});
