/*
 * clickable 0.1.9	http://jlix.net/extensions/jquery/clickable/0.1.9
 *
 * Copyright (c) 2009 Sander Aarts	(jlix.net)
 * Dual licensed under the MIT (http://jlix.net/MIT.txt)
 * and GPL (http://jlix.net/GPL.txt) licenses.
 *
 * Requires jQuery to work	(jquery.com). Tested with version 1.2.6
 *
 * 2008-12-01
 */
(function($) {
	$.fn.extend( {
		clickable: function( cpTtl ) { // v0.1.9
			//	Makes elements clickable, linking to location specified by href= attribute of first descending link (where href is not "#" and does not start with "javascript:").
			// Args.:	cpTtl:	[Boolean | optional]	Specifies whether or not to copy the title= attribute from the link to clickable element (default: true)
			//	CSS:		.jsClickable (on this)
			//				.jsClickableHover (on this:hover)
			//				.jsClickableFocus (on this, when guiding link gets focus)
			//				.jsGuide (on guiding link)
			return this
				.each( function() {
					var jClickElem = $(this);
					var jGuideLink = $("a[href]:not([href='#']):not([href^='javascript:'])", jClickElem).eq(0);
					if ( !jGuideLink ) return true;	// continue
					
					var href = jGuideLink.attr("href");
					if ( !href ) return true;	// continue
					
					$(this).data("href", href);
					if ( ( cpTtl || cpTtl == null ) && !this.title && jGuideLink[0].title ) this.title = jGuideLink[0].title;
					jClickElem
						.click( function() { window.location.href = $(this).data("href"); } )
						.hover(
							function() { $(this).addClass("jsClickableHover"); },
							function() { $(this).removeClass("jsClickableHover"); }
						)
						.addClass("jsClickable");
						
					jGuideLink
						.focus( function() { $(this).parents(".jsClickable").eq(0).addClass("jsClickableFocus"); })
						.blur( function() { $(this).parents(".jsClickable").eq(0).removeClass("jsClickableFocus"); })
						.addClass("jsGuide");
				} );
		}
	} );
} )(jQuery);

/**
 * 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) {
		var tallest = (minHeight) ? minHeight : 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height() + 40;
			}
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
		return this.each(function() {
			$(this).height(tallest).css("overflow","auto");
		});
	}
})(jQuery);


