﻿// JScript File
function MatchMaxDivHeight(arrDivs)
{ var intMaxHeight, intDivHeight;
  // initialize maximum height value
  intMaxHeight = 0;
  // iterate over all <div> elements in the document
  for(var intI = 0; intI < arrDivs.length; intI++)
  { // determine height for <div> element
    if(arrDivs[intI].offsetHeight)
    { intDivHeight = arrDivs[intI].offsetHeight;
    }
    else if(arrDivs[intI].style.pixelHeight)
    { intDivHeight = arrDivs[intI].style.pixelHeight;
    }
    // calculate maximum height
    intMaxHeight = Math.max(intMaxHeight, intDivHeight);
  }
  // assign maximum height value to all of container <div> elements
  for(var intI = 0; intI < arrDivs.length; intI++)
  { arrDivs[intI].style.height = intMaxHeight + 'px';
  }
}