(function($) {
	$.fn.equalHeights = function(minHeight, maxHeight) {
		tallest = (minHeight) ? minHeight : 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height();
			}
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
		return this.each(function() {
			$(this).height(tallest).css("overflow","auto");
		});
	}
})(jQuery);

$(document).ready(function() {

	$('html').addClass('js');
	
	$('#home-rotate ul.rotate li.item').equalHeights();
	$('#home-rotate ul.rotate').before('<div id="rotate-nav">').cycle({ 
		fx:			'fade', 
		speed:		'slow', 
		timeout:	8000, 
		pager:		'#rotate-nav',
		slideExpr:	'li.item'
	});

	if($('#home-btm .live').length) {
		var theNewsHeight = $('#home-btm .news').height();
		$('#home-btm .live').css('min-height',theNewsHeight);
	}

	$('#main .gallery').cycle();
	
	$('#releases .release a.artwork').colorbox();

});
