var countyImages = new Array();

function map_preload() {
	
	base = '/resources/images/map/';
	
	var countyArray = new Array('KEN','MIL','OZA','RAC','WAS','WAU','WAL');
	
	// Commented lines are for the new map, uncommented below them are for the old map
	// we're using because the new one doesn't have Kenosha
	
	for(var county in countyArray)
	{
		// Preload the images
		countyCode = countyArray[county];
		countyImages[countyCode + '_over'] = new Image();
		//countyImages[countyCode + '_over'].src = base + countyCode + '_over.gif';
		countyImages[countyCode + '_over'].src = base + '_' + countyCode + '_over.gif';
		countyImages[countyCode + '_out'] = new Image();
		//countyImages[countyCode + '_out'].src = base + countyCode + '_out.gif';
		countyImages[countyCode + '_out'].src = base + '_' + countyCode + '_out.gif';
	}
}

function imageOver(countyCode) {
	$(countyCode + '_img').src = countyImages[countyCode + '_over'].src;
}

function imageOut(countyCode) {
	$(countyCode + '_img').src = countyImages[countyCode + '_out'].src;
}
