/* Zbox stylez */
lightbox = {
    updateheight: function() {
        if (window.innerHeight && window.scrollMaxY) {
            var yWithScroll = window.innerHeight + window.scrollMaxY;
            var lightBoxOverlayHeight = yWithScroll;
        } else {
            var yWithScroll = document.body.scrollHeight;
            var yHeight = document.body.clientHeight;
            var lightBoxOverlayHeight = yWithScroll + yHeight;
        }
        e = $("#lightBoxOverlay");
        e.css('height', lightBoxOverlayHeight + 'px');
    },
    showPanel: function(containerId) {
        util.show(containerId);
        lightbox.updateheight();
    },
    show: function(containerId) {
        obj = $('#' + containerId);
        if (!obj) return;
        obj.show();
        
        var whatsTheWidth = (obj.offsetWidth) / 2;
        obj.css('margin-left', '-' + whatsTheWidth + 'px');

        var whatsTheHeight = (obj.offsetHeight) / 2;
        obj.css('margin-top', '-' + whatsTheHeight + 'px');

        lightbox.showPanel('lightBoxOverlay');
    },
    hidePanel: function(containerId) {
        util.hide(containerId);
    },
    hide: function() {
        lightbox.hidePanel('lightBox');
        lightbox.hidePanel('lightBoxOverlay');
    }
};
