// JavaScript Document
$ ( document ) .ready ( function ( ){
//$(function() {

	// Make the last div in each row have no right margin.
	//$(".box-producto:nth-child(5n+1)").css("margin-right","0px");
	
	// Hide the links  (Done BEFORE height measured)
	$(".box-producto a").hide();
	
	// Make each div as tall as the tallest div
	var maxHeight = 0;
	var books = $(".box-producto");
		
books
		.each(function() {
			if ($(this).height() > maxHeight) { maxHeight = $(this).height(); }
			$(this).css("color", "#000000");
		})
		
		.height(maxHeight)
			
		// Give the.box-productos a hover effect (Add class plus handle opacity part with jQuery)
		.hover(function() {
		   $(this)
				.addClass("hover")
				.css("color", "#006699");
		}, function() {
		   $(this)
				.removeClass("hover")
				.css("color", "#000000");
		})
		
		// Make the.box-productos clickable
		.click(function() {
			window.location = $(this).find("a").attr("href");
		});

});
