var SitePage = new Class({
    
    initialize: function(ctor, core){
        if(!ctor) return;
        this.ctor = ctor;
        this.core = core;
    },
    
    setPageTitle: function(){
        document.title = this.core.ctor.title + ' - ' + this.ctor.title;
    },
    
    configure: function(){
        this.ctor.config.call();
    },
    
    fillContentCallback: function(htmlContent){
        //$(this.ctor.id).innerHTML = htmlContent.utf8Decode();
        
        //Sys.Serialization.JavaScriptSerializer.deserialize = function(){eval('('+htmlContent+')');};
        $(this.ctor.id).innerHTML = htmlContent;
        
        
        //var rawData = Sys.Serialization.JavaScriptSerializer.deserialize(htmlContent, false);
        //alert(rawData);
        //$(this.ctor.id).innerHTML = rawData;
    },
    
    load: function(){
        this.core.dataAccess.getPageContent(this);
    },
    
    empty: function(){
        $(this.ctor.id).empty();
    },
    
    show: function(){
        $(this.ctor.id).show();
    },
    
    hide: function(){
        $(this.ctor.id).hide();
    },
    
    isLoaded: function(){
        return ($(this.ctor.id).hasChild($$(".content"))) ? true : false;
    },
    
    hasSubpages: function(){
        return (this.ctor.subpages) ? true : false;
    }
    
    
});

