/*
    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 code prevents memory leaks in IE 6 
                
                It looks like Prototype 1.6.0.3 will fix this issue and this code may not be needed then :) 
            */
            this.popups.destroy();
        },
        
        domOnLoad: function(event) 
        {
            this.popups = new Widgets.PopupLink($$('a.popup'), "popup", "width=605px,height=670,top=c,left=c");
        },

        windowOnLoad: function(event) 
        {

        },
        
        windowOnUnload: function(event)
        {
            this.destroy();
        }
    }
);