var state_list;
function initMap() {
	var _map = document.getElementById("map1");
	if (_map) {
		createMap(_map);
	}
}

function createMap(_map) {
	var delay = 50;
	state_list = document.getElementById("map-hover").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) {
					(function(){
						_areas[i]._node = _node;
						var _this = _areas[i];
						var t;
						_this.onmouseover = function() {
							clearTimeout(t);
							t = setTimeout(function(){
								if (_this._node.className.indexOf("activestate") == -1)
								{
									_this._node.className += " activestate";
								}
							},delay)
						}
						_areas[i].onmouseout = function() {
							clearTimeout(t);
							t = setTimeout(function(){
								_this._node.className = _this._node.className.replace("activestate", "");
							},delay)
						}
						_this._node.onmouseover = function() {
							clearTimeout(t);
						}
						_this._node.onmouseout = function() {
							clearTimeout(t);
							t = setTimeout(function(){
								_this._node.className = _this._node.className.replace("activestate", "");
							},delay)
						}
					})();
				}
			}
		}
}
if (window.addEventListener){
	window.addEventListener("load", initMap, false);
}
else if (window.attachEvent){
	window.attachEvent("onload", initMap);
}
