$(document).ready(function(){

	$("#products-nav a:even").addClass("product-nav-alt");
	$(".hp-product:even").addClass("product-nav-alt"); $(".hp-product:nth-child(3)").addClass("product-middle-margins"); // Alternate hp product bg colors
	$("#feature-buttons a:odd").addClass("feature-buttons-alt");
	<!-- v-align arrow in middle on feature buttons -->
	
	$("#feature-buttons a").each(function(index){
			var top_margin = 0;
			var target = $(this).find(".feature-button-arrow");
			var parent_height = target.parent().outerHeight();
			var arrow_height = target.outerHeight();
			top_margin = (parent_height - arrow_height)/2;
			target.css("marginTop", top_margin);							
	});
	
	$('#homepage-products .hp-product h3').equalHeightColumns();
	$('#homepage-clearance .hp-product h3').equalHeightColumns();
	$('#deal-of-the-week .equal-height').equalHeightColumns();
	
	$("#footer ul li a:last").css("borderRight", "0 none");
	
	<!-- dropdown -->
	$("ul.topnav li a").mouseenter(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});

 $('#godown').click(function(){
  $('html,body').animate({scrollTop: $("#product-cart-bottom").offset().top},'slow');
 });

 $("a[href*='http://']:not([href*='"+location.hostname+"']),[href*='https://']:not([href*='"+location.hostname+"'])").addClass("external").attr("target","_blank");

});
