// JavaScript Document
// verificar.js
 
/** Funciones para revisar datos de Formas 
Para llamar esta forma utilizar 
<form method="POST" onsubmit="return validardatos(this);" 
                     action="cgi-bin/procesar.pl"> 
y dentro de los tags <head> colocar 
<script  type="text/javascript" src="verificar.js"> </script> */
 
/** Revisar que los valores de los parámetros no estén vacíos */

function validardatos(formObj) {
	
	
if ( (formObj.tnombre.value) == "") { 
      alert ("Es Necesario el Nombre");
      formObj.tnombre.focus();
      return false;
      }
	
if ( (formObj.tcorreo.value) == "") { 
       alert ("Es Necesario el Correo");
      formObj.tcorreo.focus();
      return false;
 }

	


var nada;
var correo = formObj.tcorreo.value;
var filter=/^[A-Za-z][A-Za-z0-9_.]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
if ((correo.length == 0 ) || (filter.test(correo)))
   //alert ("bien"); 
 nada=0;  //variable que me sirve pa' nada
else{
       alert ("No esta correcto su Correo Electronico, por favor reviselo");
	   formObj.tcorreo.focus();
       return false;
    } 

	  
	  
if ( (formObj.tcomentario.value) == "") { 
      alert ("Es Necesario el Comentario");
      formObj.tcomentario.focus();
      return false;
      }


}

function Validar_Entero()
{
	var e_k = event.keyCode;
	if (!((e_k > 47 && e_k < 58) || e_k==8) )   //48  el 0, ***58 el 9  *** 8 espacio atras
	{
	 event.returnValue = false;
	 //alert("Debe Ingresar Solo Números");
	}
}

 
