window.addEventListener?window.addEventListener("load",preloadimages,false):window.attachEvent("onload",preloadimages);

var preloadFlag = false;

function newImage(arg) 
{
	if (document.images) 
	{
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function clearLinkColors()
{
	document.getElementById("ct").style.color = "#000000";
	document.getElementById("ma").style.color = "#000000";
	document.getElementById("me").style.color = "#000000";
	document.getElementById("vt").style.color = "#000000";
	document.getElementById("nh").style.color = "#000000";
	document.getElementById("ri").style.color = "#000000";
}

function changeImages(img, newImg, txtID) 
{
	if (document.images && (preloadFlag == true))
	{
		document[img].src = newImg;
		if (txtID != "")
		{
			clearLinkColors();
			document.getElementById(txtID).style.color = "#BE0000";
		}
	}
}


function preloadimages() {
	if (document.images) {
		map_ct = newImage("/images/map_ct.gif");
		map_ma = newImage("/images/map_ma.gif");
		map_me = newImage("/images/map_me.gif");
		map_vt = newImage("/images/map_vt.gif");
		map_nh = newImage("/images/map_nh.gif");
		map_ri = newImage("/images/map_ri.gif");
		
		preloadFlag = true;
	}
}

preloadimages();



