﻿//
// Site-wide JavaScript
//

var Site = {

    popup: null,
    
    //
    // showMore() : Reveal "More" content area.
    //
    showMore: function () {

        //
        // Hide "show more" link.
        //
        Ext.get("MoreLink").fadeOut();

        //
        // Scale clip area size to same height
        // as hidden content (revealing all).
        //
        Ext.get("MoreClipper").scale(undefined, Ext.get("MoreContent").getHeight(), {
            duration: 2,
            callback: function() {
            }
        });
        
    },
    
    hidePopup: function() {
        if (this.popup) {
            this.popup.hide();
        }
    },
    
    //
    //
    //
    showPopup: function() {
        if (!this.popup) {
            this.popup = new Ext.BasicDialog("PopupMessage", {            
                modal: true,
                shadow: true,
                draggable: false,
                collapsible: false,
                closable: false,
                resizable: false,
                autoScroll: false
            });
            this.popup.addKeyListener(27, this.popup.hide, this.popup);
        }
        this.popup.show("PopupLink");
    }

};

/*
function doFadeIn(e, o){
    var ee = Ext.get(e);
    var el = ee.getFxEl();
    o = o || {};
    el.queueFx(o, function(){
        this.fixDisplay();
        this.dom.style.visibility = 'visible';
        var to = o.endOpacity || 1;
        arguments.callee.anim = this.fxanim({opacity:{to:to}},
            o, null, .5, "easeOut", function(){
            if(to == 1){
                this.clearOpacity();
            }
            el.afterFx(o);
        });
    });
    return ee;
}

function doFadeOut(e, o) {
    var ee = Ext.get(e);
    var el = ee.getFxEl();
    o = o || {};
    el.queueFx(o, function(){
        arguments.callee.anim = this.fxanim({opacity:{to:o.endOpacity || 0}},
            o, null, .5, "easeOut", function(){
            el.afterFx(o);
        });
    });
    return this;
}
*/

