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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

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 validemail(form) {
  var field = form.correo;
  var str = field.value;
  if (window.RegExp) {
    var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
    var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
    var reg1 = new RegExp(reg1str);
    var reg2 = new RegExp(reg2str);
    if (!reg1.test(str) && reg2.test(str)) {
      return true;
    }
    field.focus();
    field.select();
    return false;
  } else {
    if(str.indexOf("@") >= 0)
      return true;
      field.focus();
      field.select();
    return false;
  }
}
 

function comprobarContacto() {
  var f = document.formcontacto;
  
 
 
     if (f.nombre.value=='') {
   alert("Please indicate your name.");
 document.formcontacto.nombre.focus();
 return false;
  }
  
  
  if (f.correo.value=='') {
   alert("Please indicate your email address.");
 document.formcontacto.correo.focus();
 return false;
  }
   if (!validemail(f)) {
   alert("Please enter a valid email address (e.g. you@example.com).");
 document.formcontacto.correo.select();
 return false;
  }
  
    if (f.validarcorreo.value=='') {
   alert("Retype your email address.");
 document.formcontacto.validarcorreo.focus();
 return false;
  }
  
  if (f.correo.value!=f.validarcorreo.value) {
   alert("The email addresses do not match.");
 document.formcontacto.validarcorreo.select();
 return false;
  }
  

    
     if (f.correo.value=='a@a.com') {
   alert("La dirección de correo electrónico que ha escrito no tiene sentido.");
 document.formcontacto.correo.focus();
 return false;
  }

     if (f.mensaje.value=='') {
   alert("Please indicate the message to be sent.");
 document.formcontacto.mensaje.focus();
 return false;
  }
  
  if (f.mensaje.value=='' || f.mensaje.value.length < 11) {
   alert("The message must be longer than 10 characters.");
    document.formcontacto.mensaje.focus();
 return false;
  }
  
 f.action = 'contacto_post.php';
 f.submit();
 
}


<!-- ---------------------------  INSCRIPCION EVENTOS ---------------------------------- //-->

function comprobarEvento() {
  var f = document.formevento;


 
  if (f.nombre.value=='') {
   alert("Please indicate your name.");
 f.nombre.focus();
 return false;
  }
  

  
  if (f.correo.value=='') {
   alert("Please indicate your email address.");
 f.correo.focus();
 return false;
  }
   if (!validemail(f)) {
   alert("Please enter a valid email address (e.g. you@example.com).");
 f.correo.select();
 return false;
  }
  
    if (f.validarcorreo.value=='') {
   alert("Retype your email address.");
 f.validarcorreo.focus();
 return false;
  }
  
  if (f.correo.value!=f.validarcorreo.value) {
   alert("The email addresses do not match.");
 f.validarcorreo.select();
 return false;
  }
  
   if (f.telefono.value=='') {
   alert("Please write a contact phone number.");
 f.telefono.focus();
 return false;
  }
  
    if (f.movil.value=='') {
   alert("Please write you cell phone number in order to contact you as soon as possible.");
 f.movil.focus();
 return false;
  }
  
   
       if (f.direccion.value=='') {
   alert("Please indicate your postal address.");
 f.direccion.focus();
 return false;
  }
  
       if (f.ciudad.value=='') {
   alert("Please indicate your town.");
 f.ciudad.focus();
 return false;
  }
  
  
       if (f.postal.value=='') {
   alert("Please indicate your zip code.");
 f.postal.focus();
 return false;
  }
  

  
  if (f.postal.value.length != 5) {
   alert("Indicate a 5 character zip code.");
    f.postal.focus();
 return false;
  }
  

  
    if ((f.radiobutton[0].checked==false)&& (f.radiobutton[1].checked==false)){
   alert("Please indicate the desired option.");
 return false;
  }
   

         if (f.cantidad.value=='') {
   alert("Please indicate the number of persons.");
 f.cantidad.focus();
 return false;
  }
  
   
  
  
  f.action = 'inscripcion_post.php';
 f.submit();
 
}

<!-- ---------------------------  FACTURACION ---------------------------------- //-->

