function acceptar(){ if(document.nou_usuari.accept.checked){ document.nou_usuari.accept.checked = false; document.nou_usuari.submit(); return true; } else { return false; } } /// Funcions d'imatges /// /** Carrega un conjunt d'imatges a un array, per cada imatge guarda la ruta. Rep per par�metre un o m�s literals, cada literal �s el valor del camp id de la imatge que volem carregar. */ function carrega_imatge() { var d = document; if (d.images) { if (!d.imatges) d.imatges = new Array(); var i = d.imatges.length; var a = carrega_imatge.arguments; var img = ''; for (i = 0; i recuperar el seu valor (ruta) original. */ function restableix_imatge(imatge_old) { var d = document; if (d.imatges) { var o = d.getElementById(imatge_old); if (o != undefined) o.src = d.imatges[imatge_old].src; } } function validaData(){ if ((document.insertusua.password.value != '') && (document.insertusua.confirm.value != '') && (document.insertusua.nom.value != '') && (document.insertusua.llinatges.value != '') && (document.insertusua.mail.value != '') && (document.insertusua.usu_idioma.value != '')) { if(document.insertusua.password.value.length >= 6){ if(document.insertusua.password.value == document.insertusua.confirm.value){ if(echeck(document.insertusua.mail.value)){ document.insertusua.submit(); } else { alert('???alerta8???'); } } else { alert('???alerta3???'); } } else { alert('???alerta4???'); } } else { alert('???alerta2???'); } } /** * Valida un e-mail */ function echeck(str) { var at="@"; var dot="."; var lat=str.indexOf(at); var lstr=str.length; var ldot=str.indexOf(dot); if (str.indexOf(at)==-1){ return false; } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false; } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ return false; } if (str.indexOf(at,(lat+1))!=-1){ return false; } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ return false; } if (str.indexOf(dot,(lat+2))==-1){ return false; } if (str.indexOf(" ")!=-1){ return false; } return true; } function destriar(numero){ if (numero == 1){ document.llista.forma.value = "mod"; document.llista.submit(); } if (numero == 2){ document.llista.forma.value = "del"; document.llista.submit(); } } function validaSend() { if ((document.email.direccio_desti.value != '') && (document.email.direccio_origen.value != '') && (echeck(document.email.direccio_origen.value)) && (echeck(document.email.direccio_desti.value))) { document.email.submit(); } else { alert("???alerta7???"); } }