// map guide mouseovers

function overThat(what) {
	pointer = "#"+what+"Guidemap"; 
	$(pointer).hover(function(){ 
		$("#guidemapimg").attr("src",baseStaticDir+ "/images/map-guide-"+what+".gif");
		$("#guidemaptext").html("&raquo; "+$("#"+what+"Guidemap").attr("alt"));
	},function(){
		$("#guidemapimg").attr("src",baseStaticDir+"/images/map-guide.gif");
		$("#guidemaptext").html("&nbsp;");
	});
}

$(document).ready(function(){
	var inames = new Array('a','m','z','j','s');
	var preloadedmap = new Array();
	for( i = 0 ; i < inames.length ; i++ ) {
		preloadedmap[i] = new Image();
		preloadedmap[i].src = baseStaticDir+"/images/map-guide-"+inames[i]+".gif";
		overThat(inames[i]);
	}
	$('#img-europe').removeAttr('usemap').after('<img id="img-europe-blank" src="'+baseStaticDir+'images/blank.gif" width="210" height="109" usemap="#map-europe"/>');
	$('#map-europe area').each(function(i){
		if(typeof($(this).attr('href'))!='undefined'){
			$(this).hover(
				function(){
					$('#img-europe-blank').css('backgroundPosition','0 '+(i+1)*-109+'px');
				},
				function(){
					$('#img-europe-blank').css('backgroundPosition','0 0');
				}
			);
		}
	});
});