/****************** SCRIPTS ********************/

function Validavacios(theForm){
	
if (theForm.usuario.value==""){ 
	alert("Debe ingresar un nombre de usuario");
	theForm.usuario.focus();
	return(false);
	}
if (theForm.usuario.value.length<3){
	alert("El usuario debe tener mas de 3 letras");
	theForm.usuario.focus();
	return(false);
	}
if (theForm.clave.value==""){ 
	alert("Debe ingresar una clave");
	theForm.clave.focus();
	return(false);
	}
if (theForm.clave.value.length<3){ 
	alert("Debe la clave debe tener mas de 3 letras");
	theForm.clave.focus();
	return(false);
	}
if (theForm.clave.value!=theForm.clave2.value){ 
	alert("La clave no coincide con la verificacion");
	theForm.clave2.focus();
	return(false);
	}
if (theForm.dni.value==""){ 
	alert("Debe ingresar el numero de su DNI");
	theForm.dni.focus();
	return(false);
	}
if (!theForm.terminos.checked){
	alert("Debe aceptar los terminos y condiciones");
	theForm.terminos.focus();
	return(false);
}


if (theForm.email.value=="" || theForm.email.value==" E-mail"){
	alert("Por favor, ingrese un E-mail.");
	theForm.Email.focus();
	return(false);
	}
	var checkOK = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_-@.";
	var checkStr = theForm.email.value;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++)
	 {
	   ch = checkStr.charAt(i);
	   for (j = 0;  j < checkOK.length;  j++)
	     if (ch == checkOK.charAt(j))
	       break;
	   if (j == checkOK.length)
	   {
	     allValid = false;
	     break;
	   }
	   allNum += ch;
	 }

	 if (!allValid)
	 {
	  alert("Por favor, ingrese un E-mail válido.");
	   theForm.email.focus();
	   return (false);
	  }
		TieneArroba = false;
		for (i = 0;  i < theForm.email.value.length;  i++)
		{
			if (theForm.email.value.charAt(i) == "@")
			{
				TieneArroba = true;
			}
		}
		if (!TieneArroba)
		{
			alert("Por favor, ingrese un E-mail válido.");
			theForm.email.focus();
			return false;
		}
	if (theForm.clave.value=="" || theForm.clave.value=="******"){
		alert("Por favor, ingrese su Clave.");
		theForm.clave.focus();
		return(false);
	}
}



function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function popup(popup_url,name,width,height) {
      size = 'width=' + width + ',height=' + height;
      newwindow = window.open(popup_url,name,'resizable=no,menubar=no,location=no,toolbar=no,status=no,scrollbars=no,directories=no,'+size);
}

function popup2(popup_url,name,width,height) {
      size = 'width=' + width + ',height=' + height;
      newwindow = window.open(popup_url,name,'resizable=no,menubar=no,location=no,toolbar=no,status=no,scrollbars=yes,directories=no,'+size);
}

function goback() {
history.back()
}
