/*
    Base Page object for all pages and templates in the site
*/

Site.Page = Class.create
(
    Helpers.Base,    
    {
        initialize: function($super) 
        {
            $super(); // call the base handler
            
            Event.observe(document, 'dom:loaded', this.bound("domOnLoad"));
            Event.observe(window, 'load', this.bound("windowOnLoad"));
            Event.observe(window, 'unload', this.bound("windowOnUnload"));
        },

        destroy: function()
        {
            this.popups.destroy();
        },
        
        domOnLoad: function(event) 
        {
            this.popups = new Behaviours.Popup($$("a.popup"), "popup", "width=640,height=480,left=c,top=c");
            this.popupVideos = new Behaviours.Popup($$("a.popup_video"), "popup", "width=640,height=520,left=c,top=c");
        },
        
        windowOnLoad: function(event) 
        {
            
        },
        
        windowOnUnload: function(event)
        {
            /*
                This is the place to clean up anything.
            */
            this.destroy();
        }
    }
);