function ct() {
return document.compatMode == "BackCompat" ? document.body.clientHeight : document.documentElement.clientHeight;
}
var f = document.getElementsByClassName('footer')[0];
(window.onresize = function () {
f.style.position = document.body.scrollHeight > ct() ? '' : 'absolute';
})();