// JavaScript Document
function NavSetup() {
	
	var nav = (new getObj('nav')).obj;
	if(nav) {
		
		//LOCATE CURRENT LINK
		var currentLink = 'home';
		var location = document.URL.split('secure')[0];
		if(document.URL.split('secure')[1] != null) location = document.URL.split('secure')[1];

		var links = nav.getElementsByTagName("li");
		for(i=0;i<links.length;i++) {
			if(links[i].id && links[i].id.length>0 && location.match(links[i].id)) {
				currentLink = links[i].id;
				break;
			}
		}

		//SET CURRENT LINK STYLE
		var l = new getObj(currentLink);
		if(l.obj) {
			l.obj.className = 'current';
		}
			
	}
	
	var map = new getObj('map');
	if(map.obj && window.attachEvent) {
		map.obj.id = 'map'
		var maplis = map.obj.getElementsByTagName('li');
		
		for(var i=0;i<maplis.length;i++) {
			//APPLY HOVER FUNCTIONALITY TO LIST ITEMS
			maplis[i].onmouseover=function() {
				this.className+=" hover";
			}
			maplis[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" hover\\b"), "");
			}
		}
	}
	
}


addLoadEvent(NavSetup);
