function htmlspecialchars(_1){_1=_1+"";var _2=new Array("\"","'","&","/","\\","?","=","<",">");var _3=new Array("&quot;","&acute;","&amp;","&frasl;","&#92;","&#63;","&#61;","&lt;","&gt;");var _4="";for(var i=0;i<_1.length;i++){var _6=false;for(var j=0;j<_2.length;j++){if(_1.charAt(i)==_2[j]){_4=_4+_3[j];_6=true;}}if(!_6){_4=_4+_1.charAt(i);}}return _4;}function formCharControl(_8){var i=0;while(_8[i]!=null){_8[i].value=htmlspecialchars(_8[i].value);i++;}}function errorOnSpecialChars(_a){_a.value=htmlspecialchars(_a.value||"");return true;}function formErrorChars(_b){var i=0;while(_b[i]!=null){if(errorOnSpecialChars(_b[i])==false){return false;}i++;}return true;}function formErrorOnBlank(_d){var i=0;while(_d[i]!=null){;if(_d[i].value==""&&_d[i].name){alert("Devi completare il campo "+_d[i].name);return false;}i++;}return true;}function errorOnBlank(_f){_f=_f+"";var _10=_f.split(",");var _11;for(i=0;i<_10.length;i++){_11=document.getElementById(_10[i]);if(_11.value==""){alert("Devi completare il campo "+_11.name);return false;}}return true;}function formControl(_12){return formErrorChars(_12)&&formErrorOnBlank(_12);}function svuotaCampo(_13){_13.value="";}function svuotaCampoOnce(_14,_15){if(_14.value==_15){_14.value="";}}function textareaCharsLimit(_16,_17){if(_16.value.length>_17){_16.value=_16.value.substring(0,_17);alert("Errore: non puoi inserire piu' di "+_17+" caratteri.");}}function usernameCheck(_18){errorOnSpecialChars(_18);var str=_18.value;var err=false;if(str.indexOf(" ")!=-1){alert("Errore: non sono ammessi spazi nel nickname");while(str!=str.replace(" ","")){str=str.replace(" ","");}err=true;}if(str.length<4){alert("Errore: nickname troppo breve");str="";err=true;}if(err){_18.value=str;return false;}else{return true;}}function emailCheck(_1b){errorOnSpecialChars(_1b);var str=_1b.value;var _1d=str.split("@");if(_1d.length!=2){alert("Hai dimenticato la @");return false;}else{if((_1d[0].length<4)||(_1d[1].length<4)){alert("Avviso: email troppo breve, probabile errore di battitura");return false;}else{return true;}}}function codFiscCheck(_1e){var str=_1e.value+"";if(str.length!=16){alert("Errore: Lunghezza campo errata");return false;}else{var txt=str.substr(0,6)+str.substr(8,1)+str.substr(11,1)+str.substr(15,1);var num=str.substr(6,2)+str.substr(9,2)+str.substr(12,3);if(isNaN(num)){alert("formato errato");return false;}else{for(var i=0;i<txt.length;i++){if(!isNaN(txt.charAt(i))){alert("formato errato");return false;}}return true;}}}
