function popup_smileys() { var width = 350; var height = 350; window.open('./myspeach/smile.php', 'cp', 'resizable=yes, location=no, width=' +width+', height='+height+', menubar=no, status=yes, scrollbars=1, menubar=no'); } var imageTag = false; var theSelection = false; function checkForm() { formErrors = false; if (document.myspeach.MSpseudo.value.length < 2) { formErrors = "Vous devez entrer un -- pseudo -- avant de poster."; } if (document.myspeach.MSmessage.value.length < 2) { formErrors = "Vous devez entrer un -- message -- avant de poster."; } if (document.myspeach.MSpseudo.value == "Pseudo") { formErrors = "Vous devez entrer un pseudo autre que -- Pseudo --."; } if (formErrors) { alert(formErrors); return false; } else { bbstyle(-1); return true; } } function emoticon(text) { var txtarea = document.myspeach.MSmessage; text = ' ' + text + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text; txtarea.focus(); } else { txtarea.value += text; txtarea.focus(); } } var max=150; function compter(f) { var txt=f.MSmessage.value; var nb=txt.length; if (nb>max) { alert("Pas plus de "+max+" caractères !"); f.MSmessage.value=txt.substring(0,max); nb=max; } f.nbcar.value=max-nb; } function timer() { compter(document.forms["form1"]); setTimeout("timer()",100); }