var affoutils=true;
var affvisu = true;
var affcouleurs = true;
var affantispam=false;
	
if (!listEmoticon) {
	var listEmoticon = new Array();        
}

  var urllist="http://contes-de-web.fr/js/listemoticon.js";
    if (document.getElementById("listSmlCB")) {
    var firstarg=document.getElementById("listSmlCB");
    urllist=firstarg.href;
	elementlist=urllist.split("?");
	if (elementlist.length >1) {
		for (i=0;i<elementlist[1].length;i++) {
			if ((elementlist[1].charAt(i)== "O") || (elementlist[1].charAt(i)== "o")) { affoutils = false; }
			if ((elementlist[1].charAt(i)== "V") || (elementlist[1].charAt(i)== "v")) { affvisu = false; }
			if ((elementlist[1].charAt(i)== "C") || (elementlist[1].charAt(i)== "c")) { affcouleurs = false; }
			if ((elementlist[1].charAt(i)== "R") || (elementlist[1].charAt(i)== "r")) { affantispam = false; }
		}
	}
    }
	
  var emoScript =  document.createElement("script");
  emoScript.src = urllist;
  emoScript.type = "text/javascript";
  window.document.getElementsByTagName('head')[0].appendChild(emoScript);
  

	var BOutils = new Array();    
    BOutils[BOutils.length] = new Array("URL","http://storage.canalblog.com/05/66/604160/43780784.png","Ins&egrave;re un lien","[URL]","[/URL]","<a href=\'","\' target='_blank'>Aller là</a>");
    BOutils[BOutils.length] = new Array("Img","http://contes-de-web.fr/img/image.jpg","Ins&egrave;re une image","[Img]","[/Img]","<br /><img src=\'","\' /><br />");
    BOutils[BOutils.length] = new Array("I","http://storage.canalblog.com/43/16/604160/43780777.png","Texte Italic","[I]","[/I]","<I>","</I>");
    BOutils[BOutils.length] = new Array("G","http://storage.canalblog.com/88/94/604160/43780765.png","Texte Gras","[G]","[/G]","<B>","</B>");
    BOutils[BOutils.length] = new Array("S","http://storage.canalblog.com/38/88/604160/43780791.png","Texte Soulign&eacute;","[U]","[/U]","<U>","</U>");
    BOutils[BOutils.length] = new Array("B","http://storage.canalblog.com/06/24/604160/43780752.png","Texte Barr&eacute;","[S]","[/S]","<STRIKE>","</STRIKE>");


    var att = " style='vertical-align:middle; border:0;margin-left: 2px;'";
	var listActionOutils = new Array();    
    listActionOutils[listActionOutils.length] = new Array("[Img]","<br /><img src=\'");
    listActionOutils[listActionOutils.length] = new Array("[/Img]","\' /><br />");
    listActionOutils[listActionOutils.length] = new Array("[I]","<I>");
    listActionOutils[listActionOutils.length] = new Array("[/I]","</I>");
    listActionOutils[listActionOutils.length] = new Array("[U]","<U>");
    listActionOutils[listActionOutils.length] = new Array("[/U]","</U>");
    listActionOutils[listActionOutils.length] = new Array("[G]","<B>");
    listActionOutils[listActionOutils.length] = new Array("[/G]","</B>");
    listActionOutils[listActionOutils.length] = new Array("[S]","<STRIKE>");
    listActionOutils[listActionOutils.length] = new Array("[/S]","</STRIKE>");
    listActionOutils[listActionOutils.length] = new Array(":url:","http://");
	listActionOutils[listActionOutils.length] = new Array("[URL]","<a href=\'");
	listActionOutils[listActionOutils.length] = new Array("[NAME]","\' target='_blank'>");
	listActionOutils[listActionOutils.length] = new Array("[/URL]","</a>");
    listActionOutils[listActionOutils.length] = new Array("[Sur]","<span style='background-color : #3EE735'>");
    listActionOutils[listActionOutils.length] = new Array("[/Sur]","</span>");
    listActionOutils[listActionOutils.length] = new Array("[Sur col=\'","<span style=\'background-color : ");
    listActionOutils[listActionOutils.length] = new Array("[Font col=\'","<font color=\'");
    listActionOutils[listActionOutils.length] = new Array("[Size=\'","<span style=\'font-size: ");
    listActionOutils[listActionOutils.length] = new Array("[/Size]","</span>");
    listActionOutils[listActionOutils.length] = new Array("[/Font]","</font>");
    listActionOutils[listActionOutils.length] = new Array(":]:",">");



