// Procédures globales du projet
function initEditeur(sEditeur)
{
	if(IE)  edoc = window.frames[sEditeur].document;
	if(MOZ) edoc = document.getElementById(sEditeur).contentDocument;
	if(!IE && !MOZ){
		alert('Votre navigateur n\'est pas compatible avec ce système d\'éditeur WYSIWYG !');
		return;
	}
	if(edoc.designMode != 'On') edoc.designMode = 'On';
	if(!edoc.body){
		setTimeout('initEditeur("'+sEditeur+'")',20);
	} else {
		edoc.body.innerHTML = gsCodeHTML;
	}
}

// Initialise les deux variables IE et MOZ à Vrai ou Faux
function initNavigateurVersion()
{
	IE  = window.ActiveXObject ? true : false;
	MOZ = window.sidebar       ? true : false;
}
function miseEnForme(sEditeur, sCommand, bInterface, vValeur)
{
	if(IE){
		ewin = window.frames[sEditeur];
		edoc = ewin.document;
		}
	if(MOZ){
		ewin = document.getElementById(sEditeur).contentWindow;
		edoc = document.getElementById(sEditeur).contentDocument;
		}
	ewin.focus();
	edoc.execCommand(sCommand, bInterface, vValeur);
	ewin.focus();
}
function recupereHTML(sEditeur)
{
	if(IE)  edoc = window.frames[sEditeur].document;
	if(MOZ) edoc = document.getElementById(sEditeur).contentDocument;
	return edoc.body.innerHTML;
}



function remplaceHTML(sEditeur, sContenu)
{
	if(IE)  edoc = window.frames[sEditeur].document;
	if(MOZ) edoc = document.getElementById(sEditeur).contentDocument;
	edoc.body.innerHTML = sContenu;
}
function recupereTexte(sEditeur)
{
	if(IE) {
		edoc = window.frames[sEditeur].document;
		return edoc.body.innerText;
		}
	if(MOZ) {
		edoc = document.getElementById(sEditeur).contentDocument;
		return edoc.body.textContent;
		}
	return "";
}
function remplaceTexte(sEditeur, sContenu)
{
	if(IE)  {
		edoc = window.frames[sEditeur].document;
		edoc.body.innerText = sContenu;
		}
	if(MOZ) {
		edoc = document.getElementById(sEditeur).contentDocument;
		edoc.body.textContent = sContenu;
		}
}
function recupereURL()
{
	return prompt("Entrer l'URL ", "");
}


