﻿// Archivo JScript
        
function IsNumeric(sText)

 {
    var ValidChars = "0123456789.";
    var IsNumber=true;
    var Char;

      for (i = 0; i < sText.length && IsNumber == true; i++)
      {
       Char = sText.charAt(i);
       if (ValidChars.indexOf(Char) == -1)
          {
          IsNumber = false;
          }
      }
    return IsNumber;
    } 

function validar() {
    var txt = document.getElementById('ctl00_content_txtnombre')
    if (txt != null) {
         if (txt.value == '') {
            alert('    Rellene el campo Nombre, por favor.');
            return false;
            }         
          } 
   
   var txt = document.getElementById('ctl00_content_txtmail')
    if (txt != null) {
         if (txt.value == '') {
            alert('      Rellene el campo e-mail, por favor.');
            return false;
            }         
          }
   
   var txt = document.getElementById('ctl00_content_txtbody')
    if (txt != null) {
         if (txt.value == '') {
            alert('      Rellene el cuerpo del mensaje, por favor.');
            return false;
            }         
          }
   }  
   
function validarCat() {
    var txt = document.getElementById('ctl00_content_txtnombre')
    if (txt != null) {
         if (txt.value == '') {
            alert('    Rellene el campo Nombre, por favor.');
            return false;
            }         
          } 
   
   var txt = document.getElementById('ctl00_content_txtemail')
    if (txt != null) {
         if (txt.value == '') {
            alert('      Rellene el campo e-mail, por favor.');
            return false;
            }         
          }
   
   var txt = document.getElementById('ctl00_content_txtapellidos')
    if (txt != null) {
         if (txt.value == '') {
            alert('      Rellene el campo Apellidos, por favor.');
            return false;
            }         
          }
  /* var txt = document.getElementById('ctl00_content_txtdireccion')
    if (txt != null) {
         if (txt.value == '') {
            alert('      Denos su dirección postal, por favor.');
            return false;
            }         
          }       
   var txt = document.getElementById('ctl00_content_txtcp')
    if (txt != null) {
         if (txt.value == '') {
            alert('      Facilitenos su código postal, por favor.');
            return false;
            }         
          }
   var txt = document.getElementById('ctl00_content_txtciudad')
    if (txt != null) {
         if (txt.value == '') {
            alert('      Diganos la ciudad en la que reside, por favor.');
            return false;
            }         
          }*/
   }  

 function validarPres() {
    var txt = document.getElementById('ctl00_content_txtnombre')
    if (txt != null) {
         if (txt.value == '') {
            alert('    Rellene el campo Nombre, por favor.');
            return false;
            }         
          } 
   
   var txt = document.getElementById('ctl00_content_txtapellidos')
    if (txt != null) {
         if (txt.value == '') {
            alert('      Rellene el campo apellidos, por favor.');
            return false;
            }         
          }
   
   var txt = document.getElementById('ctl00_content_txtemail')
    if (txt != null) {
         if (txt.value == '') {
            alert('      Denos una dirección de correo electrónico, por favor.');
            return false;
            }         
          }
   var txt = document.getElementById('ctl00_content_txtedad')
    if (txt != null) {
         if (txt.value == '') {
            alert('   Facilitenos su edad para poder ofrecer un presupuesto mas exacto, por favor.');
            return false;
            }         
          }
   }
 