/**
 * Equal Heights Plugin
 * Equalize the heights of elements. Great for columns or any elements
 * that need to be the same size (floats, etc).
 * 
 * Version 1.0
 * Updated 12/10/2008
 *
 * Copyright (c) 2008 Rob Glazebrook (cssnewbie.com) 
 *
 * Usage: $(object).equalHeights([minHeight], [maxHeight]);
 * 
 * Example 1: $(".cols").equalHeights(); Sets all columns to the same height.
 * Example 2: $(".cols").equalHeights(400); Sets all cols to at least 400px tall.
 * Example 3: $(".cols").equalHeights(100,300); Cols are at least 100 but no more
 * than 300 pixels tall. Elements with too much content will gain a scrollbar.
 * 
 */

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

$j(document).ready(function() {
	// Hover for "Now Playing" movie divs
	$j('.hover').hover(function() {
	  $j(this).addClass('active');
	}, function() {
	  $j(this).removeClass('active');
	});
	
	// Hover for "DVD/Bluray" movie divs
	$j('.thin').hover(function() {
	  $j(this).addClass('active');
	}, function() {
	  $j(this).removeClass('active');
	});
});



$j(document).ready(function() {
	twitterlib.status("criterion", {}, function(tweet) {
    $("tweet").innerHTML = "<span class='tweet'>" + (twitterlib.ify.clean(tweet[0].text) + "</span></p><p class='date-and-follow-us'><span class='tweet-time'>" + twitterlib.time.relative(tweet[0].created_at) + " from " + tweet[0].source) + "</span> <span class='follow-us-on-twitter'><a href='http://twitter.com/criterion' class='twitter' title='on Twitter'>Follow us <img src='/images/twitter-icon.png' alt='Twitter' /></a></span>";
    $j(".columns").equalHeights();
		$j(".explore_column").equalHeights();  
  });
});