$(document).ready(function () {
		
	$('ul.tagline').cycle({ 
		nowrap: 0,
		fx: 'fade',
		speed: 1000,
		timeout: 7000,
		height: 'auto',
		cleartypeNoBg: true
	});
	
	/* Fix bug in IE7 with a bit of Jquery, yay! */
	
	var zIndexNumber = 1000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
	
	$('#featuredposts div:nth-child(3)').addClass('last-row');
	$('#regularposts .node.small:nth-child(6)').addClass('last-row');

	$('ul#slideshow').cycle({ 
		nowrap: 0,
		sync:0,
		fx: 'fade',
		speed: 300,
		height: 'auto',
		timeout: 0,
		cleartypeNoBg: true,
		after: onAfter,
		prev: 'a.prev',
		next: 'a.next'
	});

	function onAfter(curr,next,opts) {
		var caption = (opts.currSlide + 1) + ' / ' + opts.slideCount;
		$('#counter').html(caption);
		window.location.hash = opts.currSlide + 1;
	}	

});
