var EAProdLoop = {};
EAProdLoop.numProds = 0;	//default value for number of products on the page
EAProdLoop.setHeight = function () {
	var d = document;
	var box;
	
	if (EAProdLoop.numProds != 0) {
		//No need to resize the prod boxes on the last line if there's only one product
		if (EAProdLoop.numProds % 2 != 0) {
			EAProdLoop.numProds = EAProdLoop.numProds - 1;
		}
		box = new Array(EAProdLoop.numProds);
		for (var i = 0;i < EAProdLoop.numProds;i++) {
			box[i] = "prod" + i;
		}
	}

	for(var x = 0;x < EAProdLoop.numProds;x++)//determine the tallest div
	{
		if (x == 0 || x % 2 == 0) {
			h = d.getElementById(box[x]).offsetHeight;
			h2 = d.getElementById(box[x+1]).offsetHeight;
			if (h2 > h) {
				h = h2;
			}
			d.getElementById(box[x]).style.height = h + "px";
			d.getElementById(box[x+1]).style.height = h + "px";
		}
	}
}

//Launches setHeight() on page load
Event.observe(window,"load",EAProdLoop.setHeight);