$(document).ready(function() {
	// set same height on all boxes in products listing
	$("#products > div").each(function(i, div) {
		var nameHeight = 0;
		var perexHeight = 0;
		var mainInfoHeight = 0;
		$(div).find(".prod1").each(function(j, box) {
			if ($(box).find(".name").height() > nameHeight) {
				nameHeight = $(box).find(".name").height();
			}
			if ($(box).find(".shortDesc").height() > perexHeight) {
				perexHeight = $(box).find(".shortDesc").height();
			}
			if ($(box).find(".mainInfo").height() > mainInfoHeight) {
				mainInfoHeight = $(box).find(".mainInfo").height();
			}
		});

		$(div).find(".prod1 .name").height(nameHeight);
		$(div).find(".prod1 .shortDesc").height(perexHeight);
		$(div).find(".prod1 .mainInfo").height(mainInfoHeight);

		var boxHeight = 0;
		var imgCount = 0;
		$(div).find(".prod1").each(function(j, box) {
			if ($(box).height() > boxHeight) {
				boxHeight = $(box).height();
			}
			if ($(box).children('.listCampanings').size() == 1) {
				imgCount = $(box).children('.listCampanings').children().size()
			}

			if (imgCount == 1 && $(".listCampanings").height() < 30) {
				//boxHeight = boxHeight + 10
			}
			if (imgCount == 2 && $(".listCampanings").height() < 30) {
				//boxHeight = boxHeight + 12
			}
			if (imgCount > 2 && $(".listCampanings").height() < 30) {
				//boxHeight = boxHeight + 25
			}
			if (imgCount > 4 && $(".listCampanings").height() < 30) {
				//boxHeight = boxHeight + 17
			}
		});

		$(div).find(".prod1").height(boxHeight);
	});
	
	$("#paramsTable").highlighter();
});
