<!--
function getXhr() {
	var xhr = null; 
	if(window.XMLHttpRequest) { 
		xhr = new XMLHttpRequest(); // Firefox et autres
	   	if (xhr.overrideMimeType) { xhr.overrideMimeType("text/xml"); } // Safari
		}
	else if(window.ActiveXObject) {
			try {	xhr = new ActiveXObject("Msxml2.XMLHTTP"); } 
			catch (e) { xhr = new ActiveXObject("Microsoft.XMLHTTP");	}
		 }
		 else { alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); xhr = false; } 
	return xhr;
}
function appelXhr(id,adresse) {
	var xhr = getXhr()
	xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
			actualiser(id,xhr.responseText);
		}
	}
	xhr.open("GET",adresse,true);
	xhr.send(null);
}
function actualiser(id,chaine) {
	document.getElementById(id).innerHTML=chaine;	
}
function pointer(id) {
	document.getElementById(id).focus();
}
function valider(ok,formulaire) {
	if (ok) {
		document.getElementById("divvalider").className="divcache"; 
		document.getElementById("divvalideri").className="divvisible"; 
		formulaire.submit();
		}
}
function affvalider() {
	document.getElementById("divvalideri").className="divcache"; 
	document.getElementById("divvalider").className="divvisible"; 
}
function validerech() {
	document.formrech.submit();
}
function impid(id) {
	window.frames['framecache'].document.getElementById('info').innerHTML=document.getElementById(id).innerHTML;
	window.frames['framecache'].focus();
	window.frames['framecache'].print();
}
function impop(id) {
	nf=window.open('/prg/description.php?f='+id,'popup','status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600');
	nf.moveTo(0,0);
	nf.resizeTo(800,screen.availHeight);
	nf.focus();
}
function photo(id) {
	adresse='http://www.henam.be/images/persadmin/a'+id+'.jpg';
	nf=window.open(adresse,'photo','width=140,height=200,top=300,left=500');
	nf.focus();
}	
function limite(textarea,max,idnbcar) {
    if(textarea.value.length >= max) { textarea.value = textarea.value.substring(0,max); }
    var reste = max - textarea.value.length;
    document.getElementById(idnbcar).innerHTML = reste;
}
function encodeUTF8(string) {
	var string = string.replace(/\r\n/g,"\n");;
	var utftext = "";
	for (var n = 0; n < string.length; n++) {
		var c = string.charCodeAt(n);
		if (c < 128) utftext += String.fromCharCode(c);
		else if((c > 127) && (c < 2048)) {
			utftext += String.fromCharCode((c >> 6) | 192);
			utftext += String.fromCharCode((c & 63) | 128);
		}
		else {
			utftext += String.fromCharCode((c >> 12) | 224);
			utftext += String.fromCharCode(((c >> 6) & 63) | 128);
			utftext += String.fromCharCode((c & 63) | 128);
		}
	}
	return utftext;
};
function testerRadio(radio,affrem) {
	for (var i=0; i<radio.length;i++) {
		if (radio[i].checked) { return true; }
	}
	if (affrem) {  
		alert('Vous devez effectuer un choix !'); 
	}
	return false;
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
var position=0;
var msg="";
var longue=0;
var fois=0;
function inittextdefil(msg0) {
	msg="     "+msg0;
	longue=msg.length;
	fois=(70/msg.length)+1;
	for(i=0;i<=fois;i++) msg+=msg;
}
function textdefil() {
	document.formtxtdefil.deftext.value=msg.substring(position,position+100);
	position++;
	if(position == longue) position=0;
	setTimeout("textdefil()",100);
}
//-->