var digits = "0123456789";
var lowercaseLetters = "abcdefghijklmnopqrstuvwxyz"
var uppercaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
var whitespace = " \t\n\r";
var decimalSeparator = ',';
var thousandSeparator = '.';

// i es invalid
var iEmail = "Este e-mail es invalido (debe ser de la forma nombre@servidor.com). Por favor, escríbalo de nuevo."

// s es string

var sUrbanizacion = "Urbanizacion"
var sNombreEdificio = "Nombre del edificio"
var sNombreClub = "Nombre del club"
var sNombreResort = "Nombre del Resort"
var sTipoHotel = "Tipo de Hotel"
var sNroPisos = "Número de Pisos"
var sRamo = "Ramo"
var sNombreCementerio = "Nombre del Cementerio"
var sNombreNegocio = "Nombre del Negocio"
var sNroParcelas = "Número de Parcelas"
var sTipoParcela = "Tipo de Parcela"
var sNombreProyecto = "Nombre del Proyecto"
var sTipoSemana = "Tipo de Semana"
var sCapacidadResort = "Capacidad del Resort"
var sAniosConstruccion = "Años de Contrucción"
var sNroAmbientes = "Número de ambientes"
var sZona = "Zona"
var sMtsConstruccion = "Metros de Construccion"
var sHasTotales = "Hectáreas Totales"
var sHasAprovechables = "Hectáreas Aprovechables"
var sMtsTerreno = "Metros de Terreno"
var sHabitaciones = "Habitaciones"
var sHabitacionesHotel = "Habitaciones"
var sBanios = "Baños"
var sTipoInmuebleOtro = "Tipo de Inmueble"
var sTipoTransaccion = "Tipo de Transacción"
var sPrecio = "Precio"
var sPersonaContacto = "Persona de Contacto"
var sTelefono = "Teléfono"
var sTipoTelefono = "Tipo de Teléfono"
var sDireccionFotografiaCalle = "Dirección donde debe ir el fotógrafo (Calle o Avenida)"
var sDireccionFotografiaZona = "Dirección donde debe ir el fotógrafo (Urbanización o Zona)"
var sDireccionFotografiaDetalles = "Detalles de la dirección donde debe ir el fotógrafo"
var sNombreContratante = "Nombre del Contratante"
var sCedulaContratante = "Cédula del Contratante"

// m es missing
var mPrefix = "Usted no ha ingresado el campo "
var mSuffix = " . Este campo es requerido, por favor insertelo"

var defaultEmptyOK = false




// Notify user that required field theField is empty.
// String s describes expected contents of theField.value.
// Put focus in theField and return false.

function warnEmpty (theField, s)
{   //theField.focus()
    alert(mPrefix + s + mSuffix)
    return false
}


function warnInvalid (theField, s)
{   theField.focus()
    theField.select()
    alert(s)
    return false
}

// Check whether string s is empty.

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

// Returns true if string s is empty or 
// whitespace characters only.

function isWhitespace (s)

