$(document).ready(function(){
	// run the slideshow only when on the home page
	if($('body#home')[0]){
		// set the height of the enclosing #slide element to the tallest slide
		var h = 0;
		$('#slides li').each(function(){
			var lih = $(this).height();
			if(lih > h) h = lih;
		});
		$('#slides, #slides ul, #slides li').css('height', h+'px');
		// run cycle
		$('#slides ul').cycle({
			fx: 'fade',
			timeout: 8000
		});
		// enable slide transitions
		$('#slides div.slide-pager a').click(function(){
			var num = parseInt($(this).text())-1;
			$('#slides ul').cycle(num);
			return false;
		});
	}
});
