 	jQuery(document).ready(function($) {
									
									// start of image mapping and pre loading images
  
	$.preLoadImages("/sites/all/themes/clean/images/map/map-final.png", 
				    "/sites/all/themes/clean/images/map/map-scotland.png",
					"/sites/all/themes/clean/images/map/map-midlands.png",
					"/sites/all/themes/clean/images/map/map-northwest.png",
					"/sites/all/themes/clean/images/map/map-southeast.png",
					"/sites/all/themes/clean/images/map/map-wales.png",
					"/sites/all/themes/clean/images/map/map-yorkshire.png",
					"/sites/all/themes/clean/images/map/map-northeast.png",
					"/sites/all/themes/clean/images/map/map-southwest.png");
						 
	mapOverlay('/sites/all/themes/clean/images/map/map-', '.png');
	
									});

function mapOverlay(imgPathPrefix, imgExt) {
	

	var mapImg = $('#image-map img');
	var mapImgOriginal = $('#image-map img').attr('src');
	
	
	
	$('#areas area').hover(
	function() {
		mapImg.attr('src', imgPathPrefix + $(this).attr('id') + imgExt);
		
		$('#desc-overlay').load($(this).attr('href')+' #'+$(this).attr('id'))
						  .addClass($(this).attr('id'))
						  .show();	  
	}, 
	function() {
		mapImg.attr('src', mapImgOriginal);
		

	}).click(function() { 

	});
	
	
	
}



(function($) {
	
	//We define a cache array to store our preloaded images	
	var cache = [];
	
	//Our anonymous function will be called preLoadImages
	$.preLoadImages = function() {
		
		//We assign the number of images to preload	to the imageCount variable	
    	var imageCount = arguments.length;
    	
    	//And loop through each image
    	for (var i = imageCount; i--;) {
    		
    		//For each image we create a DOM element
      		var cacheImage = document.createElement('img');
      		
      		//Assign the image path
      		cacheImage.src = arguments[i];
      		
      		//And add it to the cache array
      		cache.push(cacheImage);
			
		
    
    	}
    
  	}
	
		
			})(jQuery)
