﻿HOMEPAGE = {
	init: function () {

		this.equalize_three_boxes();

	},

	equalize_three_boxes: function () {
		var root = $('three_boxes'),
		x, boxes, box, maxHeight = 0;

		boxes = Dom.getElementsByClassName('box', 'div', root);

		for (x = 0; x < boxes.length; x++) {
			box = Dom.getRegion(boxes[x]);
			box.el = boxes[x];
			box.height = box.bottom - box.top;
			boxes[x] = box;
			if (box.height > maxHeight) {
				maxHeight = box.height;
			}
		}

		maxHeight = parseInt(maxHeight, 11) + 'px';

		for (x = 0; x < boxes.length; x++) {
			Dom.setStyle(boxes[x].el, 'height', maxHeight);
		}

	}

};

Event.onDOMReady(HOMEPAGE.init, HOMEPAGE, true);

