var previousLocationMapSelected = "";

jQuery(document).ready(function(){
   //wire up the map mouse over events
   
   jQuery("#locationMap a").mouseenter(function() {
	  //on mouseenter:
		
		//hide any selected locations
		jQuery("#locationMap a").removeClass("selected");
		
		//show the image for this location
		var locationID = jQuery(this).attr("id");
		jQuery("#"+locationID).addClass("on");
    });
   
   
   jQuery("#locationMap a").mouseleave(function() {
	  //on mouseleave:
		 
		//hide all map location images
		jQuery("#locationMap a").removeClass("on");
		
		//reshow any selected locations
		if(previousLocationMapSelected != ""){
			jQuery("#"+previousLocationMapSelected).addClass("selected");
		}
   });
   
   jQuery("#locationMap a").click(function () {
		//onclick:
		
		//clear any other selection
		jQuery("#locationMap a").removeClass("selected");
		
		//set the image for this location to selected
		var locationID = jQuery(this).attr("id");
		jQuery("#"+locationID).addClass("selected");
		
		previousLocationMapSelected = locationID;
		
		//uncomment this to turn off bookmarking
		//return false;

	});

 });

