function fnLoadPage(page,div,hideWait){ var sParam=''; var aux1= new Array(); var aux2= new Array(); aux1=page.split('?'); //alert('1.1'); if(aux1.length>1){ //alert('1.2'); sParam=addPostParam(sParam,"page",aux1[0]); var aux2=aux1[1].split('&'); for(i=0; i < aux2.length; i++){ aux1=aux2[i].split('='); sParam=addPostParam(sParam,aux1[0],aux1[1]); } }else{ sParam=addPostParam(sParam,"page",page); } //alert('1.3'); //alert(sParam); //alert(div); var oRequest=fnCallByAjax("hole.php",sParam,div,hideWait); } function fnLoadPageTraduzioni(page,div,hideWait){ var sParam=''; var aux1= new Array(); var aux2= new Array(); aux1=page.split('?'); //alert('1.1'); if(aux1.length>1){ //alert('1.2'); sParam=addPostParam(sParam,"page",aux1[0]); var aux2=aux1[1].split('&'); for(i=0; i < aux2.length; i++){ aux1=aux2[i].split('='); sParam=addPostParam(sParam,aux1[0],aux1[1]); } }else{ sParam=addPostParam(sParam,"page",page); } //alert('1.3'); //alert(sParam); //alert(div); var oRequest=fnCallByAjax("http://www.mazzamurilli.com/hole.php",sParam,div,hideWait); } function fnOpenWindow(web,name,params){ window.open(web,name,params); } function fnShowHidden(id){ var oObject=document.getElementById(id); if(oObject.style.display=='none'){ oObject.style.display=''; }else{ oObject.style.display='none'; } } function fnHiddenMenu(){ document.getElementById('divMenu').style.visibility = 'hidden'; document.getElementById('divMenu').style.width = '0px'; document.getElementById('divMenuHide').style.visibility = 'visible'; document.getElementById('divMenuHide').style.width = '15px'; document.getElementById('worktable').style.left = '15px'; } function fnShowMenu(){ document.getElementById('divMenuHide').style.visibility = 'hidden'; document.getElementById('divMenuHide').style.width = '0px'; document.getElementById('divMenu').style.visibility = 'visible'; document.getElementById('divMenu').style.width = '180px'; document.getElementById('worktable').style.left = '180px'; } function fnCleanTag(tgName){ //alert('qui'); //alert(tgName); var tg = document.getElementById(tgName); if(tg) tg.innerHTML = ''; } function trim(cad){ if(!cad) return false; var cadena=''; for(ci=0 ; ci < cad.length ;ci++) cadena+=(cad.charAt(ci)==" ")?'':cad.charAt(ci); return (!cadena.length)? false:cadena; } function validateEmail(value){ mailExp=/[\w-\.]{3,}@([\w-]{2,}\.)*([\w-]{2,}\.)[\w-]{2,4}/; if(!mailExp.test(value)){ return false; }else{ return true; } } function fnSaveTraduzione(){ var sParam=''; // Check some value of form // And assign the value to the POST if (!trim(document.formtraduzione.email.value)) { alert("The e-mail cannot be null"); document.formtraduzione.email.focus(); return false; }else{ if (!validateEmail(document.formtraduzione.email.value)){ alert("The e-mail is not correct"); document.formtraduzione.email.focus(); return false; }else{ var email = document.getElementById('email').value; sParam=addPostParam(sParam,"email",email); } } if (!trim(document.formtraduzione.titoloTradotto.value)) { alert("The title cannot be null"); document.formtraduzione.titoloTradotto.focus(); return false; }else{ var titoloTradotto = document.getElementById('titoloTradotto').value; sParam=addPostParam(sParam,"titoloTradotto",titoloTradotto); } if (!trim(document.formtraduzione.testoTradotto.value)) { alert("The description cannot be null"); document.formtraduzione.testoTradotto.focus(); return false; }else{ var testoTradotto = document.getElementById('testoTradotto').value; sParam=addPostParam(sParam,"testoTradotto",testoTradotto); } var idPage = document.getElementById('idPage').value; sParam=addPostParam(sParam,"idPage",idPage); var idMenu = document.getElementById('idMenu').value; sParam=addPostParam(sParam,"idMenu",idMenu); var idLanguage = document.getElementById('idLanguage').value; sParam=addPostParam(sParam,"idLanguage",idLanguage); sParam=addPostParam(sParam,"page","fnSaveTraduzione"); var sAux=fnCallByAjax("http://www.mazzamurilli.com/hole.php",sParam,"",1,false,true); if (!sAux){ alert("Errore durante invio dei dati dei dati"); return false; }else{ alert("The data has been sended correctly. You will receive our email, when we will pubblic your traduction. Thanks for your time!"); fnCleanTag('formtraduzione'); } } function fnSaveGuestbook(){ var sParam=''; // Check some value of form // And assign the value to the POST if (!trim(document.formcommento.nome.value)) { alert("Il nome non puo' essere nullo"); document.formcommento.nome.focus(); return false; }else{ var nome = document.getElementById('nome').value; sParam=addPostParam(sParam,"nome",nome); } if (!trim(document.formcommento.cognome.value)) { alert("Il cognome non puo' essere nullo"); document.formcommento.cognome.focus(); return false; }else{ var cognome = document.getElementById('cognome').value; sParam=addPostParam(sParam,"cognome",cognome); } if (!trim(document.formcommento.email.value)) { alert("L'indirizzo di e-mail non puo' essere nullo"); document.formcommento.email.focus(); return false; }else{ if (!validateEmail(document.formcommento.email.value)){ alert("La mail non e' corretta"); document.formcommento.email.focus(); return false; }else{ var email = document.getElementById('email').value; sParam=addPostParam(sParam,"email",email); } } if (!trim(document.formcommento.citta.value)) { alert("La citta' non puo' essere nulla"); document.formcommento.citta.focus(); return false; }else{ var citta = document.getElementById('citta').value; sParam=addPostParam(sParam,"citta",citta); } if (!trim(document.formcommento.commento.value)) { alert("Il testo del commento non puo' essere nullo"); document.formcommento.commento.focus(); return false; }else{ var commento = document.getElementById('commento').value; sParam=addPostParam(sParam,"commento",commento); } sParam=addPostParam(sParam,"page","fnSaveGuestbook"); var sAux=fnCallByAjax("hole.php",sParam,"",1,false,true); if (!sAux){ alert("Errore durante invio dei dati dei dati"); return false; }else{ alert("I dati sono stati salvati con successo. Riceverai una mail una volta che saranno stati pubblicati!"); fnCleanTag('formCommento'); } }