var DropdownMenu = function() {
	this.initialize = function(el1) {
		if(el1) {
			$(el1).children().each(function(i,el2) {
				if(el2.tagName.toLowerCase() == 'li') {
					$(el2).children().each(function(j,el3) {
						if(el3.tagName.toLowerCase() == 'ul') {
							var mouseover = (($.browser.msie) ? 'mouseenter' : 'mouseover');
							var mouseout = (($.browser.msie) ? 'mouseleave' : 'mouseout');
							$(el2).bind(mouseover,function() {
								if($(el3).css('height') == '1px') {
									$(el3).css({
										'opacity': 0,
										'display': 'block'
									});
								};
								$(el3).stop();
								$(el3).animate({
									'opacity': 1,
									'height': 99
								}, 300);
							});
							$(el2).bind(mouseout,function() {
								$(el3).stop();
								$(el3).animate({
									'opacity': 0,
									'height': 1
								}, {
									'complete': function() {
										if($(el3).css('height') == '1px') $(el3).css('display','none');
									},
									'duration': 300
								});
							});
							new DropdownMenu().initialize(el3);
						};
					});
				};
			});
		};
	};
};

$(document).ready(function() { new DropdownMenu().initialize($('#menu ul').get([0])); });