function changeLang (newLang) {
	
	// Si il n'y a pas de paramètres en GET
	if (document.location.search == "") {
		location.replace(document.location + "?lang=" + newLang);
		return;
	}
	
	if (document.location.search == "?") {
		location.replace(document.location + "lang=" + newLang);
		return;
	}
		
	// On récupère l'url actuelle (ça marche pas si on rajoue pas un caractère en + ... ?!
	var oldURL = document.location + "&";
	
	// On recherche la chaine "&lang="
	var index = oldURL.indexOf("&lang=");
	
	// Si pas trouvé on recherche la chaine "?lang="
	if (index == -1) {
		var index = oldURL.indexOf("?lang=");
	}
	
	if (index!= -1) {
		
		// On cherche la fin de la variable "&lang="
		// et on récupère la chaine "&lang=xxx" (ou "?lang=xxx")
		oldLang = oldURL.slice(index+1);
		endOfLang = oldLang.indexOf("&", 1);
		if (endOfLang != -1) oldLang = oldLang.slice(0, endOfLang);
		
		// On remplace l'ancienne langue par la nouvelle
		newURL = oldURL.replace(new RegExp(oldLang, "gi"), "lang=" + newLang);
		
		// On coupe le caractère rajouté en fin d'URL
		newURL = newURL.slice(0, newURL.length-1);
		
	} else {
		
		// On recoupe le caractère rajouté en fin d'URL
		oldURL = oldURL.slice(0, oldURL.length-1);
		
		// On rajoute la langue
		newURL = oldURL + "&lang=" + newLang;
		
	}
	
	// On charge la nouvelle URL
	location.replace(newURL);

}


function openWin (nomPage, nomWin, valWidth, valHeight,valScroll) {
	var myOpenWin
	myOpenWin = window.open(nomPage,nomWin,'width=' + valWidth + ', height=' + valHeight + ',resizable=no,toolbar=no,location=no,status=no,personalbar=no, scrollbars=' + valScroll);
	myOpenWin.focus();
	}

function openSite (urlSite,nomWin) {
	var myOpenSite
	myOpenSite = window.open(urlSite,nomWin,'resizable=yes,toolbar=yes,location=yes,status=yes,personalbar=yes, scrollbars=yes');
	myOpenSite.focus();
	}


