function OpenPopUp(MyFile,MyWindow,MyWidth,MyHeight) {	  	var ns4 = (document.layers)? true:false; //NS 4	var ie4 = (document.all)? true:false; //IE 4	var dom = (document.getElementById)? true:false; //DOM	var xMax, yMax, xOffset, yOffset;;	if (ie4 || dom) {		xMax = screen.width;		yMax = screen.height;	} else if (ns4) {		xMax = window.outerWidth;		yMax = window.outerHeight;	} else {		xMax = 800;		yMax = 600;	}	xOffset = (xMax - MyWidth)/2;	yOffset = (yMax - MyHeight)/2;	window.open(MyFile,MyWindow,'width='+MyWidth+',height='+MyHeight+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',status=no,location=no,toolbar=no,directories=no,resizable=no,scrollbars=no,status=no');}function storeCaret(textEl) {	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();}function emoticon(text) {	var txtarea = document.hop.contenu;	text = ' ' + text + ' ';	if (txtarea.createTextRange && txtarea.caretPos) {		var caretPos = txtarea.caretPos;		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;		txtarea.focus();	} else {		txtarea.value  += text;		txtarea.focus();	}}function bold() {	var txtarea = document.hop.contenu;	var text = prompt("Texte à mettre en gras ?");	if (text != null && text.length > 0) {		txtarea.value += '[B]' + text + '[/B]';	}}function italic() {	var txtarea = document.hop.contenu;	var text = prompt("Texte à mettre en italique ?");	if (text != null && text.length > 0) {		txtarea.value += '[I]' + text + '[/I]';	}}function underline() {	var txtarea = document.hop.contenu;	var text = prompt("Texte à mettre en souligné ?");	if (text != null && text.length > 0) {		txtarea.value += '[U]' + text + '[/U]';	}}function link() {	var txtarea = document.hop.contenu;	var url = prompt("Adresse (URL) du lien ?");	if (url != null && url.length > 0) {		var text = prompt("Texte du lien (optionnel) ?");		if (text == null || text.length == 0) {			txtarea.value += '[URL]' + url + '[/URL]';		} else {			txtarea.value += '[URL='+url+']' + text + '[/URL]';		}	}}function image() {	OpenPopUp('image.php','image_upload',500,250);}function insertCode(code) {	var txtarea = document.hop.contenu;	if (code.length > 0) {		if (txtarea.value.length > 0) {			txtarea.value += '\n'+code;		} else {			txtarea.value += code;		}	}}