function comprobarFacturacion() {
  var f = document.formfacturacion;
 
  if (f.nombre.value=='') {
   alert("Please indicate your name.");
 f.nombre.focus();
 return false;
  }
  
      if (f.direccion.value=='') {
   alert("Please indicate your postal adress.");
 f.direccion.focus();
 return false;
  }
   if (f.postal.value=='') {
   alert("Please indicate your Zip code.");
 f.postal.focus();
 return false;
  }
  
   if (f.postal.value.length != 5) {
   alert("Indicate a 5 character zip code.");
    f.postal.focus();
 return false;
  }
  
 if (f.ciudad.value=='') {
   alert("Please indicate your town.");
 f.ciudad.focus();
 return false;
  }
  
   if (f.postal.value=='') {
   alert("Please indicate your Zip code.");
 f.postal.focus();
 return false;
  }
  
   if (f.postal.value.length != 5) {
   alert("Indicate a 5 character zip code.");
    f.postal.focus();
 return false;
  }
 
   if (f.provincia.options[f.provincia.selectedIndex].value==0) {
   alert("Select province.");
 return false;
  }
 
	// si tenemos provincia seleccionada y es Canarias, entonces le decimos que no se pueden enviar nada
	// las palmas y st cruz de tenerife 35 y 38
	if ((f.checkbox.checked!=true) && (f.provincia.options[f.provincia.selectedIndex].value==35)) {
		alert("We are sorry, but we make no delivery to Canary Islands. Please contact us to obtain more information.");
		return false;
	}

	if ((f.checkbox.checked!=true) && (f.provincia.options[f.provincia.selectedIndex].value==38)) {
		alert("We are sorry, but we make no delivery to Canary Islands. Please contact us to obtain more information.");
		return false;
	}
	// --------------------------------------------

   if (f.nif.value=='') {
   alert("Please indicate your CIF or NIF number.");
 f.nif.focus();
 return false;
  }
  
  
  if (f.telefono.value=='' || f.telefono.value.length < 7) {
   alert("Please write a valid contact phone number.");
 f.telefono.focus();
 return false;
  }

// comprobacion de numero de telefono
  var ubicacion
  var enter = "\n"
  var caracteres = "1234567890 " + String.fromCharCode(13);
  var contador = 0
  var campo = f.telefono.value;
  for (var i=0; i < campo.length; i++) {
    ubicacion = campo.substring(i, i + 1)
    if (caracteres.indexOf(ubicacion) != -1) {
      contador++
    } else {
      alert("the telephone number is incorrect")
      f.telefono.focus();
      return false
    }
  }

// comprobacion de numero de telefono movil
  var ubicacion
  var enter = "\n"
  var caracteres = "1234567890 " + String.fromCharCode(13);
  var contador = 0
  var campo = f.movil.value;
  for (var i=0; i < campo.length; i++) {
    ubicacion = campo.substring(i, i + 1)
    if (caracteres.indexOf(ubicacion) != -1) {
      contador++
    } else {
      alert("The cell phone number is incorrect")
      f.movil.focus();
      return false
    }
  }

	// comprobacion de datos falsos
  if (f.direccion.value=='sadfsdf' || f.direccion.value=='sadfsdaf' || f.direccion.value.length < 5) {
   alert("The adress is incorrect.");
    f.direccion.focus();
 	return false;
  }
  if (f.nombre.value=='sadfsdf' || f.nombre.value=='sadfsdaf' || f.nombre.value.length < 5) {
   alert("The name is incorrect.");
    f.nombre.focus();
 	return false;
  }
  if (f.nombre.value=='sadfsdf' || f.nombre.value=='sadfsdaf' || f.nombre.value.length < 5) {
   alert("The name is incorrect.");
    f.nombre.focus();
 	return false;
  }
  
    if ((f.movil.value=='')&&(f.checkbox.checked==false)) {
   alert("Please write you cell phone number in order to contact you as soon as possible.");
 f.movil.focus();
 return false;
  }
  
  if (f.checkbox.checked==true) {
  // tenemos datos de envio diferentes a los de facturación
    if (f.nombre2.value=='') {
   alert("Please indicate the name for shipment details.");
 f.nombre2.focus();
 return false;
  }
  
      if (f.direccion2.value=='') {
   alert("Please indicate your postal adress.");
 f.direccion2.focus();
 return false;
  }
  
       if (f.ciudad2.value=='') {
   alert("Please indicate your town.");
 f.ciudad2.focus();
 return false;
  }
  
  
       if (f.postal2.value=='') {
   alert("Please indicate your Zip code.");
 f.postal2.focus();
 return false;
  }
  
   if (f.postal2.value.length != 5) {
   alert("Indicate a 5 character zip code.");
    f.postal2.focus();
 return false;
  }

   if (f.provincia2.options[f.provincia2.selectedIndex].value==0) {
   alert("Select province.");
 return false;
  }

	// si tenemos provincia seleccionada y es Canarias, entonces le decimos que no se pueden enviar nada
	// las palmas y st cruz de tenerife 35 y 38
	if ((f.provincia2.options[f.provincia2.selectedIndex].value==35)) {
		alert("Lo sentimos, pero en estos momentos no realizamos envíos a las Islas Canarias. Consulte con nosotros si desea obtener más información.");
		return false;
	}

	if ((f.provincia2.options[f.provincia2.selectedIndex].value==38)) {
		alert("Lo sentimos, pero en estos momentos no realizamos envíos a las Islas Canarias. Consulte con nosotros si desea obtener más información.");
		return false;
	}
	// --------------------------------------------


     if (f.telefono2.value=='') {
   alert("Please write a contact phone number.");
 f.telefono2.focus();
 return false;
  }
  
    if (f.movil2.value=='') {
   alert("Please write you cell phone number in order to contact you as soon as possible.");
 f.movil2.focus();
 return false;
  }
  
  }
   
	if ((f.modopago[0].checked==false) && ((f.modopago[1].checked==false))){
		alert("Please choose a payment method.");
		return false;
	}

  f.action = 'facturacion_post.php';
 f.submit();
 
}