imageMapBox = [];

function imageMapView() { 
	var area = document.getElementsByTagName("area");
	var target = document.getElementById("imageMap");
	for(var i=0;i<area.length;i++){
		var btn = area[i];
		boxId = btn.getAttribute("href",2).replace(/#/i,"");

		if ( document.getElementById(boxId) ) {
			imageMapBox.push(document.getElementById(boxId));
		}

		btn.onclick = function(){
			var newSrc = this.getAttribute("href",2).replace(/#/i,"");
			if ($(newSrc).className == "view hide") {
				target.src = target.src.replace(/imageMap.*\./i, newSrc+ ".");
				imageMapBox.each(function(node){
					node.className = "view hide";
					node.style.display = "none";
				});
				$(newSrc).appear();
				$(newSrc).className = "view";
			}
			return false;
		}
	}
}

addEvent(window,"load",imageMapView);
// E N D
