sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

function hideAllPopUps(){
	var popEls = document.getElementById("pop_items").childNodes
	for (var i=0; i<popEls.length; i++) {
		popEls[i].className = "hide";
	}
}

function showPopUp(e,id){
	if (!e) var e = window.event;
	hideAllPopUps()
	var el = document.getElementById(id)
	if(el && el != null){
		x=e.clientX/2;
		y=e.clientY/2;
		el.className = "popbox show";
		
			el.style.position = "absolute"
			el.style.left = x+"px"
			el.style.top = y+"px"
		
		
		el.onmouseover=function() {			
			this.className = "popbox show";
		}
		el.onclick=function() {			
			this.className = "hide";
		}		
	}
}

function popFood(e,id){
	if (!e) var e = window.event;
	hideAllPopUps()
	var el = document.getElementById(id)
	if(el && el != null){
		el.className = "popbox show";
		el.onmouseover=function() {			
			this.className = "popbox show";
		}
		el.onclick=function() {			
			this.className = "hide";
		}		
	}
}

function hidePopUp(id){
	var el = document.getElementById(id)
	if(el && el != null){
		el.className = "hide";
	}
}

initMap = function(){	
	var mapEls = document.getElementsByTagName("area");
	for (var i=0; i<mapEls.length; i++) {	
	var idAr = mapEls[i].href.split("#")
	mapEls[i].popup = idAr[idAr.length-1]	
		//mapEls[i].onmouseover=function(event) {
		mapEls[i].onclick=function(event) {	
			showPopUp(event, this.popup)
		}
		//mapEls[i].onmouseout=function() {
			//hidePopUp(this.popup)			
		//}
	}
}

function init(){
	if(document.body.className == "d2d_camp_map_100208"){
		hideAllPopUps()
		initMap()
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);