var clr1 = "black";
var clr2 = "#3779B9";

function hideBox(){
	var boxcount = document.getElementsByTagName('div');
	for (var i = 0; i < boxcount.length; i++){
		if (boxcount[i].className == "cBox"){
			var n = boxcount[i].getAttribute("id");
			document.getElementById(n).style.display = "none";
		}
	}
}

function mapIt(){
	var mapArray = new Array();
	var mapcount = document.getElementsByTagName('*');
	for (var i = 0; i < mapcount.length; i++){
		if (mapcount[i].className == "maplink") {// if the class is map, build mouseover state
			mapcount[i].onmouseover = function(){//build onmouseover events
				var y = this.getAttribute('title')+"div";
				var x = this.getAttribute('title');
				document.getElementById(y).style.display = "block";	
				document.getElementById(x).style.color = clr1;
			}
			mapcount[i].onclick = function() {//build onmouseout events
				if (typeof(window.show) != 'undefined'){
					document.getElementById(window.show+"div").style.display = "none";					
				}
				hideBox();
				var n = this.getAttribute('title');
				document.getElementById(n+"box").style.display = "block";
				window.show = n;
			}
			mapcount[i].onmouseout = function() {//build onmouseout events
				var x = this.getAttribute('title');
				document.getElementById(x).style.color = clr2;
				if(x != window.show){
					document.getElementById(x+"div").style.display = "none";
				}
			}				
		}//end if	
	}//end for
}//end mapIt
