<public:component>
<script language="javascript">
	
	/* $Id: menu.htc 12 2010-08-11 16:32:18Z mb $ */
	
	var Menu = function(el)
	{
		this.initList(el, 0)
	}

	Menu.prototype =
	{
		initList: function(node, level)
		{
			do
			{
				switch (node.tagName)
				{
					case 'LI':
						this.initNode(node, level)
						break
			
					case 'UL':
						level++
						break
				}
				if (node.firstChild)
				{
					this.initList(node.firstChild, level)
				}
			}
			while (node = node.nextSibling)
			
			level--
		},

		initNode: function(node, level)
		{
			this.whiteSpace(node)
			
			node.onmouseover = function()
			{
				if (this.lastChild && this.lastChild.tagName == 'UL')
				{
					this.lastChild.style.display = 'block'
				}
				this.className = this.className.replace(/\s*hover/, "") + " hover";
			}
			
			node.onmouseout = function()
			{
				if (this.lastChild && this.lastChild.tagName == 'UL')
				{
					this.lastChild.style.display = ''
				}
				this.className = this.className.replace(/\s*hover/, "");
			}
		},
		
		whiteSpace: function(el)
		{
			var i = 0
			
			do
			{
				if (el.childNodes[i] && el.childNodes[i].nodeType == 3 && !/\S/.test(el.childNodes[i].nodeValue))
				{ el.removeChild(el.childNodes[i]) }
			}
			while (el.childNodes[++i])
			
			return el
		}
	}
	
	if (element)
	{
		new Menu(element);
	}
	

</script>
</public:component>