// JavaScript Document
(function($) {
	
	$(document).bind("ready", function() {
		var $outrosItens = $(".outros_itens"),
			$noticiaWrapper = $outrosItens.find(".noticia_wrapper"),
			noticiaWrapperHeight = $noticiaWrapper.height(),
			$itemNoticia = $noticiaWrapper.find(".item_noticia"),
			itemNoticiaLength = $itemNoticia.size();
		
		$noticiaWrapper.bind("mouseenter", function() {
			$(this).stop();
		}).bind("mouseleave", function() {
			scrollItens(true);
		});
		
		function scrollItens(a) {
			if (a) {
				$noticiaWrapper.animate({
					'marginTop': (noticiaWrapperHeight * -1) + 'px'
				}, {
					duration: (itemNoticiaLength * 3000),
					easing: "linear",
					complete: scrollItens
				});
			} else {
				$noticiaWrapper.css('marginTop', '130px');
				scrollItens(true);
			}
			
		}
		
		scrollItens();
	});
		  
})(jQuery);