(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","hidden");
		});
	}
})(jQuery);


$(function() {

	$('ul.sites li').each(function() {
		var $this = $(this);
		var $screencap = $('.screencap', this);
		$this.hover(function() {
			$screencap.animate({opacity: '1', top: '50%'}, {queue: false, duration: 300});
		}, function() {
			$screencap.animate({opacity: '0', top: '60%'}, {queue: false, duration: 300});
		});
		
		$('ul.sites li a').click(function(event) {
			event.stopPropagation();		
		}).each(function() {
			var $this = $(this);
			$this.closest('li').click(function() {
				document.location = $this.attr('href');	
				return false;
			});
		});		
	});
	
	$('.prettyphoto, .video-link').prettyPhoto();
	
	$('.home-banner').innerfade({
		speed: 'slow',
		timeout: 4000,
		type: 'random_start',
		containerheight: '270px'
	});
	
	$('.setThumb').equalHeights();
	
});
