/*	
	Script:   moo.dropdownmenu.js
	Source:	  http://forum.mootools.net/viewtopic.php?id=166
	Author:	  André Fiedler, <http://visualdrugs.net>
	License: 	MIT-style license.
*/

var DropdownMenu = new Class({	
	initialize: function(element)
	{
		$A($(element).childNodes).each(function(el)
		{
			if(el.nodeName.toLowerCase() == 'li')
			{
				$A($(el).childNodes).each(function(el2)
				{
					if(el2.nodeName.toLowerCase() == 'ul')
					{
						$(el2).fade('hide');
						el2.get('tween').options.duration = 250;
						
						el.addEvent('mouseover', function()
						{
							el2.fade('in');
							return false;
						});

						el.addEvent('mouseout', function()
						{
							el2.fade('out');
						});
						new DropdownMenu(el2);
					}
				});
			}
		});
		return this;
	}
});