var QuickMenu = Class.create({

	html : null, //objeto HTML que contiene TODO
	minY : 125, //altura apartir de la cual trabajo con acoplar o no el menu
	parent : null,
	left : false,
	
	unread : null,
	
	autoBind : ["_onScroll"],
	
	initialize : function()
	{
		ncore.autoBind(this);
		var m = $$("div.QuickMenu");
		if(!m.length) return;
		this.html = m[0];
		this.parent = this.html.up();
		Event.observe(window, 'scroll', this._onScroll_bind);

		this._onScroll();
	},
	
	_onScroll : function($e)
	{
		var offsetY = document.viewport.getScrollOffsets()[1];
		
		if(offsetY > this.minY)
		{
			this.html.setStyle({marginTop:(offsetY + 5) + "px"});
		}
		else
		{
			this.html.setStyle({marginTop:this.minY + "px"});
		}
	},
	
	show : function() { this.html.show(); },
	hide : function() { this.html.hide(); },
	
	cerrar : function()
	{
		Event.stopObserving(window, 'scroll', this._onScroll_bind);
	}	
});