$(document).ready(function(){

//	var $els = $(".HomeBox").equalizeCols();

	// Set Column Heights
	var col2h = scmsGetHeight($('#HomeNews'));
	var col3h = scmsGetHeight($('#Home40th')) + scmsGetHeight($('#HomeFeature')) + (parseInt($('#Home40th').css('marginBottom')));// + parseInt($('#HomeFeature').css('marginBottom'))); //  + parseInt($('#Home40th').css('marginBottom'));
	
//	alert($('#Home40th').outerHeight());
	
	var tallest = (col2h > col3h) ? 'col2' : 'col3';
	if(tallest == 'col2'){
		var diff = col2h - col3h;
		$('#HomeFeature').height($('#HomeFeature').height() + diff);
	}else{
		var diff = col3h - col2h;
		$('#HomeNews').height($('#HomeNews').height() + diff);
	}
	
	
/*
	var boxHeight = 0;
	$('.HomeBox').each(function(i){
			var height = scmsGetHeight($(this));
			if(height > boxHeight){
			boxHeight = height;	
			}
	});
	
	$('.HomeBox').height(boxHeight + 50);
//	$('.HomeBox').css({'min-height' : boxHeight});
//	alert("!" + boxHeight);
	*/

	// Menu Initialise
//	$('#HomepageMenu').menu({"hideDelay" : "500"});
//	$('#HomepageMenu').menu({"hideDelay" : "500"});

	$('#HomepageMenu li').hover(
			function(){
				$(this).find('.homeMenuWrapper').css("visibility","visible");
//				$(this).find('.homeMenuWrapper').fadeIn(1);
			},
			function(){
				$(this).find('.homeMenuWrapper').css("visibility","hidden");
//				$(this).find('.homeMenuWrapper').fadeOut(2000);
			}
	);

});

function scmsGetHeight(element){
//	return $(element).height(); // + parseInt($(element).css('margin-top')) + parseInt($(element).css('margin-bottom')) + parseInt($(element).css('padding-top')) + parseInt($(element).css('padding-bottom'));
	return $(element).outerHeight();
}