/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function validar()
{
var mail = document.getElementById('mail').value.replace(" ","");
var mensaje = document.getElementById('mail').value.replace(" ","");
re=/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/

        if (mail==""){
        alert("Para el envio de esta petición es preciso rellenar los datos obligatorios");
        return;
        }
		else if (mensaje==""){
        alert("Para el envio de esta petición es preciso rellenar los datos obligatorios");
        return;
        }
		else if (!re.exec(mail)){
        alert("El E-mail introducido parece no ser correcto");
        }
		else document.myform.submit();
}

// Precarga de imágenes
if (document.images) {
  var boton1_off = new Image();
  boton1_off.src = "imagenes/boton1.gif";
  var boton1_on = new Image();
  boton1_on.src = "imagenes/boton1b.gif";
}

// Carga de imagen cuando el ratón pasa por encima
function entra(boton) {
  if (document.images) {
    if (boton == 'boton1') {
      document.images[boton].src = boton1_on.src;
    }
  }
}

// Carga de imagen cuando el ratón abandona el área de la imagen
function sale(boton) {
  if (document.images) {
    if (boton == 'boton1') {
      document.images[boton].src = boton1_off.src;
    }
  }
}

