var NavPop = Class.create({
	
	initialize: function(obj,ctrl)
	{
		this.navPop = Element.extend(obj);
		this.navPop.style.visibility = "visible";
		this.controller = ctrl;
		this.navPop.hide();
		
		this.contentSections = this.navPop.childElements();
		
		var i = 0;
		var len = this.contentSections.length;
		for(i;i<len;i++){
			this.contentSections[i].hide();
		}
		Event.observe(this.navPop,'mouseout',this.handleOut.bindAsEventListener(this));
	},
	
	on: function(ni,isRollOver)
	{
		this.activeItem = ni;
		if(this.activeDiv){
			this.activeDiv.hide();
		}
		var id = ni.id.split('nav_')[1];
		this.activeDiv = Element.extend($('navPop_'+id));
		if(isRollOver) this.navPop.setStyle({left:ni.cumulativeOffset().left+20+'px'});
		this.navPop.show();
		this.activeDiv.show();
		
		this.menuItems = this.activeDiv.getElementsByClassName('section')[0].childElements();
		
		var i = 0;
		var len = this.menuItems.length;
		for(i;i<len;i++){
			Event.observe(this.menuItems[i],'mouseover',this.itemOver.bindAsEventListener(this));
			Event.observe(this.menuItems[i],'mouseout',this.itemOut.bindAsEventListener(this));
		}
	},
	
	off: function(ni)
	{
		this.navPop.hide();
	},
	
	itemOver: function()
	{
		//maSite.hoverThumb.enable();
	},
	
	itemOut: function()
	{
		//maSite.hoverThumb.disable();
	},
	
	handleOut: function()
	{
		//this.navPop.hide();
		//this.controller.closeNav();
	}
	
});