// Navigation

$(document).ready(function(){
	// Get body ID
	var parentID=$('body').attr('id');
	// loop through nav list items
	$('#menu li').each(function(){
	//compare IDs of the body and list-items
	var myID=$(this).attr('id');
	
	if (myID==parentID){
		// for active menu point
		
		var activeImage=$(this).children('a').children('img').attr('src','images/btn_'+myID+'RO.jpg'); 
		
		$(this).children('a').children('img').append.activeImage;
		}
	
	//only performs the change on hover of IDs that don't match, so that the active button remains the same
	if (myID!=parentID){

	$(this).children('a').hover(function(){
			//gets new image
			var newImage=$(this).children('img').attr('src','images/btn_'+myID+'RO.jpg'); 
			//get image and fade it out
			$(this).stop().children('img').append.newImage; },
										 
			function(){
			//gets old image
			var oldImage=$(this).children('img').attr('src','images/btn_'+myID+'.jpg'); 
			//get image and fade it out
			$(this).stop().children('img').append.oldImage; 
										 });	
						}
								
								
								//end of roll over function
								})
		   
						 //end of ready function
						 }
			   )
