/*	array containing countries having an actual rollover in the map
	later this array should be provided by the server side of the app
*/

//global to save the name of the clicked world part
var EMAILSFOR = "";

function setTopLayer(newtoplayer) {
	$('toplayer').style.zIndex = "2";
	
	$('map2').style.visibility = 'visible';
	$('map2').src = "/graphics/"+newtoplayer;
	
}

function setCountriesLayer(newcountrieslayer, part) {
	
	//we save the name of the clicked world part for when the users decides to register for receiving emails
	//about programs in this part of the world
	EMAILSFOR = part;
	
	$('countries').style.background = "";
	$('countries').style.background = "url(../graphics/"+newcountrieslayer+")";
	$('countries').style.zIndex = "2";
		
	$(part).style.visibility = 'visible';
	Element.hide(part); new Effect.Appear(part, { duration: 2.0 });
	
	$('map2').style.visibility = 'hidden';
	
	if (part == 'northandcentralamerica' || part == 'southamerica') {
		$('logo').style.zIndex = '1';
	}
}

function clearTopLayer() {
	$('toplayer').style.zIndex = "-1";
	$('map2').style.visibility = 'hidden';
	$('map2').src = "/graphics/empty_map.gif";
}

function clearCountriesLayer(part) {

	new Effect.Fade(part, { duration: 1.0 });
	
	window.setTimeout("$('countries').style.background = 'url(../graphics/map_empty.gif)'", 1000);
	window.setTimeout("$('countries').style.zIndex = '-2'", 1000);
		
	if (part == 'northandcentralamerica' || part == 'southamerica') {
		window.setTimeout("$('logo').style.zIndex = '30'",1000)
	}
	
	EMAILSFOR = "";
}

