$().ready(function() {

	var $miniNavEls = $("#productNavigation li a span");
	$miniNavEls.each(function(i) {
		var thisHeight = $(this).height();
		var topOffset = Math.floor((44 - thisHeight)/2) + 'px';
		$(this).css({'padding-top':topOffset});
	});	


	function addMega() {
		$(this).addClass("hovering");
	}

	function removeMega() {
		$(this).removeClass("hovering");
	}

	var megaConfig = {
		interval: 0,
		sensitivity: 2,
		over: addMega,
		timeout: 0,
		out: removeMega
	};

    $("#navigation li.mega").hoverIntent(megaConfig);
});
$.fn.equalHeights = function(px) {
	$(this).each(function(){
		var currentTallest = 0;
		$(this).children().each(function(i){
			if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
		});
		if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); }
		$(this).children().css({'min-height': currentTallest}); 
	});
	return this;
};
$.fn.vAlign = function() {
	return this.each(function(i){
	var ah = $(this).height();
	var ph = $(this).parent().height();
	
	var mh = (ph - ah) / 2;
	$(this).css('margin-top', mh);
	});
};