function win_show(qui){
	$comp("#footcom").before('<div id="backfond2"></div>');
	win_part_div=document.getElementById(qui);
	win_part_div.style.visibility='hidden';
	win_part_div.style.display='block';
	LeftPosition = Math.round((window.innerWidth-win_part_div.offsetWidth)/2);
	TopPosition = Math.round((window.innerHeight-win_part_div.offsetHeight)/2);
	win_part_div.style.left=LeftPosition+'px';
	win_part_div.style.top=TopPosition+'px';
	win_part_div.style.visibility='visible';
}

function win_cancel(qui){
$comp("#backfond2").remove();
document.getElementById(qui).style.display='none';	
}

function htmlspecialchars(ch) {
   ch = ch.replace(/&/g,"&amp;")
   ch = ch.replace(/\"/g,"&quot;")
   ch = ch.replace(/\'/g,"&#039;")
   ch = ch.replace(/</g,"&lt;")
   ch = ch.replace(/>/g,"&gt;")
   return ch
}

function htmlspecialchars_decode(ch) {
   ch = ch.replace(/&amp;/g,"&")
   ch = ch.replace(/&quot;/g,'"')
   ch = ch.replace(/&#039;/g,"'")
   ch = ch.replace(/&lt;/g,"<")
   ch = ch.replace(/&gt;/g,">")
   return ch
}



function col_txt(branch,titre_lesref){
	for (var i = 0; i < titre_lesref.length; i++) {
		document.getElementById(titre_lesref[i]).value=eval('branch.struct.'+titre_lesref[i]);
	}
}

function gotoconf(){
		var conf = location.href.split('#');
		window.location.href = conf[0];
}

function maj_session() {
		window.location.replace("index.php?id=0&lang="+lang_cour);
}