{   var i;

    // Is s empty?
    if (isEmpty(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);

        if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}

// isEmail (STRING s [, BOOLEAN emptyOK])
// 
// Email address must be of form a@b.c -- in other words:
// * there must be at least one character before the @
// * there must be at least one character before and after the .
// * the characters @ and . are both required
//
// For explanation of optional argument emptyOK,
// see comments of function isInteger.

function isEmail (s)
{   if (isEmpty(s)) 
       if (isEmail.arguments.length == 1) return defaultEmptyOK;
       else return (isEmail.arguments[1] == true);
   
    // is s whitespace?
    if (isWhitespace(s)) return false;
    
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}



// checkEmail (TEXTFIELD theField [, BOOLEAN emptyOK==false])
//
// Check that string theField.value is a valid Email.
//
// For explanation of optional argument emptyOK,
// see comments of function isInteger.

function checkEmail (theField, emptyOK)
{   if (checkEmail.arguments.length == 1) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    else if (!isEmail(theField.value, false)) 
       return warnInvalid (theField, iEmail);
    else return true;
}


/* FUNCTIONS TO INTERACTIVELY CHECK VARIOUS FIELDS. */

// checkString (TEXTFIELD theField, STRING s, [, BOOLEAN emptyOK==false])
//
// Check that string theField.value is not all whitespace.
//
// For explanation of optional argument emptyOK,
// see comments of function isInteger.

function checkString (theField, s, emptyOK)
{   // Next line is needed on NN3 to avoid "undefined is not a number" error
    // in equality comparison below.
    if (checkString.arguments.length == 2) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    if (isWhitespace(theField.value)) 
       return warnEmpty (theField, s);
    else return true;
}

function checkSelected (theField, s, emptyOK)
{   // Next line is needed on NN3 to avoid "undefined is not a number" error
    // in equality comparison below.
    if (checkSelected.arguments.length == 2) emptyOK = defaultEmptyOK;    
    if (theField.options[theField.selectedIndex].text=="seleccione") 
       return warnEmpty (theField, s);
    else return true;
}


function validateNumber (fieldText, errMsg, required)
{
  var index;
  var numbers    = '0123456789';
  var decimalPosition;
  var numberPart  = '';
  var decimalPart = '';
  var newText     = '';
  var errMsg = 'La cifra introducida es incorrecta';

  if (fieldText.value.length == 0)
  {
    if (required)
    {
      fieldText.focus ();
      fieldText.select ();
      alert (errMsg);

      return (false);
    } else
      return (true);
  }

  decimalPosition = fieldText.value.indexOf (decimalSeparator);
  if (decimalPosition != -1)
  {
    tempText    = fieldText.value.substring (0, decimalPosition);
    decimalPart = fieldText.value.substring (decimalPosition + 1, fieldText.value.length);

    if (decimalPart.length > 0)
    {
      if (isNaN (decimalPart)) 
      {
        fieldText.focus ();
        fieldText.select ();
        alert (errMsg);  

        return (false);
      }

      decimalPart = decimalSeparator + decimalPart;
    }
  } else
    tempText    = fieldText.value;

  for (index = 0; index < tempText.length; index++)
    if (numbers.indexOf (tempText.charAt (index)) != -1)
      numberPart = numberPart + tempText.charAt (index);
    else
      if (tempText.charAt (index) != thousandSeparator)
      {
        fieldText.focus ();
        fieldText.select ();
        alert (errMsg);

        return (false);
      }

  if (numberPart.length == 0) numberPart = '0';

  while (numberPart.length > 3) 
  {
    newText    = thousandSeparator + numberPart.substring (numberPart.length - 3, numberPart.length) + newText;
    numberPart = numberPart.substring (0, numberPart.length - 3);
  }

  newText = numberPart + newText + decimalPart;

  fieldText.value = newText;

  return (true);
}

function validateTelephoneCopy (fieldText, errMsg, required, fieldCopy)
{
  validateTelephone(fieldText, errMsg, required);
  fieldCopy.value = fieldText.value; 
  return (true);
}




function validateName (fieldText, errMsg, required)
{
  var index;
  var alphabet  = 'aáàäãåbcçdeéèëêfghiíìïîjklmnñoóòöõôpqrstuúùüûvwxyýz.0123456789';
  var newText   = '';
  var upperFlag = true;
  var errMsg = 'El nombre introducido es incorrecto';

  if (fieldText.value.length == 0)
  {
    if (required)
    {
      fieldText.focus ();
      fieldText.select ();

      alert (errMsg);
      return (false);
    } else
      return (true);
  }

  for (index = 0; index < fieldText.value.length; index++)
    if (alphabet.indexOf (fieldText.value.charAt (index).toLowerCase ()) != -1)
    {
      if (upperFlag)
      {
        newText  += fieldText.value.charAt (index).toUpperCase ();
        upperFlag = false;
      } else
        newText  += fieldText.value.charAt (index).toLowerCase ();
    } else
      if (fieldText.value.charAt (index) == ' ')
      {
        newText  += ' ';
        upperFlag = true;       
      } else 
      {
        fieldText.focus ();
        fieldText.select ();

        alert (errMsg);
        return (false);
      }

  fieldText.value = newText;
  document.forms[0].Nombre_Contratante.value = newText;

  return (true);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}


function validateTelephone (fieldText, errMsg, required)
{
  var index;
  var numbers    = '0123456789';
  var separators = '().- '
  var tempText   = new String ();
  var newText    = new String ();

  if (fieldText.value.length == 0)
  {
    if (required)
    {
      fieldText.focus ();
      fieldText.select ();
      alert (errMsg);

      return (false);
    } else
      return (true);
  }

  for (index = 0; index < fieldText.value.length; index++)
    if (numbers.indexOf (fieldText.value.charAt (index)) != -1)
      tempText = tempText + fieldText.value.charAt (index);
    else
      if (separators.indexOf (fieldText.value.charAt (index)) == -1)
      {
        fieldText.focus ();
        fieldText.select ();
        alert (errMsg);

        return (false);
      }
       
  if (tempText.charAt (0) == '0')
  {
      if ((tempText.charAt (1) != '2' && tempText.charAt (1) != '4') || tempText.length != 11){
	fieldText.focus ();
        fieldText.select ();
        alert (errMsg);

        return (false);
      }
	
      if ((tempText.length == 10) || (tempText.length == 11))
      {
        newText = tempText.substring (0, 4) + '-';
        tempText = tempText.substring (4);
      }
    
  }

  if (tempText.length == 7)
    newText = newText + tempText.substring (0, 3) + '.' + tempText.substring (3, 7);
  else
    if ((tempText.length == 8) || (tempText.length == 9))
      newText = newText + tempText.substring (0, 3) + '.' + tempText.substring (3);
    else
    {
      fieldText.focus ();
      fieldText.select ();
      alert (errMsg);

      return (false);
    }

  fieldText.value = newText;

  return (true);
}


function validateEmail (fieldText, errMsg, required)
{
  var index;
  var newText;

  if (fieldText.value.length == 0)
  {
    if (required)
    {
      fieldText.focus ();
      fieldText.select ();
      alert (errMsg);

      return (false);
    } else
      return (true);
  }

  if (fieldText.value.indexOf ("@") < 3)
  {
    fieldText.focus ();
    fieldText.select ();
    alert (errMsg);

    return (false);
  }

  if ((fieldText.value.indexOf (".com") < 5) && 
      (fieldText.value.indexOf (".org") < 5) &&
      (fieldText.value.indexOf (".gov") < 5) &&
      (fieldText.value.indexOf (".net") < 5) &&
      (fieldText.value.indexOf (".mil") < 5))
  {
    fieldText.focus ();
    fieldText.select ();
    alert (errMsg);

    return (false);   
  }

  return (true);
}



function validateInfoApartamento(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Nombre_Inmueble"],sNombreEdificio) &&
      checkString(form.elements["Anios_Construccion"],sAniosConstruccion) &&
      checkString(form.elements["Mts_Construccion"],sMtsConstruccion) &&
      checkSelected(form.elements["Habitaciones"],sHabitaciones) &&
      checkSelected(form.elements["Banios"],sBanios) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}

function validateInfoHabitacion(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Mts_Construccion"],sMtsConstruccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}


function validateInfoAccion(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Nombre_Inmueble"],sNombreClub) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}


function validateInfoCasa(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Anios_Construccion"],sAniosConstruccion) &&
      checkString(form.elements["Mts_terreno"],sMtsTerreno) &&
      checkString(form.elements["Mts_Construccion"],sMtsConstruccion) &&
      checkSelected(form.elements["Habitaciones"],sHabitaciones) &&
      checkSelected(form.elements["Banios"],sBanios) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}

function validateInfoEdificio(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Anios_Construccion"],sAniosConstruccion) &&
      checkString(form.elements["Nombre_Inmueble"],sNombreEdificio) &&
      checkSelected(form.elements["Nro_Pisos"],sNroPisos) &&
      checkString(form.elements["Mts_Construccion"],sMtsConstruccion) &&
      checkString(form.elements["Mts_terreno"],sMtsTerreno) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}



function validateInfoGalpon(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Anios_Construccion"],sAniosConstruccion) &&
      checkString(form.elements["Mts_Construccion"],sMtsConstruccion) &&
      checkSelected(form.elements["Banios"],sBanios) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}




function validateInfoHacienda(form)
{   return (
      checkString(form.elements["Nombre_Inmueble"],sNombreEdificio) &&
      checkString(form.elements["Hectareas_Totales"],sHasTotales) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}



function validateInfoHotel(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Nombre_Inmueble"],sNombreEdificio) &&
      checkString(form.elements["Anios_Construccion"],sAniosConstruccion) &&
      checkSelected(form.elements["Tipo_Hotel"],sTipoHotel) &&
      checkString(form.elements["Mts_Construccion"],sMtsConstruccion) &&
      checkSelected(form.elements["Habitaciones_Hotel"],sHabitacionesHotel) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}



function validateInfoLocal(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Anios_Construccion"],sAniosConstruccion) &&
      checkSelected(form.elements["Nro_Ambientes"],sNroAmbientes) &&
      checkString(form.elements["Mts_Construccion"],sMtsConstruccion) &&
      checkSelected(form.elements["Banios"],sBanios) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}

function validateInfoNegocio(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Nombre_Inmueble"],sNombreNegocio) &&
      checkString(form.elements["Anios_Construccion"],sAniosConstruccion) &&
      checkString(form.elements["Mts_Construccion"],sMtsConstruccion) &&
      checkString(form.elements["Ramo"],sRamo) &&
      checkSelected(form.elements["Banios"],sBanios) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}



function validateInfoOficina(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Nombre_Inmueble"],sNombreEdificio) &&
      checkString(form.elements["Anios_Construccion"],sAniosConstruccion) &&
      checkSelected(form.elements["Nro_Ambientes"],sNroAmbientes) &&
      checkString(form.elements["Mts_Construccion"],sMtsConstruccion) &&
      checkSelected(form.elements["Banios"],sBanios) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}



function validateInfoCementerio(form)
{   return (
      checkString(form.elements["Nombre_Inmueble"],sNombreCementerio) &&
      checkSelected(form.elements["Nro_Parcelas"],sNroParcelas) &&
      checkSelected(form.elements["Tipo_Parcela"],sTipoParcela) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}


function validateInfoProyecto(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Nombre_Inmueble"],sNombreProyecto) &&
      checkString(form.elements["Mts_Construccion"],sMtsConstruccion) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}


function validateInfoResort(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Nombre_Inmueble"],sNombreResort) &&
      checkString(form.elements["TipoSemana"],sTipoSemana) &&
      checkString(form.elements["CapacidadResort"],sCapacidadResort) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}

function validateInfoTerreno(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Mts_terreno"],sMtsTerreno) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}


function validateInfoOtro(form)
{   return (
      checkString(form.elements["Urbanizacion"],sUrbanizacion) &&
      checkString(form.elements["Tipo_Inmueble_Otro"],sTipoInmuebleOtro) &&
      checkSelected(form.elements["Tipo_Transaccion"],sTipoTransaccion) &&
      checkString(form.elements["Precio"],sPrecio) &&    
      checkString(form.elements["Nombre_contacto"],sPersonaContacto) &&
      checkSelected(form.elements["Telefono11"],sTipoTelefono) &&
      checkString(form.elements["Telefono12"],sTelefono) &&
      checkString(form.elements["Nombre_Contratante"],sNombreContratante) &&
      checkString(form.elements["Cedula_Identidad"],sCedulaContratante) &&
      checkString(form.elements["Direccion_Fotografo_Calle"],sDireccionFotografiaCalle) &&
      checkString(form.elements["Direccion_Fotografo_Zona"],sDireccionFotografiaZona) &&
      checkString(form.elements["Detalles_Direccion"],sDireccionFotografiaDetalles)
    )
}
