var $$ = function(id) {
  return document.getElementById(id);
};

var $$$ = function(tagName, className) {
  var allTags = document.getElementsByTagName(tagName);
  var ret = new Array();
  for (var i = 0 ; i < allTags.length; i++) {
    if (allTags[i].className && allTags[i].className == className) {
	  ret.push(allTags[i]);
	}
  }
  return ret;
};

function checkColourBoxes() {
  var colours = $$$("DIV", "fh");
  var temp = new Array();
  for (var i = 0; i < colours.length; i++) {
	temp.push(colours[i]);
    if ((i + 1) % 2 == 0) {
	  var theHighest = 0;
	  for (var j = 0; j < temp.length; j++) {
	    if (temp[j].offsetHeight > theHighest) theHighest = temp[j].offsetHeight;
	  }
	  
	  for (var j = 0; j < temp.length; j++) {
	    temp[j].style.height = theHighest + "px";
	  }
	  temp = new Array();
	}
  }
}

if (window.attachEvent) { 
  window.attachEvent("onload", checkColourBoxes); 
} 
else {  
  window.addEventListener("load", checkColourBoxes, false); 
}
