jQuery(document).ready(function($){
	
	// Makes placeholder work in IEs
	$('[placeholder]').focus(function() {
		var input = $(this);
		if (input.val() == input.attr('placeholder')) {
			input.val('');
			input.removeClass('placeholder');
		}
	}).blur(function() {
		var input = $(this);
		if (input.val() == '' || input.val() == input.attr('placeholder')) {
			input.addClass('placeholder');
			input.val(input.attr('placeholder'));
		}
	}).blur().parents('form').submit(function() {
		$(this).find('[placeholder]').each(function() {
			var input = $(this);
			if (input.val() == input.attr('placeholder')) {
				input.val('');
			}
		})
	});
	
	$('#slide-nav a').addClass('png');
	
	$('ul.ProductList li:nth-child(3n)').addClass('lastProduct');
	$('#SideProductRelated .ProductList li:nth-child(4n)').addClass('lastProduct');
	$('#SideProductRelated .ProductList li:nth-child(5n)').hide();
	// equalHeight($(".ProductImage"));
	equalHeight($(".top-product"));
	equalHeight($("#SideProductRelated .ProductImage"));

});

function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
