$().ready(function() {
	$("#sidebar #whatsNewNav li:last").addClass('last');
	$(".product .categories li:first:not(.category-sheds)").remove();
	
	$("#contentNav li").livequery(function() {
		$(this).hover(function() {  
			$(this).addClass('over');
			var contentTarget = $(this).attr('id');
			var id = contentTarget.replace('content-', '');
			var productTarget = '#product-' + id;
			$(productTarget).addClass('active');
		}, function() { 
			$(this).removeClass('over');
			$("#productNav li").removeClass('active');
		}); 
	});
	$("#productNav li").livequery(function() {
		$(this).hover(function() { 
			var productTarget = $(this).attr('id');
			var id = productTarget.replace('product-', '');
			var contentTarget = '#content-' + id;

			$(contentTarget).addClass('over');
		}, function() { 
			$("#contentNav li").removeClass('over');
		}); 
	});	
	
	$(".categories li").livequery(function() {
		$(this).hover(function() {  
			var contentTarget = $(this).attr('id');
			var id = contentTarget.replace('categoryNav-', '');
			var productTarget = '#content-' + id;
			$(productTarget).addClass('over');
		}, function() { 
			$("#product-landing li").removeClass('over');
		}); 
	});
	$("#product-landing li").livequery(function() {
		$(this).hover(function() {  
			$(this).addClass('over');
			var productTarget = $(this).attr('id');
			var id = productTarget.replace('content-', '');
			var categoryTarget = '#categoryNav-' + id;
			$(categoryTarget).addClass('over');

		}, function() { 
			$(this).removeClass('over');
			$(".categories li").removeClass('over');
		}); 
	});
	
});



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