function getWindowHeight() {    var windowHeight = 0;    if (typeof(window.innerHeight) == 'number') {        windowHeight = window.innerHeight;    }    else {        if (document.documentElement && document.documentElement.clientHeight) {            windowHeight = document.documentElement.clientHeight;        }        else {            if (document.body && document.body.clientHeight) {                windowHeight = document.body.clientHeight;            }        }    }    return windowHeight;}function refreshcoll() {    if (document.getElementById) {        var windowHeight = getWindowHeight();        if (windowHeight > 0) {                        var contensElement = document.getElementById('contens');            var contensHeight = contensElement.offsetHeight;            var footerElement = document.getElementById('footer');            var footerHeight  = footerElement.offsetHeight;            var menuElement = document.getElementById('menu');            var menuHeight  = menuElement.offsetHeight;            var linksElement = document.getElementById('links');                                    //alert('contensHeight = ' + contensHeight + '. footerHeight = ' + footerHeight + '. menuHeight = ' + menuHeight);                        //alert(windowHeight - (contensHeight + footerHeight + menuHeight));                        var veticalMargin = ((windowHeight - (contensHeight + footerHeight + menuHeight))/2)-75;                        if (veticalMargin >= 0)             {                                                 contensElement.style.top = veticalMargin + 'px';                linksElement.style.top = veticalMargin + 'px';                footerElement.style.top = windowHeight-footerHeight + 'px';                                //alert(document.getElementById('contens').style.top)                            }            else                         {                contensElement.style.top = '0px';                linksElement.style.top = ' 0px';;                                if(windowHeight-footerHeight >= 660){                footerElement.style.top = windowHeight-footerHeight + 'px';                                }                else                {                footerElement.style.top = 660 + 'px';                     }            }                   }              }}window.onload = function() {refreshcoll();}window.onresize = function() {refreshcoll();}