window.onload = set_footer;window.onresize = set_footer;function set_footer () {  if (!document.getElementById || !document.body.offsetHeight) return;  var footer_width = 800;  var footer_height = 185;  var footer = document.getElementById('footer');  var magin_top = footer.style.marginTop ? parseInt(footer.style.marginTop) : footer_height;  var window_height = typeof(window.innerHeight) == 'number' ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : (document.body && document.body.clientHeight) ? document.body.clientHeight : 0;  var content_width = document.getElementById('body').offsetWidth;  var content_height = document.getElementById('body').offsetHeight;  if (content_width < footer_width) {    if  (typeof footer.style.width != 'undefined' && typeof footer.style.width == 'string'){      footer.style.width = footer_width + 'px';    } else if (typeof footer.style.pixelWidth != 'undefined') {      footer.style.pixelWidth = footer_width; + 'px';    }  } else {    if  (typeof footer.style.width != 'undefined' && typeof footer.style.width == 'string'){      footer.style.width = content_width + 'px';    } else if (typeof footer.style.pixelWidth != 'undefined') {      footer.style.pixelWidth = content_width; + 'px';    }  }  var footer_margin_top = content_height <= window_height ? window_height - content_height : footer_height;  if (footer_margin_top > footer_height) {    footer_margin_top -= footer_height;    footer.style.marginTop = footer_margin_top + 'px';  }}
