var activeLink_onload 
if ( window.onload )
{
	activeLink_onload = window.onload
}

window.onload = activateLink
function activateLink()
{
	
var hostname = window.location.hostname;
hostname = hostname.replace("www.","").toLowerCase();
var a = document.getElementsByTagName("a");	

this.check = function(obj){
		var href = obj.href.toLowerCase();
		return (href.indexOf("http://")!=-1 && href.indexOf(hostname)==-1) ? true : false;
	};
	this.set = function(obj){
		obj.target = "_blank";
		obj.className = "external";
	};	
	for (var i=0;i<a.length;i++){
		if(check(a[i])) set(a[i]);
	};



	var currentPath = document.location.pathname
	var splitPath = currentPath.split("/")

	var re = new RegExp(splitPath[1])
	

	
	var subNav = document.getElementById("navigation")
	if (subNav)
	{
		var links = subNav.getElementsByTagName("A")
		
		if (re != "/(?:)/") {
		for (var c=0; c<links.length; c++)
		{
			//just need to match the path from above(where we are now) to one of the classes
			if (re.test(links[c].href)) links[c].parentNode.className="active"

		}}
		else
		{
		for (var c=0; c<links.length; c++)
		{
			
		
			
			//just need to match the path from above(where we are now) to one of the classes
			if (links[c].parentNode.className == "home") links[c].parentNode.className="active"

		}
		}
		
		
		
		
		
		
	}
	if (activeLink_onload)
	{
		activeLink_onload()
	}
}






