
function navigationboxLoadHover()
{
	var a = document.getElementsByTagName('ul');

	for(var i = 0; i < a.length; i++)
	{
		if(a[i].className == 'navigationbox')
		{
			a[i].className += ' layer_0';

			var iCount = 0;
			for(var j = 0; j < a[i].childNodes.length; j++)
			{
				if((a[i].childNodes[j].nodeType == 1) && (a[i].childNodes[j].tagName.toLowerCase() == 'li'))
				{
					a[i].childNodes[j].onmouseover = function()
					{ 
						if( this.className.indexOf('nav_') != -1 )
						{
							var m = new RegExp(/nav_(\d+)/).exec(this.className);
							this.className += ' hover_0 hover_' + m[1];
						}
						else
						{
							this.className += ' hover_0';
						}
					}
										
					a[i].childNodes[j].onmouseout = function()
					{ 
						if( this.className.indexOf('nav_') != -1 )
						{
							var m = new RegExp(/nav_(\d+)/).exec(this.className);
							this.className = __trim(__str_replace('hover_0 hover_' + m[1], '', this.className));
							
						}
						else
						{
							this.className = __trim(__str_replace('hover_0', '', this.className));
						}
					}

					__fixHover_ul(a[i].childNodes[j], 1, iCount);

					iCount++;
				}
			}
		}
	}
}

function __fixHover_li(f_UL, f_layer)
{
	var iCount = 0;

	for(var i = 0; i < f_UL.childNodes.length; i++)
	{
		if((f_UL.childNodes[i].nodeType == 1) && (f_UL.childNodes[i].tagName.toLowerCase() == 'li'))
		{
			if(f_layer == 1)
			{
				f_UL.childNodes[i].onmouseover = function() { this.className += ' hover_1'; }
				f_UL.childNodes[i].onmouseout = function() { this.className = __trim(__str_replace('hover_1', '', this.className)); }
			}
			else if(f_layer == 2)
			{
				f_UL.childNodes[i].onmouseover = function() { this.className += ' hover_2'; }
				f_UL.childNodes[i].onmouseout = function() { this.className = __trim(__str_replace('hover_2', '', this.className)); }
			}
			else if(f_layer == 3)
			{
				f_UL.childNodes[i].onmouseover = function() { this.className += ' hover_3'; }
				f_UL.childNodes[i].onmouseout = function() { this.className = __trim(__str_replace('hover_3', '', this.className)); }
			}
			else if(f_layer == 4)
			{
				f_UL.childNodes[i].onmouseover = function() { this.className += ' hover_4'; }
				f_UL.childNodes[i].onmouseout = function() { this.className = __trim(__str_replace('hover_4', '', this.className)); }
			}
			else if(f_layer == 5)
			{
				f_UL.childNodes[i].onmouseover = function() { this.className += ' hover_5'; }
				f_UL.childNodes[i].onmouseout = function() { this.className = __trim(__str_replace('hover_5', '', this.className)); }
			}
			else if(f_layer == 6)
			{
				f_UL.childNodes[i].onmouseover = function() { this.className += ' hover_6'; }
				f_UL.childNodes[i].onmouseout = function() { this.className = __trim(__str_replace('hover_6', '', this.className)); }
			}
			else if(f_layer == 7)
			{
				f_UL.childNodes[i].onmouseover = function() { this.className += ' hover_7'; }
				f_UL.childNodes[i].onmouseout = function() { this.className = __trim(__str_replace('hover_7', '', this.className)); }
			}
			else if(f_layer == 8)
			{
				f_UL.childNodes[i].onmouseover = function() { this.className += ' hover_8'; }
				f_UL.childNodes[i].onmouseout = function() { this.className = __trim(__str_replace('hover_8', '', this.className)); }
			}
			else if(f_layer == 9)
			{
				f_UL.childNodes[i].onmouseover = function() { this.className += ' hover_9'; }
				f_UL.childNodes[i].onmouseout = function() { this.className = __trim(__str_replace('hover_9', '', this.className)); }
			}

			// Fix inner UL items
			__fixHover_ul(f_UL.childNodes[i], f_layer + 1, iCount);

			iCount++;
		}
	}
}

function __fixHover_ul(f_LI, f_layer, f_index)
{
	for(var i = 0; i < f_LI.childNodes.length; i++)
	{
		if((f_LI.childNodes[i].nodeType == 1) && (f_LI.childNodes[i].tagName.toLowerCase() == 'ul'))
		{
			f_LI.childNodes[i].className += ' layer_' + f_layer;

			if(f_layer > 1)
			{
				f_LI.childNodes[i].className += ' index_' + f_index;
			}

			// Fix inner LI items
			__fixHover_li(f_LI.childNodes[i], f_layer);
		}
	}
}

function __str_replace(needle, replace, haystack)
{
	var result = '';
	var index = 0;

	while((index = haystack.indexOf(needle)) > -1)
	{
		result += haystack.substring(0, index);
		result += replace;
		haystack = haystack.substring(index + needle.length)
	}

	return result + haystack;
}

function __trim(string)
{
	return string.replace(/^\s*/, '').replace(/\s*$/, '');
}
<!-- Server time: 0.1045 s -->