﻿namespace('nnet');

nnet.Page = $j.klass({
    initialize: function() {
        this.Title = null;
        this.Description = null;
        //this.Header = null;
        nnet.onApplicationChanged.subscribe(
            function(type, args, me) {
                try {
                    me.setTitle(args[0].PageTitle);
                } catch (e) { logE("Page.onApplicationActivated handler", e); }
            }, this
        );
    },

    setTitle: function(title) {
        if (title != undefined) {
            this.Title = title;
            document.title = title;
        } else {
            this.Title = sVars.DefaultTitle;
            document.title = this.Title;
        }
    },

    setDescription: function(description) {
        if (description != undefined) {
            this.Description = description;
            $j("meta[name=Description]").attr("content", description);
        } else {
            this.Description = sVars.DefaultDescription;
            $j("meta[name=Description]").attr("content", this.Description);
        }
    }
});


