function Validar()
	{
		aux = true;
		if(form_reserva_index.nombre.value == "")
		{
			alert("Por favor, introduzca su nombre");
			return aux=false;
		}
		if(form_reserva_index.apellido.value == "")
		{
			alert("Por favor, introduzca su apellido");
			return aux=false;
		}
		if(form_reserva_index.email.value == "")
		{
			alert("Introduce tu correo electronico");
			return aux=false;		
		}
		if(form_reserva_index.telefono.value == "")
		{
			alert("Introduce tu numero telefono");
			return aux=false;		
		}
		if(aux) return aux;
	}
	function emailCheck (emailStr) {
	/* Verificar si el email tiene el formato user@dominio. */
	var emailPat=/^(.+)@(.+)$/ 

	/* Verificar la existencia de caracteres. ( ) < > @ , ; : \ " . [ ] */
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]" 

	/* Verifica los caracteres que son válidos en una dirección de email */
	var validChars="\[^\\s" + specialChars + "\]" 

	var quotedUser="(\"[^\"]*\")" 

	/* Verifica si la dirección de email está representada con una dirección IP Válida */ 


	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/


	/* Verificar caracteres inválidos */ 

	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	/*domain, as opposed to ipDomainPat, shown above. */
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")


	var matchArray=emailStr.match(emailPat)
		if (matchArray==null) {
			alert("Dirección de correo electrónico parece ser incorrecto (verificar @ y .'s)")
			return false
		}
	var user=matchArray[1]
	var domain=matchArray[2]

	// Si el user "user" es valido 
		if (user.match(userPat)==null) {
			// Si no
			alert("no es correcto.")
			return false;
		}

	/* Si la dirección IP es válida */
	var IPArray=domain.match(ipDomainPat)
		if (IPArray!=null) {
			for (var i=1;i<=4;i++) {
				if (IPArray[i]>255) {
					alert("Destination IP Is Not Valid.")
					return false
				}
			}	
			return true
		}

	var domainArray=domain.match(domainPat)
		if (domainArray==null) {
			alert("The Domain Is Not Valid.")
			return false
		}

	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
		if (domArr[domArr.length-1].length<2 || 
			domArr[domArr.length-1].length>3) { 

			alert("La extensión debe tiene 3 caracteres, si lo es .com o 2 si es cualquier país.")
			return false
		}
	
		if (len<2) {
			var errStr="la dirección no es correcta."
			alert(errStr)
			return false
		}

	// La dirección de email ingresada es Válida
	return true;
	}

/*************************************************************************\
  ArrayObject makeArray(int size)
  return the array object in the size specified.
\*************************************************************************/
function makeArray(size) {
  this.size = size;
  return this;
}

/*************************************************************************\
   ct setLen(len)
   return the ct object.
\*************************************************************************/
function setLen(len) {
  // Create the len array.
  if (len.length == 0 || len == null)
    len = "13,14,15,16,19";

  var tmplen = len;
  n = 1;
  while (tmplen.indexOf(",") != -1) {
    tmplen = tmplen.substring(tmplen.indexOf(",") + 1, tmplen.length);
    n++;
  }
  this.len = new makeArray(n);
  n = 0;
  while (len.indexOf(",") != -1) {
    var tmpstr = len.substring(0, len.indexOf(","));
    this.len[n] = tmpstr;
    len = len.substring(len.indexOf(",") + 1, len.length);
    n++;
  }
  this.len[n] = len;

  return this;
}

/*************************************************************************\
   ct setRules()
   return the ct object.
\*************************************************************************/
function setRules(rules) {
  // Create the rules array.
  if (rules.length == 0 || rules == null)
    rules = "0,1,2,3,4,5,6,7,8,9";
  
  var tmprules = rules;
  n = 1;
  while (tmprules.indexOf(",") != -1) {
    tmprules = tmprules.substring(tmprules.indexOf(",") + 1, tmprules.length);
    n++;
  }
  this.rules = new makeArray(n);
  n = 0;
  while (rules.indexOf(",") != -1) {
    var tmpstr = rules.substring(0, rules.indexOf(","));
    this.rules[n] = tmpstr;
    rules = rules.substring(rules.indexOf(",") + 1, rules.length);
    n++;
  }
  this.rules[n] = rules;

  return this;
}