var state_list;
function initMap() {
	var _map = document.getElementById("main-area");
	if (_map) {
		createMap(_map);
	}
}
function createMap(_map) {
	state_list = document.getElementById("main-menu").getElementsByTagName("li");
	var _areas = _map.getElementsByTagName("area");
	for (i = 0; i < _areas.length; i ++) {
		if (_areas[i].alt) {
			var _node = document.getElementById(_areas[i].alt);
			if (_node) {
				_areas[i]._node = _node;
				_areas[i].onmouseover = function() {
					if (this._node.className.indexOf("activestate") == -1)
					{
						this._node.className += " activestate";
					}
				}
				_areas[i].onmouseout = function() {
					this._node.className = this._node.className.replace("activestate", "");
				}
				_areas[i].onclick = function(){
					clearSelected();
					select(this.alt);
					this._node.className += " selected";
					return false;
				}
			}
		}
	}
}
if (window.addEventListener){
	window.addEventListener("load", initMap, false);
}
else if (window.attachEvent){
	window.attachEvent("onload", initMap);
}
