function equalColumns(aColumns) {
	var currentTallest = 0;
	for (i in aColumns) {
		$(aColumns[i]).each(function(i) {
			if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
		});
	}
	if (!Number.prototype.pxToEm) currentTallest = currentTallest.pxToEm(); //use ems unless px is specified
	// for ie6, set height since min-height isn't supported
	for (i in aColumns) {
		$(aColumns[i]).each(function(i) {
			if ($.browser.msie && $.browser.version == 6.0) { $(this).css({'height': currentTallest});	}
			$(this).css({'min-height': currentTallest}); 
			//alert($(aColumns[i]).height());
		});
	}
}

function playVideo(obj) {
	$(obj).parent().css('display', 'none');
	$(obj).parent().next().css('display', 'block');
	return false;
}

$(document).ready(function(){
	$('.hidden-on-load').each(function(i) {
		$(this).css('display', 'none');
		$(this).removeClass('hidden-on-load');
	});
	
	$('.default-value').each(function(i) {
		if ('' != $(this).attr('value')) {
			$(this).attr('defaultvalue', $(this).attr('value'));
			$(this).focus(function() {
				if ($(this).attr('defaultvalue') == $(this).attr('value')) {
					$(this).attr('value', '');
				}
			});
			$(this).blur(function() {
				if ('' == $(this).attr('value')) {
					$(this).attr('value', $(this).attr('defaultvalue'));
				}
			});
		}
	});
	
	jQuery('#menu-tops li a').click(function() {
		jQuery(this).parent().parent().children().removeClass('active');
		jQuery(this).parent().addClass('active');
		var sTab = jQuery(this).attr('href');
		jQuery(this).parent().parent().parent().children('ul.news').css('display', 'none');
		jQuery(sTab).css('display', '');
		$('div#content').equalHeights();
		$('div#middle').equalHeights();
		return false;
	});
	
	$('#login ul.profiles').each(function(i) {
		$(this).mouseover(function() {
			$(this).children().addClass('show');
		});
		$(this).mouseout(function() {
			$(this).children().removeClass('show');
		});
	});
	
	$('div#content').equalHeights();
	$('div#middle').equalHeights();
	$('ul#menu-footer').equalHeights();
});
