// JavaScript Document
function vinculo() {
	var indice = document.vincular.sel_vinculo.selectedIndex
	var valor = document.vincular.sel_vinculo.options[indice].value
	if (valor != 0) {
		location.href=valor;
	}
}

function valida_envia() {
	if (document.registro.nombre.value.length < 3) {
		alert("Ingrese un nombre valido");
		document.registro.nombre.value = '';
		document.registro.nombre.focus();
		return;
	}
	if (document.registro.apellido.value.length < 3) {
		alert("Ingrese un apellido valido");
		document.registro.apellido.value = '';
		document.registro.apellido.focus();
		return;		
	}
	if (document.registro.telefono.value.length < 6) {
		alert("Ingrese un teléfono valido");
		document.registro.telefono.value = '';
		document.registro.telefono.focus();
		return;		
	}
	if (document.registro.celular.value.length < 6) {
		alert("Ingrese un celular valido");
		document.registro.celular.value = '';
		document.registro.celular.focus();
		return;		
	}
	if (document.registro.direccion.value.length < 6) {
		alert("Ingrese una dirección valida");
		document.registro.direccion.value = '';
		document.registro.direccion.focus();
		return;		
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.registro.email.value)))  {	
		alert("Ingrese un email valido");
		document.registro.email.value = '';
		document.registro.email.focus();
		return;		
	}
	if (document.registro.usuario.value.length < 6) {
		alert("Ingrese un usuario valido");
		document.registro.usuario.value = '';
		document.registro.usuario.focus();
		return;		
	}
	if (document.registro.contrasena1.value != document.registro.contrasena2.value) {
		alert("La cofirmacion de constraseña no coincide \n Favor ingrese nuevamente");
		document.registro.contrasena1.value = '';
		document.registro.contrasena2.value = '';
		document.registro.contrasena1.value.focus();
		return;		
	} else {
		if (document.registro.contrasena1.value.length < 6) {
			alert("Ingrese una contraseña de 6 caracteres como minimo");
			document.registro.contrasena1.value = '';
			document.registro.contrasena2.value = '';
			document.registro.contrasena1.value.focus();
			return;			
		}
	}
	document.registro.submit();
}