function cancel_anims()
{
	 $('#slideshow').cycle('pause');
	 $('#slideshow2').cycle('pause');
	 $('#novedades').cycle('pause');
}
$(document).ready(function(){ 

		cancel_anims();
		$('#novedades').cycle('resume');

$('#slideshow').cycle({  
    fx:     'scrollHorz', 
    prev:   '#prev', 
    next:   '#next', 
    after:   onAfter, 
    timeout: 0 
});
$('#slideshow2').cycle({ 
    fx:     'scrollHorz', 
    prev:   '#prev2', 
    next:   '#next2', 
    after:   onAfter, 
    timeout: 0 
});

/*$('#novedades').cycle({ 
    fx:     'fade', 
    speed:   1800, 
    timeout: 3000, 
    pause:   20,
    next:   '#novedades',
	cleartype:  1,
  	delay:   -4000
});
  */

$('#novedades') 
.before('<div id="nav">') 
.cycle({ 
    fx:     'fade', 
    speed:  'fast', 
    timeout: 6000, 
    pager:  '#nav' 
}); 
/*
$("#nav-main a").append("<em></em>");
	
	$("#nav-main a").hover(function() {
		$(this).find("em").animate({opacity: "show", top: "-75"}, "slow");
		var hoverText = $(this).attr("title");
	    $(this).find("em").text(hoverText);
	}, function() {
		$(this).find("em").animate({opacity: "hide", top: "-85"}, "fast");
	});

*/


function onAfter(curr, next, opts) {
    var index = $(this).parent().children().index(this);
    $('#prev')[index == 0 ? 'hide' : 'show']();
    $('#next')[index == opts.slideCount - 1 ? 'hide' : 'show']();
}
});