$( document ).ready( function(){
	
	$('.dropdown .submenu ul').each( function(){
		var w = $( this ).width() + 'px'; 
		$( this ).css( {'width' : w} );
	});
	
	$( '#navigation li' )
		.mouseover( function(){
			if ( $( this ).parent().parent().hasClass( 'submenu' ) ) return;
			$( this ).find( '.submenu' ).show();
		})
		.mouseout( function(){
			if ( $( this ).parent().parent().hasClass( 'submenu' ) ) return;
			$( '.submenu' ).hide();
		});
		
	
	start_animation();		
	
	$( '.all-news' )
		.mouseover( function(){ stop_animation(); })
		.mouseout( function(){ start_animation(); })
});
var animaton;
function start_animation() {
	var c = 250;
	var h = -1 * $( '.news-holder' ).height() + 'px';
	$( '.news-holder' ).animate({ 
		top: h
	}, 15000, function(){
		$( '.news-holder' ).css({ 'top': 270+'px' });
		start_animation();
	});
}
function stop_animation() {
	$( '.news-holder' ).stop();
}

