function regresa()
{
  // Obtiene un numero aleatorio
  var ranNum= Math.floor(Math.random()*7); 
  // Forma la cadena a llamar
  var cadena="images/header/"+ranNum+".jpg";
 
  // Crea la imagen
  var image= document.getElementById("image");
  var imagen=document.createElement('img');
  imagen.src=cadena;
  image.appendChild(imagen);
} 

function valida()
{
  var nombre=document.getElementById("nombre").value;
  if(nombre=="")
  {
    alert("Nombre es un campo obligatorio");
    return false;
  }
  
  var telefono=document.getElementById("telefono").value;
  if(telefono=="")
  {
    alert("Telefono es un campo obligatorio");
    return false;
  }
  
  var correo=document.getElementById("correo").value;
  if(correo=="")
  {
    alert("Buzon de correo electronico es un campo obligatorio");
    return false;
  }
}

 function campo()
  {
   cadena=document.getElementById("correo").value;
   //var patron=/\w\@\w\W\w/;
   var patron=/^(.+\@.+\..+)$/;
  <!-- alert(patron.test(cadena)); 
   if(patron.test(cadena)==false)
   {
   document.getElementById("correo").value="";
   alert("Correo electronico no valido");
   }
    else
  return true;
  }
 
  
  function cargar(div_contenedor, url, parametros){    
    new Ajax.Updater(div_contenedor, url, {method: "POST", parameters: parametros});
} 

 <!-- Swap images
function Permut (flag,img) {
   if (document.images) {
        if (document.images[img].permloaded) {
            if (flag==1) document.images[img].src = document.images[img].perm.src
            else document.images[img].src = document.images[img].perm.oldsrc
        }
   }
}
function preloadPermut (img,adresse) {
   if (document.images) {
        img.onload = null;
        img.perm = new Image ();
        img.perm.oldsrc = img.src;
        img.perm.src = adresse;
        img.permloaded = true;
   }
}
// -->



