//para que no se muestre el carrusel hasta que se hayan cargado los scripts a los que se llama al final d la pag y entonces no se vean las fotos desplegadas
$(window).load(function(){ 
 
 $('#loaderCarrusel').css('display','none');
 $('#loaderCarrusel').css('visibility','hidden');
 
 $('.carrusel').css('display','block');
 $('.carrusel').css('visibility','visible');
 
 $('.mural').css('display','block');
 $('.mural').css('visibility','visible');
 
});






$.fn.cycle.defaults.timeout = 6000;

$(function() {
   
    $('#s4').cycle({
    fx:     'fade',//'scrollLeft' scrollHorz,
    speed: 'slow',
    //timeout: 6000, // 0=desabilitado autoavance
    next:   '#next2', 
    prev:   '#prev2',
    continuous: 0,// true to start next transition immediately after current one completes
    pager:  '#nav',
    pagerAnchorBuilder: function(idx, slide) {
        return '<a onClick="parar();" href="#"><span class="paginationText">o</span></a>'; // whatever markup you want
    },
    //pause:         true,      // true to enable "pause on hover" 
    //pauseOnPagerHover: true, // true to pause when hovering over pager link
    after:   onAfter,
    before: onBefore
 });
    
    
});

function onBefore() {
    $('#output').html(this.id);
    $('#imgcarrusel').attr("href", this.alt); 
}
function onAfter() {
 $('#output').html(this.id);
// $('#imgcarrusel').href(this.alt);
}


/*function onAfter() {
    $('#output').html("<br>" + this.src)
        .append('<h3>' + this.alt + '</h3>');
}*/


function parar(){

$('#s4').cycle('pause'); 
  
}
