jQuery.noConflict();
(function($){

$.fn.equalHeights = function(add) {
	var tallest = 0;
	$(this).each(function(){
		if ($(this).height() > tallest) tallest = $(this).outerHeight();
	});
	$(this).each(function(){
		var t = $(this);
		var p = parseInt(t.css('paddingTop')) + parseInt(t.css('paddingBottom'));
		var h = tallest - p;
		for (var i in add)
			if (this.id == i)
				h += add[i];
		if ($.browser.msie && $.browser.version == 6.0) 
			t.css({'height': h});
		t.css({'min-height': h}); 
	});
	return this;
};

$(document).ready(function(){

	$('.tabArea').
		find('.tabs a').click(function(){
			$(this).
				parents('.tabs').find('li').removeClass('active').end().
				parents('.tabArea').find('.tab').hide();
			$('#' + this.className).show();
			$(this.parentNode).addClass('active')
			return false;
		}).end();

	$('#infos .tab').equalHeights();

	$('#events .details').each(function(){
		var i = $(this).next();
		$(this).add(i).equalHeights();
	});
	$('#events .info .tabArea').each(function(){
		$(this).css({ height: $(this.parentNode).height() + 'px' });
	});

	if ($.browser.msie) {
		try {document.execCommand("BackgroundImageCache", false, true);} catch(err){};
		if (typeof(DD_belatedPNG) != 'undefined')
		{
			DD_belatedPNG.fix('.buttons a span');
		}
	}

});

})(jQuery);
