Notify = new Class({
    notify_messages: {
        signout_complete: ['notice',"You have been successfully signed out. Thank you for visiting Wine Cellar."],
        invalid_activation_key: ['error',"Porfolio not activated; invalid key. Please try activation again, or contact Wine Cellar directly if the problem persists."],
        portfolio_successfully_activated: ['notice',"You have successfully activated your portfolio. You may now sign into you Wine Cellar portfolio."],
        invalid_password_key: ['error',"Password not reset; invalid key. Please try again by clicking 'forgot password?'."],
        password_successfully_changed: ['notice',"You password has successfully been reset. Check you mail inbox for your new password."]
    },
    
    initialize: function () {
        this.data = new URI().get('data');
        
        if (this.data.notify!=null && this.notify_messages[this.data.notify]!=null) {
            cls = this.notify_messages[this.data.notify][0];
            msg = '<div class="'+cls+'">'+this.notify_messages[this.data.notify][1]+'</div>';
            
            overlay = new Overlay(document.body, {
                onClick: function () { this.close(); },
                onShow: function () { (function(){this.close()}.bind(this)).delay(5000) }
            });
            
            info = new Element('div',{'id':"notify",'html':msg})
            info.set('html',msg);
            info.inject(overlay.overlay)
            
            overlay.open();
        }
    }
});

