/* Author: Edd Temple-Smithson */

$(document).ready(function () {

	$.fn.setAllToMaxHeight = function () {
        return this.height(Math.max.apply(this, $.map(this, function (e) { return $(e).height(); })));
    };
	
	var ie7 = false;
	if ( $.browser.msie && parseInt($.browser.version, 10) == 7 ) {
		ie7 = true;
	}
	
	var stickFooter = function () {
		$('#main').css('padding-bottom', $('#footer').outerHeight());
		$('#footer').css('margin-top', -($('#footer').outerHeight()));
	}
	stickFooter();	
	$(window).resize(function(){
		stickFooter();
	});
	
	// Some browsers are just shit
	$('li:first-child').addClass('first-child');
	$('li:last-child').addClass('last-child');
	
	//Colorbox
	if ($.fn.colorbox) {
		$('.jq-overlay').colorbox( { width: "60%" } );
		$('#main a:has(img)').colorbox( { width: "60%" } );
	}
	
});
