// JavaScript Document


/* THE FOLLOWING JAVASCRIPT CODE COPYRIGHT OUTCROP GROUP & OUTCROP INTERACTIVE 2004 */

function navOn(){

url=location.toString(); 	/*Turns URL into a string*/

	if(url.search("the_lodge") != -1){			
		document.getElementById("the_lodge").className = "on";
	}
	else if(url.search("the_setting") != -1){			
		document.getElementById("the_setting").className = "on";
	}
	else if(url.search("packages") != -1){			
		document.getElementById("packages").className = "on";
	}
	else if(url.search("accommodation") != -1){			
		document.getElementById("accommodation").className = "on";
	}
	else if(url.search("activities") != -1){			
		document.getElementById("activities").className = "on";
	}
	else if(url.search("travel") != -1){			
		document.getElementById("travel").className = "on";
	}
	else if(url.search("gallery") != -1){			
		document.getElementById("gallery").className = "on";
	}
	else if(url.search("contact_us") != -1){			
		document.getElementById("contact_us").className = "on";
	}
	
	// SUB NAVIGATION
	
	// What is HIA?
	
	if(url.search("what_is_hia/what_is_health.html") != -1){			
		document.getElementById("what_is_health").className = "on";
	}
	else if(url.search("what_is_hia/business_case_health.html") != -1){			
		document.getElementById("business_case").className = "on";
	}
	else if(url.search("what_is_hia/hia_eia_sia.html") != -1){			
		document.getElementById("hia_eia_sia").className = "on";
	}
	else if(url.search("what_is_hia/comic.html") != -1){			
		document.getElementById("comic").className = "on";
	}
	
}


  // this function is needed to work around 
  // a bug in IE related to element attributes
  function hasClass(obj) {
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
  } 
