$(document).ready(function() {
	$('#s1').cycle({
		fx:     'fade',
		timeout: aleatorio(3000,4000),
		after: onAfter
	});
	$('#s2').cycle({
		fx:     'fade',
		timeout: aleatorio(2000,3000),
		after: onAfter
	});	
	$('#s3').cycle({
		fx:     'fade',
		timeout: aleatorio(2000,4000),
		after: onAfter			
	});	
	onAfter.apply($('td a:first')[0]);

});

function onAfter() {
    //$('#output').html("Current anchor: " + this.href);
}

function aleatorio(a,b){
    return Math.round(Math.random()*(b-a)+a);
} 