// JavaScript Document
function validarForm(thisForm) {
	if(thisForm.txtNombre.value == ''){
		alert('Debe ingresar el nombre.');
		thisForm.txtNombre.focus();
		return false;
	}

	if(thisForm.txtApellido.value == ''){
		alert('Debe ingresar el apellido.');
		thisForm.txtApellido.focus();
		return false;
	}

	if(thisForm.txtDni.value == ''){
		alert('Debe ingresar el DNI.');
		thisForm.txtDni.focus();
		return false;
	}
	
	if(thisForm.txtCiudad.value == ''){
		alert('Debe ingresar la ciudad.');
		thisForm.txtCiudad.focus();
		return false;
	}
	
	if(thisForm.txtProvincia.value == ''){
		alert('Debe ingresar la provincia.');
		thisForm.txtProvincia.focus();
		return false;
	}
	
	if(thisForm.txtPais.value == ''){
		alert('Debe ingresar el país.');
		thisForm.txtPais.focus();
		return false;
	}
	
	if(thisForm.txtTelefono.value == ''){
		alert('Debe ingresar el teléfono.');
		thisForm.txtTelefono.focus();
		return false;
	}
	
	if(thisForm.txtMail.value == ''){
		alert('Debe ingresar el e-mail.');
		thisForm.txtMail.focus();
		return false;
	}else{		
		re=/\w+([-+.]\w+)*@\w+([-]\w+)*\.\w+([.]\w+)*/;
		if (!re.test(thisForm.txtMail.value)) 
		{
			alert("El e-mail ingresado es incorrecto, inténtelo de nuevo");
			thisForm.txtMail.focus();
			return false;	
		}
	}
	
	if(thisForm.txtPassword.value == ''){
		alert('Debe ingresar la contraseña.');
		thisForm.txtPassword.focus();
		return false;
	}
	
	if(thisForm.txtPassword2.value == ''){
		alert('Debe ingresar la confirmación de la contraseña.');
		thisForm.txtPassword2.focus();
		return false;
	}
	
	if(thisForm.txtPassword2.value != thisForm.txtPassword.value){
		alert('La contraseña y la confirmación no coinciden.');
		thisForm.txtPassword2.focus();
		return false;
	}
	
	if(thisForm.codigo.value == ''){
		alert('Debe ingresar el código verificador.');
		thisForm.codigo.focus();
		return false;
	}
	
	return true;
}
