(function($){

$(document).ready(function(){

	$('#content, #side1, #side2').equalHeights({ 'side2': 15 });

	if ($.browser.msie)
	{
		if ($.browser.version <= 6)
		{
			try {document.execCommand("BackgroundImageCache", false, true);} catch(err){};
			if (DD_belatedPNG !== undefined)
				DD_belatedPNG.fix('img');
		}
	}

});

$.fn.equalHeights = function(add) {
	var tallest = 0;
	$(this).each(function(){
		tallest = Math.max(tallest, $(this).outerHeight());
	});
	$(this).each(function(){
		var t = $(this), p = 0;
		$.each(['marginTop','borderTopWidth','paddingTop','paddingBottom','borderBottomWidth','marginBottom'], function(i,n){
			p += parseInt(t.css(n));
		});
		var h = tallest - p;
		if (add && add[this.id])
			h += add[this.id];
		if ($.browser.msie && $.browser.version <= 6) 
			t.css({'height': h});
		t.css({'min-height': h}); 
	});
	return this;
};


})(jQuery);
