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;
}

/* kind of hacked at this to make it work for prairiefairydesigns */
function setFooter() {
    if (document.getElementById) {
        var windowHeight = getWindowHeight();
        if (windowHeight > 0) {
            var contentHeight = document.getElementById('wrapper').offsetHeight;
            var footerElement = document.getElementById('footer');
            var footerHeight  = footerElement.offsetHeight;
           
            var footerTop = windowHeight - (contentHeight + footerHeight);
            //console.log("footerTop=%s",footerTop);
            //stick at bottom of content
            //alert("localBrowser="+localBrowser+"localVersion="+localVersion);
            totalHeight = contentHeight + footerHeight;
            //alert("totalHeight="+totalHeight+"contentHeight="+contentHeight+"footerHeight="+footerHeight);
            footerTop = contentHeight;
            
            if(localBrowser == 'MSIE')
            {
                footerTop = totalHeight + (localVersion > 6 ? 40 : 110);
                //alert("totalHeight="+totalHeight+" footerTop="+footerTop);
                totalHeight = totalHeight + footerHeight;   //wtf is going on now?
                //alert("totalHeight is now"+totalHeight);
            }
           
            if (footerTop >= 0) {
                
                footerElement.style.top = footerTop + 'px';
                //alert("setting background height to "+totalHeight);
                document.getElementById('background').style.height = totalHeight + 'px';
                
            }
            
        }
    }
}
window.onload = function() {
    setFooter();
}
window.onresize = function() {
    setFooter();
}

