// Encodé en UTF-8

// Variables globales
var isMozilla = (navigator.userAgent.toLowerCase().indexOf('gecko')!=-1) ? true : false;
 
// function JS qui permet d'encoder les variables que l'on passe : encodeURIComponent(string)
 
// lecture d'un fichier http
function ajaxGetFileContent(fichier) {
	// FIREFOX
	if(window.XMLHttpRequest) {
		xhr_object = new XMLHttpRequest();
	}
	
	// IE
	else if(window.ActiveXObject) {
		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else return(false);
	
	xhr_object.open("GET", fichier, false);
	xhr_object.send(null);
	if(xhr_object.readyState == 4) return(xhr_object.responseText);
	else return(false);
}
 
// Ecrit du html dans une balise donnée
function ajaxWriteHtml(id_obj, txt, concatenation) {
	
	var obj=document.getElementById(id_obj); 
	if(!obj) {
		obj=parent.document.getElementById(id_obj); 
	}
 
	if(isMozilla) {
		if(obj.firstChild) {   
			longueurCible = obj.firstChild.length;
		}
		else {
			longueurCible=0;
		}
		
		if(concatenation) {
			obj.innerHTML += txt;
		} else {
			obj.innerHTML = txt;
		}
	} else {
		if(concatenation) {
			obj.innerHTML += txt;
		} else {
			obj.innerHTML = txt;
		}
	}
}