/**
 *
 * 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,
			reset = $.browser.msie && $.browser.version < 7 ? "1%" : "auto";

		return this
			.css("height", reset)
			.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);

$(document).ready(function() {

	//
	if ($.browser.mozilla && $.browser.version <= "1.9" ){
		$('body').addClass('ff2');
	}

	//
	if ($.browser.mozilla && $.browser.version <= "1.9.1" ){
		$('.getting-started #content div.top p:last-child').css({'padding':'0'});
		$('body').addClass('ff3');
	}

	//
	if(window.opera){
		$('html').addClass('opera');
	}

	//
	if($.browser.safari){
		$('html').addClass('safari');
	}

	//
	$('a[rel=_blank]').click(function(){
		this.target = "_blank";
	});

	//
	Cufon.replace(
		'#content p.navigation, #footer ul#navigation li a',{
			hover: true,
			fontFamily: 'HelveticaNeue Light'
		}
	);
	Cufon.replace(
		'#content h2, .home #content div.content-top dl dt, .home #content div.content-bottom dl dt, .getting-started #content div.content-bottom dl dt',{
			fontFamily: 'HelveticaNeue Light'
		}
	);

	//
	$(".getting-started #content div.content-bottom dl dd").append('<span></span>');

	//
	$(".getting-started #content div.content-bottom dl").equalizeCols();

});
