//wiki XMLHttpRequest
if (window.XMLHttpRequest) {
	var xhr = new XMLHttpRequest();
	// Évite un bug du navigateur Safari :
	if (xhr.overrideMimeType) {
		xhr.overrideMimeType("text/xml");
	}
} else {
	if (window.ActiveXObject) {
		try { // essaie de charger l'objet pour IE
			xhr = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try { // essaie de charger l'objet pour une autre version IE
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				window.alert("Votre navigateur ne prend pas en charge l'objet XMLHTTPRequest.");
			} // try-catch
		} // try-catch
	}
} // if-else

function focus_on(elt){if(elt){document.getElementById(elt).focus();}}

function chgLang(langue)
{
	var pathname = window.location.pathname.toString();
	var maReg = new RegExp( '^/([a-zA-Z-]{0,5})\/([a-zA-Z0-9-\/]*)\.html$', "gi");
	if(maReg.test(pathname)) { // correspond au schéma avec langue
		var resultat = pathname.replace( maReg, langue+'/$2.html' );
		window.location.pathname=resultat;
	}
	else{
		window.location.href='/'+langue+window.location.pathname;
	}
	return false;
}

