// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// style.js
//
// copyright (c) 2006 drow <drow@bin.sh>
// all rights reserved.

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// resize content

function col_height () {
  var wh = window_height();
  var header = document.getElementById('header');
  var nav = document.getElementById('nav');
  var hn = header.offsetHeight + nav.offsetHeight;
  var content = document.getElementById('content');
  var ads = document.getElementById('ads');

  if (ads.offsetHeight < wh) {
    var pad = wh - ads.offsetHeight;
    ads.style.paddingBottom = pad + 'px';
  }
  if (content.offsetHeight < (ads.offsetHeight - hn)) {
    var pad = (ads.offsetHeight - hn - content.offsetHeight);
    content.style.paddingBottom = pad + 'px';
  } else {
    var pad = (content.offsetHeight + hn - ads.offsetHeight);
    ads.style.paddingBottom = pad + 'px';
  }
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// window height

function window_height () {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.documentElement
    && document.documentElement.clientHeight
  ) {
    return document.documentElement.clientHeight;
  } else if (document.body && document.body.clientHeight) {
    return document.body.clientHeight;
  }
  return 0;
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

