function ValidarNews(fnews) { with(fnews) { if (email2.value =="") { alert("Please enter your e-mail address."); email2.focus(); return false; } mail = email2.value; if (mail != "") { if ( (mail.indexOf ('@',0) == -1 ) || (mail.indexOf (' ',0) != -1 ) || (mail.indexOf (';',0) != -1 ) || (mail.indexOf ('>',0) != -1 ) || (mail.indexOf ('|',0) != -1 ) || (mail.indexOf ('&',0) != -1 ) || (mail.indexOf (';',0) != -1 ) || (mail.indexOf (':',0) != -1 ) || (mail.indexOf ('!',0) != -1 ) || (mail.indexOf ('/',0) != -1 ) || (mail.indexOf ('>',0) != -1 ) || (mail.indexOf ('*',0) != -1 ) || (mail.indexOf ('"',0) != -1 ) || (mail.indexOf ('$',0) != -1 ) || (mail.indexOf ('`',0) != -1 ) || ((mail.length - 1 )==mail.lastIndexOf('@')) || ((mail.length - 1) == mail.lastIndexOf('.')) || (mail.indexOf ('@',0) > mail.lastIndexOf('.')) || (mail.indexOf ('@',0) != mail.lastIndexOf('@')) ) { alert("The e-mail address is not valid. Please, try again."); email2.select(); email2.focus(); return false; } } } return true; } function ValidarProductoRegistracion(f1) { with(f1) { if(nombre.value=="") { alert("Please enter your name"); nombre.focus(); return false; } if(apellido.value=="") { alert("Please enter your last name"); apellido.focus(); return false; } if(direccion.value=="") { alert("Please enter your address"); direccion.focus(); return false; } if(pais.value=="2") { if(id_pais.value=="0") { alert("Please choose the country"); id_pais.focus(); return false; } } else { if(id_provincia.value=="0") { alert("Please cose the state"); id_provincia.focus(); return false; } /*if(id_localidad.value=="0") { alert("Por favor seleccione la Ciudad"); id_localidad.focus(); return false; }*/ } if(tel2.value=="" && tel3.value=="") { alert("Please enter your phone"); tel1.focus(); return false; } if (email.value =="") { alert("Please enter your e-mail address. \nAÉste será su usuario para realizar la compra"); email.focus(); return false; } mail = email.value; if (mail != "") { if ( (mail.indexOf ('@',0) == -1 ) || (mail.indexOf (' ',0) != -1 ) || (mail.indexOf (';',0) != -1 ) || (mail.indexOf ('>',0) != -1 ) || (mail.indexOf ('|',0) != -1 ) || (mail.indexOf ('&',0) != -1 ) || (mail.indexOf (';',0) != -1 ) || (mail.indexOf (':',0) != -1 ) || (mail.indexOf ('!',0) != -1 ) || (mail.indexOf ('/',0) != -1 ) || (mail.indexOf ('>',0) != -1 ) || (mail.indexOf ('*',0) != -1 ) || (mail.indexOf ('"',0) != -1 ) || (mail.indexOf ('$',0) != -1 ) || (mail.indexOf ('`',0) != -1 ) || ((mail.length - 1 )==mail.lastIndexOf('@')) || ((mail.length - 1) == mail.lastIndexOf('.')) || (mail.indexOf ('@',0) > mail.lastIndexOf('.')) || (mail.indexOf ('@',0) != mail.lastIndexOf('@')) ) { alert("The e-mail address is not valid. Please, try again."); email.select(); email.focus(); return false; } } if (producto.value =="") { alert("Please enter the product name"); producto.focus(); return false; } if (serie1.value=="" && serie2.value=="") { alert("Please enter at least one serial number"); serie1.focus(); return false; } } return true; } function ValidarRegistracion(f1) { with(f1) { if(nombre.value=="") { alert("Please enter your name"); nombre.focus(); return false; } if(apellido.value=="") { alert("Please enter your last name"); apellido.focus(); return false; } if(direccion.value=="") { alert("Please enter your address"); direccion.focus(); return false; } if(pais.value=="2") { if(id_pais.value=="0") { alert("Please choose the country"); id_pais.focus(); return false; } } else { if(id_provincia.value=="0") { alert("Please cose the state"); id_provincia.focus(); return false; } /*if(id_localidad.value=="0") { alert("Por favor seleccione la Ciudad"); id_localidad.focus(); return false; }*/ } if(tel2.value=="" && tel3.value=="") { alert("Please enter your phone"); tel1.focus(); return false; } if (email.value =="") { alert("Please enter your e-mail address. \nAÉste será su usuario para realizar la compra"); email.focus(); return false; } mail = email.value; if (mail != "") { if ( (mail.indexOf ('@',0) == -1 ) || (mail.indexOf (' ',0) != -1 ) || (mail.indexOf (';',0) != -1 ) || (mail.indexOf ('>',0) != -1 ) || (mail.indexOf ('|',0) != -1 ) || (mail.indexOf ('&',0) != -1 ) || (mail.indexOf (';',0) != -1 ) || (mail.indexOf (':',0) != -1 ) || (mail.indexOf ('!',0) != -1 ) || (mail.indexOf ('/',0) != -1 ) || (mail.indexOf ('>',0) != -1 ) || (mail.indexOf ('*',0) != -1 ) || (mail.indexOf ('"',0) != -1 ) || (mail.indexOf ('$',0) != -1 ) || (mail.indexOf ('`',0) != -1 ) || ((mail.length - 1 )==mail.lastIndexOf('@')) || ((mail.length - 1) == mail.lastIndexOf('.')) || (mail.indexOf ('@',0) > mail.lastIndexOf('.')) || (mail.indexOf ('@',0) != mail.lastIndexOf('@')) ) { alert("The e-mail address is not valid. Please, try again."); email.select(); email.focus(); return false; } } if (pass1.value =="") { alert("Please enter your password"); pass1.focus(); return false; } if (pass1.value != pass2.value) { alert("The password and confirmation do not match."); pass2.select(); pass2.focus(); return false; } } return true; } function ValidarDirEntrega(f1) { with(f1) { if(nombre.value=="") { alert("Please enter your name"); nombre.focus(); return false; } if(apellido.value=="") { alert("Please enter your last name"); apellido.focus(); return false; } if(pais.value=="2") { if(id_pais.value=="0") { alert("Please choose the country"); id_pais.focus(); return false; } } else { if(id_provincia.value=="0") { alert("Please cose the state"); id_provincia.focus(); return false; } } if(direccion.value=="") { alert("Please enter your address"); direccion.focus(); return false; } } return true; } function ValidarEdicion(f1) { with(f1) { if(nombre.value=="") { alert("Please enter your name"); nombre.focus(); return false; } if(apellido.value=="") { alert("Please enter your last name"); apellido.focus(); return false; } if(direccion.value=="") { alert("Please enter your address"); direccion.focus(); return false; } if(pais.value=="2") { if(id_pais.value=="0") { alert("Please choose the country"); id_pais.focus(); return false; } } else { if(id_provincia.value=="0") { alert("Please cose the state"); id_provincia.focus(); return false; } } if(tel2.value=="" && tel3.value=="") { alert("Please enter your phone"); tel1.focus(); return false; } if (email.value =="") { alert("Please enter your e-mail address. \nAÉste será su usuario para realizar la compra"); email.focus(); return false; } mail = email.value; if (mail != "") { if ( (mail.indexOf ('@',0) == -1 ) || (mail.indexOf (' ',0) != -1 ) || (mail.indexOf (';',0) != -1 ) || (mail.indexOf ('>',0) != -1 ) || (mail.indexOf ('|',0) != -1 ) || (mail.indexOf ('&',0) != -1 ) || (mail.indexOf (';',0) != -1 ) || (mail.indexOf (':',0) != -1 ) || (mail.indexOf ('!',0) != -1 ) || (mail.indexOf ('/',0) != -1 ) || (mail.indexOf ('>',0) != -1 ) || (mail.indexOf ('*',0) != -1 ) || (mail.indexOf ('"',0) != -1 ) || (mail.indexOf ('$',0) != -1 ) || (mail.indexOf ('`',0) != -1 ) || ((mail.length - 1 )==mail.lastIndexOf('@')) || ((mail.length - 1) == mail.lastIndexOf('.')) || (mail.indexOf ('@',0) > mail.lastIndexOf('.')) || (mail.indexOf ('@',0) != mail.lastIndexOf('@')) ) { alert("The e-mail address is not valid. Please, try again."); email.select(); email.focus(); return false; } } } return true; } /* var filtro = new XHR({ method: 'get', onSuccess: myOnSuccess, onRequest: comenzar, onFailure: function(req) {alert(req);} }) function comenzar(){ var myFx = new Fx.Style('id_localidad', 'opacity').set(0); var myFx2 = new Fx.Style('loading', 'opacity').set(1); } function myOnSuccess(request){ var xmldoc = request; var aux = xmldoc.split('|'); var sel = $('id_localidad'); sel.options.length = null; sel.options[0] = new Option("Seleccione...","0"); for(var i=0;i