function codeASpam() {
this.afficher="<";
this.afficher += "span style='background-color:#0000FF; color:#FFFF00; border:solid 1px #000; font-family: courrier, Arial;	font-size: 16pt; font-weight: bold;'><";
this.afficher += "S>&nbsp;"
this.valeur="";

var clar=new Array(26);
	for (i=0;i<26;i++) {
	var oups=i+65;
	clar[i]="&#"+oups+";";
	}
	for (i=0;i<5;i++) {
        var clor= Math.floor(Math.random()*25);
	this.afficher += clar[clor]+" ";
	this.valeur += clor;
	}

this.afficher+="<";
this.afficher+="\/S><";
this.afficher += "\/span>";

	this.verifier = function(newrequete) {
	var valeurnew="";
	  if(newrequete.length<6) {
		for (i=0;i<5;i++) {
                var charasc=newrequete.charCodeAt(i);
		charasc= parseInt(charasc-65);
		valeurnew += charasc;
		}
	  if (this.valeur==valeurnew) { return true; } else { return false; }
	  }
	return false;
	}

}

function addEvent(ou, eventName, quoi) {
if (ou.addEventListener)
ou.addEventListener(eventName, quoi, false);
else if (ou.attachEvent)
ou.attachEvent('on'+eventName, quoi);
}
	
	function RemplacerTagEmoticon(ObjetComs) {
	var speEmoticon = new Array();        
    speEmoticon[speEmoticon.length] = new Array(" :)","http://contes-de-web.fr/img/sourire.gif");
    speEmoticon[speEmoticon.length] = new Array(" :(","http://contes-de-web.fr/img/gueule.gif");
    speEmoticon[speEmoticon.length] = new Array(" :s","http://contes-de-web.fr/img/confus.gif");
    speEmoticon[speEmoticon.length] = new Array(" :D","http://contes-de-web.fr/img/rire.gif");
	speEmoticon[speEmoticon.length] = new Array(" ;)","http://storage.canalblog.com/12/61/108589/9712564.gif");
	speEmoticon[speEmoticon.length] = new Array(":o)","http://contes-de-web.fr/img/sourire.gif");
    speEmoticon[speEmoticon.length] = new Array(":o(","http://contes-de-web.fr/img/gueule.gif");
    speEmoticon[speEmoticon.length] = new Array(":os","http://contes-de-web.fr/img/confus.gif");
    speEmoticon[speEmoticon.length] = new Array(":oD","http://contes-de-web.fr/img/rire.gif");
	speEmoticon[speEmoticon.length] = new Array(";o)","http://storage.canalblog.com/12/61/108589/9712564.gif");
 
    for (var i = 0; i < listEmoticon.length; i++) {
        ObjetComs = ObjetComs.split('[' + listEmoticon[i][0] + ']').join('<img src="' + listEmoticon[i][1] + '"' + att + ' alt="' + listEmoticon[i][0] + '" />');
    }
    for (var i = 0; i < speEmoticon.length; i++) {
        ObjetComs = ObjetComs.split(speEmoticon[i][0]).join('<img src="' + speEmoticon[i][1] + '"' + att + ' alt="' + speEmoticon[i][0] + '" />');
    }
    
    return ObjetComs;
}

function RemplacerCodeStyle(ObjetComs) {
    for (var i = 0; i < listActionOutils.length; i++) {
        ObjetComs = ObjetComs.split(listActionOutils[i][0]).join(listActionOutils[i][1]);
    }
    return ObjetComs;
}
function SupprimerCodeStyle(ObjetComs) {
    for (var i = 0; i < listActionOutils.length; i++) {
        ObjetComs = ObjetComs.split(listActionOutils[i][0]).join("");
    }
    return ObjetComs;
}



