

function HoverImage(img)
{
    img.src = img.src.replace(".gif", "Hover.gif");
}

function UnHoverImage(img)
{
    img.src = img.src.replace("Hover.gif", ".gif");
}

//JS to fix popup menu function in IE/Win

PrepareMenu = function()
{
    var MenuRoot = document.getElementById("MenuBar");
    PrepareList(MenuRoot,0);
}

function PrepareList(MenuNode,Iteration)
{   
    for (var Index = 0; Index < MenuNode.childNodes.length; Index++)                
    {              
	    var MenuList = MenuNode.childNodes[Index];      
	    if (MenuList.nodeName == "UL")            
	    {				
		    for(var ItemIndex = 0; ItemIndex < MenuList.childNodes.length; ItemIndex++)
		    {
			    var MenuItem = MenuList.childNodes[ItemIndex];
			    if (MenuItem.nodeName == "LI")
			    {
				    MenuItem.onmouseover=function(){ this.className += " IEHover"; }     
				    MenuItem.onmouseout=function(){ this.className = this.className.replace(" IEHover", ""); }  
					
				    //Recursively check sub items.
				    if(Iteration < 20) //Overflow protection check
					    PrepareList(MenuItem,Iteration + 1);
			    }
		    }
	    }
    }          
}   
window.onload=PrepareMenu; 
