

function menuFader()	{
	/* check the browser is capable of recognising the DOM objects
	   we need to implement the script - otherwise return false and allow the normal link to be executed */
	   
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById("coursenav")) return false;
	
	
	/* get the reference to the stocknav object and then create an array 
	   of all the <a> tags found in the array. To each tag assign a function to
	   the onmouseover and onmouseout events - which calls the fadeImage and restoreImage functions. */	
	
	var menu = document.getElementById("coursenav");
	var menulinks = menu.getElementsByTagName("a");
		for(i = 0; i < menulinks.length; i++) {
		
			menulinks[i].onmouseover = function() {
										

				return fadeImage(this)		
		
			}
			
			
			menulinks[i].onmouseout = function() {
			
				return restoreImage(this)		
					
			}
			
			
			
		}
}


function fadeImage(thisElement)	{

	 	
			
				//alert(thisElement.getAttribute("name"))

			thisElement.firstChild.nodeValue = "Course Information"
			thisElement.style.color = "#FFFFFF"
			thisElement.parentNode.style.backgroundImage = "url(images/blue_" + thisElement.getAttribute("name") + "_gradient.jpg)"			
			
			//alert("url(images/blue_" + thisElement.getAttribute("class") + "_gradient.jpg)")
			
			
			//thisElement.parentNode.style.backgroundImage = "url(images/blue_right_gradient.jpg)"			
			
			
			
			//alert(thisElement.parentNode.nodeName)
}


function restoreImage(thisElement)	{


			thisElement.firstChild.nodeValue = thisElement.getAttribute("alt")
			thisElement.style.color = "#625131"
			thisElement.parentNode.style.backgroundImage = "url(images/" + thisElement.getAttribute("name") + "_gradient.jpg)"			

}
