/* 
 * Hovers li's in IE as it does not support CSS hovers on LI tags 
 * Requires the hover style to also apply to the class .over 
*/
function assignHoverNav()
{
	var ul = null;
	var li = null;
	var index = 0;
	var menu = document.getElementById('d-nav');
	if (!menu) menu = document.getElementById('d-nav');
	if (!menu) return false;

	ul = menu.getElementsByTagName("li");
	if (!ul) return false;

	for(index=0;index<ul.length;index++)
	{
		li = ul[index];
		// Skip li's without a submenu 
		if (!li.childNodes[2]) continue;

		li.onmouseover = function () 
		{
			this.className += " over";
		}

		li.onmouseout = function ()
		{
			this.className = this.className.replace(" over", "");
		}
	}
}

// Add to onload events

if (attachEvent) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') window.onload = assignHoverNav;
  else window.onload = function() { if (oldonload) { oldonload(); } assignHoverNav(); };
}