function SwapCodeStyle1(namediv,nameclass) {

    var objComArea;
    var classComArea;
    var objComBody = new Array();
    if (namediv != '') {
        objComArea = document.getElementById(namediv);
        if (!objComArea || !objComArea.innerHTML) return;
        classComArea = objComArea.getElementsByTagName("div");
    } else {
        classComArea = document.getElementsByTagName("*");
    }
    for (var i = 0; i < classComArea.length; i++) {
        if (classComArea[i].className == nameclass) objComBody[objComBody.length] = classComArea[i];
    }
    for (var i = 0; i < objComBody.length; i++) {


        objComBody[i].innerHTML = RemplacerCodeStyle(objComBody[i].innerHTML);
    }
}
function SwapCodeStyle2(namediv,nameclass) {

    var objComArea;
    var classComArea;
    var objComBody = new Array();
    if (namediv != '') {
        objComArea = document.getElementById(namediv);
        if (!objComArea || !objComArea.innerHTML) return;
        classComArea = objComArea.getElementsByTagName("div");
    } else {
        classComArea = document.getElementsByTagName("*");
    }
    for (var i = 0; i < classComArea.length; i++) {
        if (classComArea[i].className == nameclass) objComBody[objComBody.length] = classComArea[i];
    }
    for (var i = 0; i < objComBody.length; i++) {


        objComBody[i].innerHTML = SupprimerCodeStyle(objComBody[i].innerHTML);
    }
}

function SwapCodeMenu(nameMenu) {

    if (document.getElementById(nameMenu)) {
    var objComArea = document.getElementById(nameMenu);
        objComArea.innerHTML = SupprimerCodeStyle(objComArea.innerHTML);
        objComArea.innerHTML = RemplacerTagEmoticon(objComArea.innerHTML);
    }
}

function SwapCodeEmoticon(namediv,nameclass) {

if (nameclass != "navlinks") { SwapCodeStyle1(namediv,nameclass); }
else { SwapCodeStyle2(namediv,nameclass); }

    var objComArea;
    var classComArea;
    var objComBody = new Array();
    if (namediv != '') {
        objComArea = document.getElementById(namediv);
        if (!objComArea || !objComArea.innerHTML) return;
        classComArea = objComArea.getElementsByTagName("div");
    } else {
        classComArea = document.getElementsByTagName("*");
    }
    for (var i = 0; i < classComArea.length; i++) {
        if (classComArea[i].className == nameclass) objComBody[objComBody.length] = classComArea[i];
    }
    for (var i = 0; i < objComBody.length; i++) {
        objComBody[i].innerHTML = RemplacerTagEmoticon(objComBody[i].innerHTML);
    }
}

function openPopupSmilleys() {
 var wpops = window.open("","PopSmileys","width=500, height=550, toolbars=no, scrollbars=yes");
 wpops.document.write('<');
 wpops.document.write('head><');
 wpops.document.write('title>Choisir un smiley<');
 wpops.document.write('/title><');
 wpops.document.write('/head><');
 wpops.document.write('body>');
 wpops.document.write('<');
 wpops.document.write('p>Cliquez sur l\'&eacute;motic&ocirc;ne pour l\'ajouter dans le texte du commentaire.<');
 wpops.document.write('/p><');
 wpops.document.write('hr />');
	    for (var i = 13; i < listEmoticon.length; i++) {
        wpops.document.write('<a onClick="window.opener.InsererEmoticon(\'' + listEmoticon[i][0] + '\');window.opener.visionner()"><img src="' + listEmoticon[i][1] + '"' + att + ' alt="' + listEmoticon[i][0] + '" title="' + listEmoticon[i][0] + '"  /></a>');
        }
 wpops.document.write('<');
 wpops.document.write('br /><');
 wpops.document.write('hr /><');
 wpops.document.write('input type="button" value="Bye bye" onclick="window.close();"/>');
 wpops.document.write('<');
 wpops.document.write('/body>');

	
 wpops.focus();
}

function remplacerducode(dici) {
  var objtextcom = dici.commentBody;
  var textcom = objtextcom.value;
  textcom = textcom.split("<").join("&lt;");
  textcom = textcom.split(">").join("&gt;");
  textcom = textcom.split("http://").join(":url:");
  objtextcom.value = textcom;
  if (affantispam) {
	  var valeurreq=dici.cantispam.value;
	  var bon=antispam.verifier(valeurreq);
	  if (!bon) { 
	  dici.authorNickName.value="";
	  } 
  }
 handleSubmit(dici);
}

function InsererEmoticon(tag) {
    var item = '[' + tag + ']';
    var obj = document.frmComment.commentBody;	
    if (document.selection) {
        obj.focus();
        sel = document.selection.createRange();
        sel.text = item;
    } else if (obj.selectionStart || obj.selectionStart == '0') {
        var startPos = obj.selectionStart;
        var endPos = obj.selectionEnd;
        obj.value = obj.value.substring(0, startPos) + item + obj.value.substring(endPos, obj.value.length);
    } else {
        obj.value += item;
    }
}

