var tempMap = '';
var x= 0;
var y= 0;

sfHover = function() {
	var sfEls = document.getElementById("tabMenu").getElementsByTagName("dt");
	
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function AccentToNoAccent(str) {
	var norm = new Array('À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï', 'Ð','Ñ','Ò','Ó','Ô','Õ','Ö','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß', 'à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ', 'ò','ó','ô','õ','ö','ø','ù','ú','û','ü','ý','ý','þ','ÿ');
	var spec = new Array('A','A','A','A','A','A','A','C','E','E','E','E','I','I','I','I', 'D','N','O','O','O','0','O','O','U','U','U','U','Y','b','s', 'a','a','a','a','a','a','a','c','e','e','e','e','i','i','i','i','d','n', 'o','o','o','o','o','o','u','u','u','u','y','y','b','y');
	for (var i = 0; i < spec.length; i++)
	str = replaceAll(str, norm[i], spec[i]);
	return str;
}

// Remplace toutes les occurences d'une chaine
function replaceAll(str, search, repl) {
	while (str.indexOf(search) != -1)
	str = str.replace(search, repl);
	return str;
}

function changeZoomMap(){
	if(mapGeneral != null){
		
		if(x == "" || y == ""){
			setTimeout('changeZoomMap()', 100);
		}
		else setTimeout('changeCenterAndZoom()', 500);
	}
	else alert('Pas de chargement ...');
}
function changeCenterAndZoom(){
	//alert("Point de chargement : "+x+","+y);
	mapGeneral.centerAndZoom(new GPoint(x,y),2);
	
}
function changeCenterAndZoom2(){
	//alert("Point de chargement FRANCE : "+x+","+y);
	map.centerAndZoom(new GPoint(3.1593068228, 46.6996324), 11);
	
}
function changeDept(){
	document.form1.dept[document.form1.dept.options.selectedIndex].value = document.form1.dept[document.form1.dept.options.selectedIndex].text;
	if(document.form1.dept[document.form1.dept.options.selectedIndex].value == "Tous les départements"){
		document.form1.dept[document.form1.dept.options.selectedIndex].value = '';
	}
	document.form1.submit();
}