var DropDown = Class.create ({
	
	initialize: function(container)
	{		
		//DROPDOWN
		this.dropdown = container;
		
		//get height
		this.dropdownHeight = 0;
		
		this.dropdown.select('a').each(function(container)
		{			
			this.dropdownHeight = this.dropdownHeight + 31;
		}.bind(this));
		
		//position absolute, set size
		this.dropdown.setStyle({position: "absolute", top: "22px", right: "5px", height: "31px", overflow: "hidden"});

		//on hover show other links
		this.dropdown.observe("mouseenter", this.showDropdown.bind(this));
		
		//off hover hide other links
		this.dropdown.observe("mouseleave", this.hideDropdown.bind(this));
	},
	
	showDropdown: function()
	{				
		new Effect.Morph(this.dropdown, {
			style: "height: " + this.dropdownHeight + "px;",
			duration: 0.2
		});
	},
	
	hideDropdown: function()
	{	
		new Effect.Morph(this.dropdown, {
			style: "height: 31px;",
			duration: 0.2
		});
	}
});


document.observe('dom:loaded', function()
{	
	if ($("dropDown"))
	{
		new DropDown($('dropDown'));
	}
});
