//ABRIR VENTANA
function Win(URL,ancho,alto) {
if (ancho==null){
	ancho=350;
	alto=200;
}
if (scroll==null){
scroll=0
}
ventana=window.open(URL,"Win","toolbars=0,scrollbars="+scroll+",location=0,statusbars=0,menubars=0,resizable=0,width="+ancho+",height="+alto+",left=185,top=320");
}

//ENLACE QUE CIERRA VENTANA
function get(url) {
  opener.location = url;
  self.close()
}

//ADAPTA VENTANA A FOTO
function resizePage(){
  x=document.images['foto'].width;
  y=document.images['foto'].height;
  x=x+40;
  y=y+90; 
  window.resizeTo(x,y);
}

function FormValidator(theForm)
{

  if (theForm.Nombre.value == "")
  {
    alert("Escriba un valor para el campo \"Nombre y Apellidos\".");
    theForm.Nombre.focus();
    return (false);
  }

  if (theForm.Direccion.value == "")
  {
    alert("Escriba un valor para el campo \"Dirección\".");
    theForm.Direccion.focus();
    return (false);
  }

  if (theForm.Poblacion.value == "")
  {
    alert("Escriba un valor para el campo \"Poblacion\".");
    theForm.Poblacion.focus();
    return (false);
  }

  if (theForm.CP.value == "")
  {
    alert("Escriba un valor para el campo \"Código Postal\".");
    theForm.CP.focus();
    return (false);
  }


  if (theForm.Telefono.value == "")
  {
    alert("Escriba un valor para el campo \"Teléfono\".");
    theForm.Telefono.focus();
    return (false);
  }


  if (theForm.Email.value == "")
  {
    alert("Escriba un valor para el campo \"Email\".");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.indexOf ('@',0) == -1 || theForm.Email.value.indexOf ('.',0) == -1) {
  alert ("La dirección de Email introducida no es correcta.")
  theForm.Email.select();
  theForm.Email.focus();
  return false;
}
  return (true);
}