function novidades_carousel() {
    var $active = $('#novidades_carousel p.active');

    if ( $active.length == 0 ) $active = $('#novidades_carousel p:last');

    var $next =  $active.next('p').length ? $active.next()
        : $('#novidades_carousel p:first');


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "novidades_carousel()", 5000 );
});


$(function() {
    $("#marcas_carousel_main").jCarouselLite({
        btnNext: "#marcas_carousel_proximo",
        btnPrev: "#marcas_carousel_anterior",
		visible: 4.8
    });
});


// Marquee
$(function () {
	 //$('#novidades_carousel p').marquee();
				 
	 $('#novidades_carousel p').marquee('marquee').mouseover(function () {
			$(this).trigger('stop');
		}).mouseout(function () {
			$(this).trigger('start');
		}).mousemove(function (event) {
			if ($(this).data('drag') == true) {
				this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
			}
		}).mousedown(function (event) {
			$(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
		}).mouseup(function () {
			$(this).data('drag', false);
		});
	 
	 

 });