/*
 * @author Cagdas Cubukcu
 * @param link_name string The name of the link in the navigation menu to be highlighted.
 * @param number integer Default: 1. If there are more than one link with the same link_name, the number of the link that is wanted to be highlighted should be passed by this parameter.
 */
function highlightLink(link_name, number){
	
	link_name 	= link_name.replace(/^\s+|\s+$/g, ''); // Trim string
	
	var links 	= document.getElementById("navigation").getElementsByTagName("a");
	
	var number	= (number == null) ? 1 : number; // Default value is 1
	var count 	= 1;
	
	var length 	= links.length;
	
	for (i=0; i<length; i++){
		
		if (links[i].innerHTML.replace(/^\s+|\s+$/g, '') == link_name){
			
			if (count == number){
				links[i].id = "active";
				break; // Exit the for loop
			}
			else {
				count++;
			}	
		}
	}
}
