
	/*isInteger(string) 
	Retorna verdadero si y solo sí el contenido de string 
	representa un número entero,sin signo */

	// c es un digito
	function isDigit (c)
	{   return ((c >= "0") && (c <= "9"))
	}

	// s es vacio
	function isEmpty(s)
	{   return ((s == null) || (s.length == 0))
	}


	// s es un numero entero (sin signos)
	function isInteger (s)
	{   //var i;
		if (isEmpty(s)) 
		   if (isInteger.arguments.length == 1) return defaultEmptyOK;
		   else return (isInteger.arguments[1] == true);
		
		for (i = 0; i < s.length; i++)
		{   
			/*var*/ c = s.charAt(i);
			if( i != 0 ) {
				if (!isDigit(c)) return false;
			} else { 
				if (!isDigit(c)) return false;// && (c == "-") || (c == "+")
			}
		}
		return true;
	}


	function checkDV(rut,drut)
	{
	  var dvr = '0'
	  suma = 0
	  mul  = 2
			
	  for (i= rut.length -1 ; i >= 0; i--)
		{
		  suma = suma + rut.charAt(i) * mul
			if (mul == 7)
			  mul = 2
			else    
			  mul++
		}

	  res = suma % 11
	  if (res==1)
		dvr = 'k'
	  else if (res==0)
		dvr = '0'
	  else
		{
		  dvi = 11-res
		  dvr = dvi + ""
		}

	  if ( dvr != drut.toLowerCase() )
		{ return false; }
	  else
		{ return true }
	}



	function vacio(s)
	{	for (n=0;n<=s.length-1;n++)
			if (s.charAt(n)!=" ")
				return(0);
		return(1);
	}

	function ingreso()
	{

		if(vacio(window.document.contacto.nombre.value))
		{
			alert('Por favor, Ingrese su nombre.');
			window.document.contacto.nombre.focus();
			window.document.contacto.nombre.select();
			return false;
		}

		if(vacio(window.document.contacto.apellido.value))
		{
			alert('Por favor, Ingrese su apellido.');
			window.document.contacto.apellido.focus();
			window.document.contacto.apellido.select();
			return false;
		}

		if (vacio(window.document.contacto.fono.value))
		{
			alert('Por favor, Ingrese su teléfono.');
			window.document.contacto.fono.focus();
			window.document.contacto.fono.select();
			return false;
		}

		if(vacio(window.document.contacto.email.value))
		{
			alert('Por favor, Ingrese su correo electrónico.');
			window.document.contacto.email.focus();
			window.document.contacto.email.select();
			return false;
		}

		if(window.document.contacto.email.value.indexOf('@') == -1)
		{
		   alert("¡El e-Mail no es valido!");
		   window.document.contacto.email.focus();
		   return (false);
		}
		
		if (vacio(window.document.contacto.preguntas.value))
		{
			alert('Por favor, Ingrese sus comentarios.');
			window.document.contacto.preguntas.focus();
			window.document.contacto.preguntas.select();
			return false;
		}
	
	}