var liste_canton = new Array;
liste_canton['AI'] = 'Appenzell Rhodes-Intérieures';
liste_canton['AR'] = 'Appenzell Rhodes-Extérieures';
liste_canton['AG'] = 'Argovie';
liste_canton['BE'] = 'Berne';
liste_canton['BL'] = 'Bâle Campagne';
liste_canton['BS'] = 'Bâle Ville';
liste_canton['FR'] = 'Fribourg';
liste_canton['GE'] = 'Genève';
liste_canton['GL'] = 'Glaris';
liste_canton['GR'] = 'Grisons';
liste_canton['JU'] = 'Jura';
liste_canton['LU'] = 'Lucerne';
liste_canton['NE'] = 'Neuchâtel';
liste_canton['NW'] = 'Nidwald';
liste_canton['OW'] = 'Obwald';
liste_canton['SG'] = 'Saint-Gall';
liste_canton['SH'] = 'Schaffhouse';
liste_canton['SO'] = 'Soleure';
liste_canton['SZ'] = 'Schwytz';
liste_canton['TG'] = 'Thurgovie';
liste_canton['TI'] = 'Tessin';
liste_canton['UR'] = 'Uri';
liste_canton['VD'] = 'Vaud';
liste_canton['VS'] = 'Valais';
liste_canton['ZG'] = 'Zoug';
liste_canton['ZH'] = 'Zurich';

var article_canton = new Array;
article_canton['AI'] = "d'";
article_canton['AR'] = "d'";
article_canton['AG'] = "d'";
article_canton['BE'] = "de ";
article_canton['BL'] = "de ";
article_canton['BS'] = "de ";
article_canton['FR'] = "de ";
article_canton['GE'] = "de ";
article_canton['GL'] = "de ";
article_canton['GR'] = "des ";
article_canton['JU'] = "du ";
article_canton['LU'] = "de ";
article_canton['NE'] = "de ";
article_canton['NW'] = "de ";
article_canton['OW'] = "d'";
article_canton['SG'] = "de ";
article_canton['SH'] = "de ";
article_canton['SO'] = "de ";
article_canton['SZ'] = "de ";
article_canton['TG'] = "de ";
article_canton['TI'] = "du ";
article_canton['UR'] = "d'";
article_canton['VD'] = "de ";
article_canton['VS'] = "du ";
article_canton['ZG'] = "de ";
article_canton['ZH'] = "de ";
      
for(code in liste_canton) {
	tmp = new Image();
	tmp.src = 'images/map/map_'+code+'.gif';
}

function mapChangeCanton(code) {
	new Ajax.Updater('infos_canton', 'ajax/infos_cantons.php?code='+code, {
		method: 'get',
		evalScripts: true
	});
	$('map_click').src = 'images/map/map_'+code+'.gif';
}

var canton_actif = '';
function mapSurbrillanceCanton(code, evt) {
	if(canton_actif != code) {
		canton_actif = code;
		$('map_over').src = 'images/map/map_'+code+'.gif';
	}
}

function mapEnleveSurbrillanceCanton() {
	$('map_over').src = 'images/map/map_trans.gif';
	canton_actif = '';
	mapEnleverNomCanton();
}

function mapAfficheNomCanton(code, event) {
	$('nom_canton').innerHTML = "Canton "+article_canton[code]+liste_canton[code];
	var hauteur = $('nom_canton').offsetHeight;
	var x=(document.body.scrollLeft || document.documentElement.scrollLeft) - $('container').offsetLeft + event.clientX+3;
	var y=(document.body.scrollTop || document.documentElement.scrollTop) + event.clientY-hauteur-3;
	$('nom_canton').style.left = x+"px";
	$('nom_canton').style.top = y+"px";
	$('nom_canton').style.visibility = 'visible';
}
function mapEnleverNomCanton()	{
	$('nom_canton').style.visibility = 'hidden';
}

function mapChangeOnglet(code, onglet) {
	new Ajax.Updater('infos_canton', 'ajax/infos_cantons.php?code='+code+'&onglet='+onglet, {
		method: 'get',
		evalScripts: true
	});
	
	/*$('btn_infos_gen').className = "onglet";
	$('btn_infos_prat').className = "onglet";
	$('btn_infos_eco').className = "onglet";
	$('btn_infos_migr').className = "onglet";
	$('btn_'+onglet).className = "current";*/
}

function mapInfosPratChange(quoi) {
	$('l_estimcout').hide();
	$('l_sante').hide();
	$('l_banque').hide();
	$('l_assurance').hide();
	$('l_telecom').hide();
	$('l_logement').hide();
	$('l_'+quoi).show();
}

