function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
function newMap(theClass){
	var theMap = document.getElementById("maplink");
	theMap.setAttribute("src", "../images/wisconsincountiesovr" + theClass + ".gif")
}
function resetMap(){
	var theMap = document.getElementById("maplink");
	theMap.setAttribute("src", "../images/wisconsincounties.gif");
}
function prepareMap(){
	var theLinks = document.getElementById("maincontent").getElementsByTagName("area");
	for (i=0; i<theLinks.length; i++){
  		theLinks[i].onmouseover = function(){
  		  	var theClass = this.className;
  			newMap(theClass);
  		}
  		theLinks[i].onmouseout = function(){
  			resetMap();
  		}
	}
}
addLoadEvent(prepareMap);