function ajaxPreview(){var b=document.REPLIER.Post.value,a=document.getElementById("ajaxReply");if(b){$.post("index.php",{ajax:"Post",Post:b},function(c){a.innerHTML=c})}}function insert(g,e){var a=document.REPLIER.Post;if(typeof(a.caretPos)!="undefined"&&a.createTextRange){var h=a.caretPos,j=h.text.length;h.text=h.text.charAt(h.text.length-1)==" "?g+h.text+e+" ":g+h.text+e;if(!j){h.moveStart("character",-e.length);h.moveEnd("character",-e.length);h.select()}else{a.focus(h)}}else{if(typeof(a.selectionStart)!="undefined"){var c=a.value.substr(0,a.selectionStart),i=a.value.substr(a.selectionStart,a.selectionEnd-a.selectionStart),f=a.value.substr(a.selectionEnd),d=a.selectionStart,b=a.scrollTop;a.value=c+g+i+e+f;if(a.setSelectionRange){if(!i.length){a.setSelectionRange(d+g.length,d+g.length+0)}else{a.setSelectionRange(d+0,d+g.length+i.length+e.length)}a.focus()}a.scrollTop=b}else{a.value+=g+e}}a.focus(a.value.length-1)}function cache(a){if(typeof(a.createTextRange)!="undefined"){a.caretPos=document.selection.createRange().duplicate()}}function tag(b,a){if(document.REPLIER.bbmode[0].checked){string=prompt(prompt_start+"\n"+b+"xxx"+a,"");if(string!=null&&string!=""){b+=string+a;a=""}else{return}}insert(b,a)}var MessageMax="";var Override="";MessageMax=parseInt(MessageMax);if(MessageMax<0){MessageMax=0}function PopUp(b,c,d,i,a,e,h,j,f){if(j!=0){x=j}if(f!=0){y=f}if(!h){h=1}if(!e){e=1}if((parseInt(navigator.appVersion)>=4)&&(a)){X=(screen.width-d)/2;Y=(screen.height-i)/2}if(h!=0){h=1}var g=window.open(b,c,"width="+d+",height="+i+",top="+Y+",left="+X+",resizable="+e+",scrollbars="+h+",location=no,directories=no,status=no,menubar=no,toolbar=no")}function emo_pop(){window.open("index.php?act=legends&CODE=emoticons&s=","Legends","width=250,height=500,resizable=yes,scrollbars=yes")}function bbc_pop(){window.open("index.php?act=legends&CODE=bbcode&s=","Legends","width=700,height=500,resizable=yes,scrollbars=yes")}function CheckLength(){MessageLength=document.REPLIER.Post.value.length;message="";if(MessageMax>0){message="Messaggio: Lunghezza massima "+MessageMax+" caratteri."}else{message=""}alert(message+"      Fino ad ora hai utilizzato "+MessageLength+" caratteri.")}function ValidateForm(a){MessageLength=document.REPLIER.Post.value.length;errors="";if(a==1){if(document.REPLIER.msg_title.value.length<2){errors="Devi inserire un titolo per il messaggio"}}if(MessageLength<2){errors="Devi inserire un messaggio per poterlo inviare!"}if(MessageMax!=0){if(MessageLength>MessageMax){errors="Lunghezza massima "+MessageMax+" caratteri. Caratteri utilizzati: "+MessageLength}}if(errors!=""&&Override==""){alert(errors);return false}else{document.REPLIER.submit.disabled=true;return true}}var text_enter_url="Inserisci l'URL completa per il link";var text_enter_url_name="Inserisci il titolo della pagina web";var text_enter_image="Inserisci l'URL completa dell'immagine che vuoi inviare";var text_enter_email="Inserisci l'indirizzo email";var text_enter_flash="Inserisci l'URL del filmato flash.";var text_code="Uso: [CODE] codice.. [/CODE]";var text_quote="Uso: [QUOTE] Messaggio da citare... [/QUOTE]";var error_no_url="Devi inserire un'URL";var error_no_title="Devi inserire un titolo";var error_no_email="Devi inserire un indirizzo email";var error_no_width="Devi inserire una larghezza";var error_no_height="Devi inserire un altezza";var prompt_start="Inserisci il testo da formattare";var help_bold="Inserisci Testo in Grassetto (alt + b)";var help_italic="Inserisci Testo in Corsivo (alt + i)";var help_under="Inserisci Testo Sottolineato (alt + u)";var help_font="Inserisci Tag tipo Carattere";var help_size="Inserisci Tag Grandezza Carattere";var help_color="Inserisci Tag Colore Carattere";var help_close="Chiudi Tutti i Tag aperti";var help_url="Inserisci un Collegamento (alt+ h)";var help_img="Inserisci Immagine (alt + g) [img]http://www.dom.com/img.gif[/img]";var help_email="Inserisci Indirizzo Email (alt + e)";var help_quote="Inserisci Citazione (alt + q)";var help_list="Crea una Lista (alt + l)";var help_code="Inserisci Testo a Passo Fisso (alt + p)";var help_click_close="Clicca di nuovo sopra il pulsante per chiudere il Tag";var list_prompt="Inserisci una Voce della lista. Clicca su 'Cancella' o lascia vuoto per chiudere la lista";