/* common classes/functions */


$(document).ready(function(){

    /* open all external links in new window (class 'ext') */
    $('a.ext').attr('target', '_new');

});







/* note: following brilliant equalizeCols() jQuery plugin ripped from code at
 * http://www.tomdeater.com/jquery/equalize_columns/ and used in FCEContact.js
 * right now for LC only. */
/**
 *
 * Copyright (c) 2007 Tom Deater (http://www.tomdeater.com)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 */
(function($) {
	/**
	 * equalizes the heights of all elements in a jQuery collection
	 * thanks to John Resig for optimizing this!
	 * usage: $("#col1, #col2, #col3").equalizeCols();
	 */
	 
	$.fn.equalizeCols = function(){
		var height = 0;
  
		return this
			.css("height", "auto")
			.each(function() {
				height = Math.max(height, this.offsetHeight);
			})
			.css("height", height)
			.each(function() {
				var h = this.offsetHeight;
				if (h > height) {
					$(this).css("height", height - (h - height));
				};
			});
			
	};
	
})(jQuery);
/** end equalizeCols **/




/**
 * fake a :hover selector in CSS for elements that can't have it (IOW anything
 * other than an <a> in IE6). Will add the specified className to the element
 * when the mouse is over it, and remove when not.
 *
 * 
 * usage: $("#crazyButton").hoverClass('over');
 *
 */
(function($) {
	$.fn.hoverClass = function(className){
        return this.bind('mouseover', function() { $(this).addClass(className) })
                   .bind('mouseout', function() { $(this).removeClass(className) });
	};
})(jQuery);

/* custom extensions to get the true width and height of objects, including any
 * margins or borders. Needed in FCESlideShow */
(function($) {

	$.fn.totalWidth = function() {
        return parseInt(this.width()) + parseInt(this.css('marginLeft')) + parseInt(this.css('marginRight')) + parseInt(this.css('border-left-width')) +  parseInt(this.css('border-right-width'));
	};

	$.fn.totalHeight = function() {
        return parseInt(this.height()) + parseInt(this.css('marginTop')) + parseInt(this.css('marginBottom')) + parseInt(this.css('border-top-width')) +  parseInt(this.css('border-bottom-width'));
	};
})(jQuery);


jQuery.preloadImages = function()
{
      for(var i = 0; i<arguments.length; i++) {
        jQuery("<img>").attr("src", arguments[i]);
      }
};

