function formSubmit() { document.getElementById("newcomment").submit(); } function quote(comment, commauthor) { var reply = document.getElementById("reply"); var commauthordiv = document.getElementById("commauthor"); if (reply.value > 0) { var link = document.getElementById("a"+reply.value); link.removeChild(link.firstChild); var newtxt = document.createTextNode("R\351pondre"); link.appendChild(newtxt); document.getElementById("t"+reply.value).className = "comment"; commauthordiv.removeChild(commauthordiv.firstChild); var commauthorname = document.createTextNode("---"); commauthordiv.appendChild(commauthorname); } if (reply.value == comment) { var link = document.getElementById("a"+comment); link.removeChild(link.firstChild); var newtxt = document.createTextNode("R\351pondre"); link.appendChild(newtxt); reply.value = 0; commauthordiv.removeChild(commauthordiv.firstChild); var commauthorname = document.createTextNode("---"); commauthordiv.appendChild(commauthorname); } else { var link = document.getElementById("a"+comment); link.removeChild(link.firstChild); var newtxt = document.createTextNode("Ne pas r\351pondre"); link.appendChild(newtxt); document.getElementById("t"+comment).className = "commentselected"; reply.value = comment; commauthordiv.removeChild(commauthordiv.firstChild); var commauthorname = document.createTextNode(commauthor); commauthordiv.appendChild(commauthorname); } if (reply.value > 0) setTimeout("goToForm()", 700); } function goToForm() { window.location = "#postcomment"; document.getElementById("text").focus(); } function addSmiley(smiley) { var text = document.getElementById("text"); if (document.selection && document.selection.createRange) { text.focus(); var sel = document.selection.createRange(); sel.text += smiley; } else if (text.selectionStart || text.selectionStart == '0') { var startPos = text.selectionStart; var endPos = text.selectionEnd; text.value = text.value.substring(0, startPos) + smiley + text.value.substring(endPos, text.value.length); text.selectionStart = text.selectionEnd = endPos + smiley.length; } else { text.value += smiley; } text.focus(); } function scrollSmilies(action) { var sliderLeft = document.getElementById("smileyslider").offsetLeft; var sliderWidth = document.getElementById("smileytable").offsetWidth; var contWidth = document.getElementById("smileydiv").offsetWidth; if (action == "l") { var newPos = sliderLeft + 4; if (newPos > 0) newPos = 0; } else { if (sliderWidth > contWidth) { var newPos = sliderLeft - 4; var sliderInnerWidth = sliderWidth - Math.abs(newPos); if (sliderInnerWidth < contWidth) newPos = -(sliderWidth - contWidth); } } document.getElementById("smileyslider").style.left = newPos + "px"; scrolltimer = setTimeout("scrollSmilies('"+action+"')", 1); } function stopScrollSmilies() { clearTimeout(scrolltimer); } function formReset() { var form = document.getElementById("newcomment"); var commauthordiv = document.getElementById("commauthor"); commauthordiv.removeChild(commauthordiv.firstChild); var commauthorname = document.createTextNode("---"); commauthordiv.appendChild(commauthorname); for (i = 0; i < form.elements.length; i++) { if (form.elements[i].name == "reply") { var reply = form.elements[i]; if (reply.value > 0) { var link = document.getElementById("a"+reply.value); link.removeChild(link.firstChild); var newtxt = document.createTextNode("R\351pondre"); link.appendChild(newtxt); document.getElementById(reply.value).className = "comment"; } } if (form.elements[i].name != "entrynum") form.elements[i].value = ""; } } function showErrors() { document.getElementById("errorsdiv").style.display = ""; document.getElementById("detailsbutton").style.display = "none"; }