var oldHandler = window['onload']; // сохраняем старый onload (если есть)
window['onload'] = function() {
   if(typeof(oldHandler) == 'function') {
      oldHandler();
   }
   setHeight(); // наша функция
};
function setHeight() {
   var b1 = document.getElementById('block-one');
   var b2 = document.getElementById('block-two');
   if (!b1 || !b2) return;
   var h1 = b1.offsetHeight;
   var h2 = b2.offsetHeight;
   if (h1 > h2) {
      b2.style.height = (h1 - 180) + 'px';
      b1.style.height = (h1 - 10) + 'px';
   }else if (h1 < h2) {
      b1.style.height = (h2 - 10) + 'px';
      b2.style.height = (h2 - 20) + 'px';
   }
}