function getNbSaut(elementTxt){
  var Nbrsaut = 0;
  var PosCn = elementTxt.indexOf("\r\n");
  while( PosCn > -1){
    PosCn = elementTxt.indexOf("\r\n", PosCn+2);
    Nbrsaut ++;
  }
  return( Nbrsaut);
}
function collerTags(tagDeb, tagFin) {
  var Obj = document.frmComment.commentBody;
    Obj.focus();
    if (typeof Obj.selectionStart != 'undefined') {
      var PosDeb = Obj.selectionStart;
      var PosFin = Obj.selectionEnd;
      var Chaine  = Obj.value;
      var szAvant = Chaine.substring( 0 , PosDeb);
      var szApres = Chaine.substring( PosFin, Obj.textLength );
      var szSelect = Chaine.substring( PosDeb, PosFin);
      Obj.value = szAvant + tagDeb + szSelect + tagFin + szApres;
      PosDeb = szAvant.length + tagDeb.length +szSelect.length;
      PosFin = PosDeb;
      Obj.setSelectionRange( PosDeb, PosFin);
      Obj.focus();
    }
    else { 
      var Decal;
      var Chaine   = document.selection.createRange();
      var szSelect = Chaine.text;
      Chaine.text  = tagDeb + szSelect + tagFin;
      Chaine = document.selection.createRange();
      if ( szSelect.length > 0) {
        Decal = tagDeb.length + szSelect.length;
        Decal -= getNbSaut( szSelect);
      }
      else {
        Decal = -tagFin.length;
      }
      Chaine.move('character', Decal);
      Chaine.collapse();
      Chaine.select();
    }
}

function SurlignInText() {
           var  objcolorsel=document.getElementById("selectbkCol");
           var couleursurlignage = objcolorsel.options[objcolorsel.selectedIndex].value;
           var entetesurlignage ="[Sur col=\'" + couleursurlignage + "\':]:"; 
           var finsurlignage ="[/Sur]";
           collerTags(entetesurlignage,finsurlignage);
 }
 
function colorInText() {
           var  objcolorsel=document.getElementById("selectfontCol");
           var couleursurlignage = objcolorsel.options[objcolorsel.selectedIndex].value;
           var entetesurlignage ="[Font col=\'" + couleursurlignage + "\':]:"; 
           var finsurlignage ="[/Font]";
           collerTags(entetesurlignage,finsurlignage);
 }

function sizeInText() {

var obj = document.frmComment.commentBody;
           var  objcolorsel=document.getElementById("selectsizefont");
           var couleursurlignage = objcolorsel.options[objcolorsel.selectedIndex].value;
           var entetesurlignage ="[Size=\'" + couleursurlignage + "\':]:"; 
           var finsurlignage ="[/Size]";
           collerTags(entetesurlignage,finsurlignage);
 }


function insertURLInText() {
var obj = document.frmComment.commentBody;
           var  itemaddr = "";
           itemaddr = prompt("Entrer l'adresse http du lien", "http://");
		   itemaddr = itemaddr.split("http://").join(":url:");
    	   var 	itemname = "";
           itemname = prompt("Entrer le nom du lien", itemaddr);
           if (!itemaddr) itemname=itemaddr;
           itemaddr =  itemaddr.split("http://").join(":url:");
		   var item = "[URL]" + itemaddr + "[NAME]" + itemname + "[/URL]";
        if (document.selection) {
           obj.focus();
           sel = document.selection.createRange();
           sel.text = item;

      } else if (obj.selectionStart || obj.selectionStart == '0') {
            var startPos = obj.selectionStart;
            var endPos = obj.selectionEnd;
            obj.value = obj.value.substring(0, startPos) + item + obj.value.substring(endPos, obj.value.length);
            } else {
            obj.value += item;
      }
}
function inserImgInText() {
    var obj = document.frmComment.commentBody;
    var item = prompt("Entrer l'adresse http de l'image", "http://");
        item =  item.split("http://").join(":url:");
        item = BOutils[1][3] + item + BOutils[1][4]; 
	if (document.selection) {
      obj.focus();
      sel = document.selection.createRange();
      sel.text = item;
    } else if (obj.selectionStart || obj.selectionStart == '0') {
      var startPos = obj.selectionStart;
      var endPos = obj.selectionEnd;
      obj.value = obj.value.substring(0, startPos) + item + obj.value.substring(endPos, obj.value.length);
    } else {
      obj.value += item;
    }
 }

