function switchMenu(obj) { var el = document.getElementById(obj); if ( el.style.display != 'none' ) { el.style.display = 'none'; } else { el.style.display = ''; } } function compter(chaine) { var exp=new RegExp("[a-zA-Z0-9éèêëàáâäóòôöíìîïçÉÈÊËÀÁÂÄÒÓÔÖÌÍÎÏÇ-]+","g"); var tabNom=chaine.match(exp); if(tabNom==null) return 0; return tabNom.length; } function verif_formulaire_reco() { if(document.myFormReco.firstname.value == ""){ window.alert('Por favor, complete usted correctamente los campos obligatorios'); document.myFormReco.firstname.focus(); return false; } if(document.myFormReco.lastname.value == ""){ window.alert('Por favor, complete usted correctamente los campos obligatorios'); document.myFormReco.lastname.focus(); return false; } if(document.myFormReco.email.value == ""){ window.alert('Por favor, complete usted correctamente los campos obligatorios'); document.myFormReco.email.focus(); return false; } adresse = document.myFormReco.email.value; var place = adresse.indexOf("@",1); var point = adresse.indexOf(".",place+1); if ((place > -1)&&(adresse.length >2)&&(point > 1)) { } else { window.alert("Por favor, complete usted correctamente los campos obligatorios"); document.myFormReco.email.focus(); return false; } if(document.myFormReco.email2.value == ""){ window.alert('Por favor, complete usted correctamente los campos obligatorios'); document.myFormReco.email2.focus(); return false; } adresse2 = document.myFormReco.email2.value; var place2 = adresse2.indexOf("@",1); var point2 = adresse2.indexOf(".",place+1); if ((place2 > -1)&&(adresse2.length >2)&&(point2 > 1)) { formObj2.submit();switchMenu('reco'); document.getElementById('ajoutereco').removeAttribute("href"); document.getElementById('ajoutereco2').removeAttribute("href"); document.getElementById('reco').innerHtml=''; } else { window.alert("Por favor, complete usted correctamente los campos obligatorios"); document.myFormReco.email2.focus(); return false; } } function verif_formulaire_comm() { if(document.myFormCommentChanson.pseudo.value == ""){ window.alert('Por favor, complete usted correctamente los campos obligatorios'); document.myFormCommentChanson.pseudo.focus(); return false; } if(document.myFormCommentChanson.pseudo.value.length < 2 ){ window.alert('Por favor, complete usted correctamente los campos obligatorios'); document.myFormCommentChanson.pseudo.focus(); return false; } if(document.myFormCommentChanson.email.value == ""){ window.alert('Por favor, complete usted correctamente los campos obligatorios'); document.myFormCommentChanson.email.focus(); return false; } adresse = document.myFormCommentChanson.email.value; var place = adresse.indexOf("@",1); var point = adresse.indexOf(".",place+1); if ((place > -1)&&(adresse.length >2)&&(point > 1)) { } else { window.alert("Por favor, complete usted correctamente los campos obligatorios"); document.myFormCommentChanson.email.focus(); return false; } if(document.myFormCommentChanson.orthographe.checked == false) { window.alert('Por favor, complete usted correctamente los campos obligatorios'); document.myFormCommentChanson.orthographe.focus(); return false; } if(document.myFormCommentChanson.commentaire.value == ""){ window.alert('Por favor, complete usted correctamente los campos obligatorios'); document.myFormCommentChanson.commentaire.focus(); return false; } var nombreDeMots = compter(document.myFormCommentChanson.commentaire.value) ; if( nombreDeMots < 40) { window.alert('Su comentario debe contener al menos 40 palabras\nEl número de palabras que usted ha introducido hasta ahora: '+nombreDeMots); document.myFormCommentChanson.commentaire.focus(); return false; } if(document.myFormCommentChanson.commentaire.value.length < 200) { window.alert('Su comentario debe sobrepasar 200 letras'); document.myFormCommentChanson.commentaire.focus(); return false; } else { formObjCommentchanson.submit();switchMenu('addcomments'); } }