$(document).ready(function() {

$(".avancar, .voltar") .fadeTo(100, 0.3);

$(".destaque-linha ul li img").hover (function(){ 
	$(this).animate({"width":"+=10"}, "fast")
	},
	function(){
	$(this).animate({"width":"-=10"}, "fast")
});

$(".avancar, .voltar").hover
	(function(){
	$(this).fadeTo(300, 1.0)
	},
	function(){
	$(this).fadeTo(300, 0.3)
});	
		
$(".destaque-rolante ul").cycle({
	fx:	'scrollHorz',  
	speed:	2000, 
	timeout:	0, 
	next: '.avancar',
	prev: '.voltar'
});

$(".legenda") .fadeIn('fast');

$('.imagens').before('<ul id="nav" class="miniaturas">').cycle({ 
    fx:     'fade', 
    speed:  '2000', 
    timeout: 0,
    next: '.avancar',
	prev: '.voltar',
    pager:  '#nav',
    before:   onBefore, 
    fit: 1,

    // callback fn that creates a thumbnail to use as pager anchor 
    pagerAnchorBuilder: function(idx, slide) { 
        return '<li><img src="' + slide.src + '" /></li>'; 
    }
       
});


function onBefore() {
    $('.legenda').html('<p><b>'+ this.title +'</b></p><p>' + this.alt + '</p>') 
	}

});