function inserTagInText(outil) {

           for (var i = 2; i < BOutils.length; i++) { 
              if (outil == BOutils[i][0]) {  collerTags(BOutils[i][3], BOutils[i][4]); }
           }
 }

function visionner() {
  var titrecom = document.frmComment.commentTitle.value;

  titrecom = RemplacerCodeStyle(titrecom);
  titrecom = RemplacerTagEmoticon(titrecom);
  titrecom = "<h3>" + titrecom + "</h3><p>";

  var textcom = document.frmComment.commentBody.value;
  textcom = textcom.split("<").join("&lt;");
  textcom = textcom.split(">").join("&gt;");
  textcom = textcom.split("\n").join("<br />");
  textcom = RemplacerCodeStyle(textcom);
  textcom = RemplacerTagEmoticon(textcom);

  var apercucom = titrecom + textcom +"</p>";
  var objvisu =  document.getElementById("visu");
  objvisu.innerHTML = apercucom;
}   	
	
function modifierformulaire() {
 
 if (document.forms.frmComment) {
 var objselectfont = "<select name='selectfontCol' id='selectfontCol'  style='width: 35px; padding: 0;margin: 0'> title='Couleur de texte'";
	objselectfont += "<option value='#000000' style='background-color: #000000;'></option>";
	objselectfont += "<option value='#707070' style='background-color: #707070;'></option>";
	objselectfont += "<option value='#F0F0F0' style='background-color: #F0F0F0;'></option>";
	objselectfont += "<option value='#F00000' style='background-color: #F00000;'></option>";
	objselectfont += "<option value='#F07070' style='background-color: #F07070;'></option>";
	objselectfont += "<option value='#F0D0D0' style='background-color: #F0D0D0;'></option>";
	objselectfont += "<option value='#F05030' style='background-color: #F05030;'></option>";
	objselectfont += "<option value='#F06040' style='background-color: #F06040;'></option>";
	objselectfont += "<option value='#F08060' style='background-color: #F08060;'></option>";
	objselectfont += "<option value='#F000F0' style='background-color: #F000F0;'></option>";
	objselectfont += "<option value='#F070F0' style='background-color: #F070F0;'></option>";
	objselectfont += "<option value='#F0D0F0' style='background-color: #F0D0F0;'></option>";
	objselectfont += "<option value='#0000F0' style='background-color: #0000F0;'></option>";
	objselectfont += "<option value='#7070F0' style='background-color: #7070F0;'></option>";
	objselectfont += "<option value='#D0D0F0' style='background-color: #D0D0F0;'></option>";
	objselectfont += "<option value='#00F0F0' style='background-color: #00F0F0;'></option>";
	objselectfont += "<option value='#70F0F0' style='background-color: #70F0F0;'></option>";
	objselectfont += "<option value='#D0F0F0' style='background-color: #D0F0F0;'></option>";
	objselectfont += "<option value='#00F000' style='background-color: #00F000;'></option>";
	objselectfont += "<option value='#70F070' style='background-color: #70F070;'></option>";
	objselectfont += "<option value='#D0F0D0' style='background-color: #D0F0D0;'></option>";
	objselectfont += "<option value='#F0F000' style='background-color: #F0F000;'></option>";
	objselectfont += "<option value='#F0F070' style='background-color: #F0F070;'></option>";
	objselectfont += "<option value='#F0F0D0' style='background-color: #F0F0D0;'></option>";
	objselectfont += "</select>";

var objselectbkcol = "<select name='selectbkCol' id='selectbkCol'  style='width: 35px; padding: 0;margin: 0'> title='Couleur du surlignage'";
	objselectbkcol += "<option value='#CCF' style='background-color: #CCF; '></option>";
	objselectbkcol += "<option value='#CFC' style='background-color: #CFC; '></option>";
	objselectbkcol += "<option value='#FCC' style='background-color: #FCC; '></option>";
	objselectbkcol += "<option value='#FAC' style='background-color: #FAC; '></option>";
	objselectbkcol += "<option value='#FCF' style='background-color: #FCF; '></option>";
	objselectbkcol += "<option value='#FFC' style='background-color: #FFC; '></option>";
	objselectbkcol += "<option value='#CFF' style='background-color: #CFF; '></option>";
	objselectbkcol += "</select>";

var objselectsizefont ="<select name='selectsizefont' id='selectsizefont'  style='width: 45px; padding: 0;margin: 0'> title='Taille du texte'";
	objselectsizefont += "<option value='6pt' >06pt</option>";
	objselectsizefont += "<option value='8pt' >08pt</option>";
	objselectsizefont += "<option value='10pt' >10pt</option>";
	objselectsizefont += "<option value='12pt' >12pt</option>";
	objselectsizefont += "<option value='14pt' >14pt</option>";
	objselectsizefont += "<option value='16pt' >16pt</option>";
	objselectsizefont += "</select>";
	
	
 var formulaire = document.forms.frmComment;
   var valeurS=formulaire.elements.s.value;
    var valeurAuthorNickName= (formulaire.elements.authorNickName.value !=undefined ||formulaire.elements.authorNickName.value !="") ? (formulaire.elements.authorNickName.value) : "Visiteur";
    var valeurAuthorEmail= (formulaire.elements.authorEmail.value != undefined || formulaire.elements.authorEmail.value !="") ? (formulaire.elements.authorEmail.value) : ("visiteur@canalblog.com");
    var valeurAuthorWebsiteUrl= (formulaire.elements.authorWebsiteUrl.value != undefined || formulaire.elements.authorWebsiteUrl.value != "") ? (formulaire.elements.authorWebsiteUrl.value) : "";
    var valeurRememberInfo= formulaire.elements.rememberInfo.value ;
    var listeEmoticon = '';
	var textarea = 'document.frmComment.commentBody';
	if (listEmoticon.length <13) { var nbemoticon = listEmoticon.length; } else { var nbemoticon = 13 };
     for (var i = 0; i < nbemoticon; i++) {
     listeEmoticon +='<a href="javascript:;" onClick="InsererEmoticon(\'' + listEmoticon[i][0] + '\');visionner()"><img src="' + listEmoticon[i][1] + '"' + att + ' alt="' + listEmoticon[i][0] + '" title="' + listEmoticon[i][0] + '"  /></a>';
     }
	if(listEmoticon.length >13) { var outilPlusEmoticon = '<a onClick="openPopupSmilleys()"><img src="http://www.contes-de-web.fr/img/smileys+.jpg" alt="+ de smilleys" title="Autres Smileys" border="0" style="vertical-align: middle; margin-left: 10px;"  /></a>'; } else {var outilPlusEmoticon ='';}
    var outilSurlign = '<a onClick="SurlignInText();visionner()"><img src="http://storage.canalblog.com/62/72/604160/43780799.png" alt="Surligner" title="Surligner le texte" border="0" style="vertical-align: middle; margin-left: 10px;"  /></a>';
    var outilColorText = '<a onClick="colorInText();visionner()"><img src="http://storage.canalblog.com/56/40/604160/43780760.png" alt="Couleur" title="Couleur du texte" border="0" style="vertical-align: middle; margin-left: 10px;"  /></a>';
    var outilSizeText = '<a onClick="sizeInText();visionner()"><img src="http://storage.canalblog.com/38/91/604160/43780805.png" alt="Taille" title="Taille du texte" border="0" style="vertical-align: middle; margin-left: 10px;"  /></a>';
     var listeBOutils ='<a  onClick="insertURLInText();visionner()"><img src="' + BOutils[0][1] + '"  alt="' + BOutils[0][2] + '" title="' + BOutils[0][2] + '" border="0" style="vertical-align: middle;margin-left: 2px;" /></a>';
     listeBOutils += '<a  onClick="inserImgInText();visionner()"><img src="' + BOutils[1][1] + '"  alt="' + BOutils[1][2] + '" title="' + BOutils[1][2] + '" border="0" style="vertical-align: middle;margin-left: 2px;" /></a>';
     for (var i = 2; i < BOutils.length; i++) {
     listeBOutils += '<a  onClick="inserTagInText( \'' + BOutils[i][0] + '\');visionner()"><img src="' + BOutils[i][1] + '"  alt="' + BOutils[i][2] + '" title="' + BOutils[i][2] + '" border="0" style="vertical-align: middle;margin-left: 2px;" /></a>';
     }


  var nodeformulairesup = document.getElementById("frmComment");
  var feuillecontent = nodeformulairesup.parentNode;
  feuillecontent.removeChild(nodeformulairesup);
	
    var newformulaire = "<hr /><h2>Poster un commentaire</h2>";
	if (affvisu) {
    newformulaire += "<p>Aper&ccedil;u:<a onClick='visionner();'><img src='http://contes-de-web.fr/img/voir.jpg' alt='Aper&ccedil;u du commentaire' title='Aper&ccedil;u du commentaire' border='0' style='vertical-align:middle' /></a><br />";
    newformulaire += "<div id='visu' style='width: 100%; border: solid 1px; padding: 3px'></div></p>"; 
	}
    newformulaire += "<form action='' method='post' name='frmComment' id='frmComment' onsubmit='remplacerducode(this)'>";
    newformulaire += "<input type='hidden' id='s' name='s' value='" + valeurS + "' /> <p> ";
    newformulaire += "<label for='authorNickName'>Nom ou pseudo :</label> ";
    newformulaire += "<input id='authorNickName' name='authorNickName' value='" + valeurAuthorNickName + "' maxlength='16' style='width:200px' onchange='handleChange(this)' /> <br /> ";
    newformulaire += "<label for='authorEmail'>Adresse email :</label>";
    newformulaire += "<input id='authorEmail' name='authorEmail' value='" + valeurAuthorEmail + "' maxlength='64' style='width:250px' onchange='handleChange(this)' /> <br /> ";
    newformulaire += "<label for='authorWebsiteUrl'>Site Web (URL) :</label>";
    newformulaire += "<input id='authorWebsiteUrl' name='authorWebsiteUrl' value='" + valeurAuthorWebsiteUrl + "' maxlength='128' style='width:300px' onchange='handleChange(this)' /> </p> <p> ";
    newformulaire += "<label for='commentTitle'>Titre du commentaire :</label> ";
    newformulaire += "<input id='commentTitle' name='commentTitle' value='' maxlength='128' style='width:250px' /> <br />";
    newformulaire += "<label for='commentBody'>Commentaire </label>";
	if (affcouleurs) {
	newformulaire += outilColorText + objselectfont;
	newformulaire += outilSizeText + objselectsizefont;
	newformulaire += outilSurlign + objselectbkcol;
	newformulaire += " <br />";
	}
	if (affoutils) {
	newformulaire += listeBOutils;
	}
	if (affvisu) {
	newformulaire += "<br /><textarea onKeydown='visionner()' onKeyup='visionner()' id='commentBody' name='commentBody' rows='12' cols='58'></textarea> </p> <p>";
	} else {
	newformulaire += "<br /><textarea id='commentBody' name='commentBody' rows='12' cols='58'></textarea> </p> <p>";
    }
	newformulaire += listeEmoticon + outilPlusEmoticon;
	newformulaire += "</p>";
		if (affantispam) {
		newformulaire += "<label for='cantispam'>"+antispam.afficher+"&nbsp;</label>";
		newformulaire += "<input id='cantispam' name='cantispam' value='' length='128' /><br />";
		newformulaire += "Veuillez saisir les 5 lettres, <B>en majuscule</B>, afin de valider l\'envoi, merci";
		}
    newformulaire += "<p><input onclick='handleCheck(this)' type='checkbox' id='rememberInfo' name='rememberInfo' value='1' /><label> ";
    newformulaire += "Se souvenir de mes informations personnelles</label> </p> <input  type='submit' name='submit' value='Envoyer' /> <br /></form> ";

feuillecontent.innerHTML = feuillecontent.innerHTML.replace("Poster un commentaire","<hr />") + newformulaire;
if (valeurAuthorNickName) document.frmComment.rememberInfo.checked = 1;
}
}



function remplacerSmileys() {
SwapCodeEmoticon("leftbar","navlinks");
SwapCodeEmoticon("content","blogbody");
SwapCodeEmoticon("rightbar","navlinks");
SwapCodeMenu("menu3");
}
var antispam= new codeASpam();	
document.write('<a href="http://alerionexemple.canalblog.com/archives/2008/07/22/10009321.html" alt="Ajout Smileys" title="Ajout Smileys" target="_blank"><img src="http://contes-de-web.fr/img/alerion_ico.gif" /></a>');
addEvent(window, "load", remplacerSmileys);
addEvent(window, "load", modifierformulaire);