/* top image */

$(document).ready(function(){
	$.preload = function(){
		for(var i = 0; i <arguments.length; i++){
			$("<img>").attr("src", arguments[i]);
			console.log( "Preloading: " + arguments[i] );
		}
	}
	
	$('.slideshow').each(function() {
		var cycleTimeout = ( $(this).attr('timeout') !== undefined ) ? parseInt($(this).attr('timeout')) * 1500 : 5000
		$(this).cycle({
			fx: 'fade',
			speed: 800,
			// speedIn: 800,
			// speedOut: 1600,
			pause: 0,
			easing: 'linear',
			timeout: cycleTimeout,
			manualTrump: true,
			pager: '.cycle-control'
		});
	});
	var numOfSlides = $('.slideshow').children().size()*16+10+"px";
	$('.cycle-control').css("width",numOfSlides);//should be number of slides * 16, but for some reason it needs more...
});
