PARKWENG.ui.navigation.NavigationItemDrawer = new Class({
	Extends: NETVISION.ui.navigation.NavigationItemTweenDrawer,
	
	_pageId: null,
	
	initialize: function(el,config,navigation,classes) {
		this.parent(el,config,navigation,classes);
		
		this._pageId = this._getPageIdFromElementId();
		this._navigation = this._fetchNavigation();
	},
	
	show: function() {
		var left = this.element.getParent('li').getPosition(this.element.getParent('ul')).x;
		var bottom = this.element.getParent('li').getParent('ul').getSize().y;
		this.element.setStyles({"left": left,"bottom":bottom});
		this.parent();
	},
	
	hide: function() {
		this.parent();
	},
	
	_fetchNavigation: function() {
		var id = this._navigationClass+"_"+this._pageId;
		var el	 = $(this._navigationClass+"_"+this._pageId);
		
		if(null === el) {
			return null;
		}
		
		var	navi =  new NETVISION.ui.navigation.Navigation(el);
		var items = [];
		
		navi.getChildren('li').each(function(item){
			items.push(new NETVISION.ui.navigation.NavigationItem(item));
		});
		
		navi.setNavigationItems(items);
		
		navi.getNavigationItems();
		return navi;
	},
	
	
	_getPageIdFromElementId: function() {
		return this.element.id.substr(this.element.id.lastIndexOf('_')+1);
	}
});
