/***************************************************************************
 *
 *   File      : /js/global.js
 *   Begin     : Friday, February 10, 2006
 *   Version   : 1.0
 *   Copyright : (C) 2005 AC-Creations
 *   Email     : juan@ac-creations.net
 *
 ***************************************************************************/

// ###########################################################################
// # Footer
// ###########################################################################

        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 setFooter() {
            if (document.getElementById) {
                    var windowHeight = getWindowHeight();
                    if (windowHeight > 0) {
                            var contentHeight = document.getElementById('container').offsetHeight;
                            var footerElement = document.getElementById('bottom');
                            var footerHeight  = footerElement.offsetHeight;
                            if (windowHeight - (contentHeight + footerHeight) >= 0) {
                                    footerElement.style.position = 'relative';
                                    footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
                            }
                            else {
                                    footerElement.style.position = 'static';
                            }
                    }
            }
        }
        window.onload = function() {
            setFooter();
        }
        window.onresize = function() {
            setFooter();
        }
        
// ###########################################################################
// # Suckerfish
// ###########################################################################
        
        sfHover = function() {
                var sfEls = document.getElementById("nav").getElementsByTagName("LI");
                for (var i=0; i<sfEls.length; i++) {
                        sfEls[i].onmouseover=function() {
                                this.className+=" sfhover";
                        }
                        sfEls[i].onmouseout=function() {
                                this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
                        }
                }
        }
        if (window.attachEvent) window.attachEvent("onload", sfHover);
