var Nav = Class.extend({
	init: function(){
	    trace('Nav init');
	    
	    this.tasks = [];
	    this.logged_in_user = {};
	    
	    this.pages = {
	        HOME: { 
	            view: HomeView, 
	            tag: 'home',
	            menu: 'home'
	        },
	        AGENCY: {
	            view: AgencyView, 
	            tag: 'agency',
	            menu: 'agency'
	        },
	        PORTFOLIO: { 
	            view: PortfolioView, 
	            tag: 'portfolio',
	            menu: 'portfolio'
	        },
	        CLIENT: { 
	            view: ClientView, 
	            tag: 'clients',
	            menu: 'clients'
	        },
	        FAQ: { 
	            view: FaqView, 
	            tag: 'faq',
	            menu: 'faq'
	        },
	    };
	    this.current_page = null;
	},
	
	get_page: function(page_id){	    
	    for(var page in this.pages){
            if(this.pages[page].tag == page_id){
                return this.pages[page];
            }
        }
	    return null;
	},
	
	to: function(page_id){
	    trace('Nav to ' + page_id);
	    page = this.get_page(page_id);

	    this.current_page = page;
	    this.set_active_menu_item();

	    if(!page.view){
	        trace('view undefined');
	        return;
	    } 

	    this.current_view = new page.view();
	    this.current_view.render();
	},
	
	set_active_menu_item: function(){
	    if(this.current_page && this.current_page.menu){
	        //$("ul#main-menu li." + this.current_page.menu + " a").addClass("active");
	    }
	}
});
