// --------------check data from FORM  --------------------------
//	Para mostrar Acentos y caracteres en los ALERTS
//    *   \u00e1 -> á
//    *   \u00e9 -> é
//    *   \u00ed -> í
//    *   \u00f3 -> ó
//    *   \u00fa -> ú
//    *   \u00f1 -> ñ
function checkdataForm(theForm) {
	if (theForm.nombre.value == "") {
	  alert("Por favor escriba su nombre");
	  theForm.nombre.focus();
	  return (false);
	}	if (theForm.nombre.value.length < 5)  {
	  alert("Por favor escriba al menos 5 caracteres en el campo \"Nombre\" .");
	  theForm.nombre.focus();
	  return (false);
	}	
	if (theForm.telefono.value == "")  {
	  alert("Por favor escriba un tel\u00e9fono donde podamos contactarlo.");
	  theForm.telefono.focus();
	  return (false);
	}	if (theForm.telefono.value.length < 6)  {
	  alert("Por favor escriba al menos 6 caracteres en el campo  \"tel\u00e9fono\" .");
	  theForm.telefono.focus();
	  return (false);
	}
	if (theForm.ciudad.value == "") {
	  alert("Por favor escriba el nombre de su ciudad");
	  theForm.ciudad.focus();
	  return (false);
	}	if (theForm.ciudad.value.length < 2)  {
	  alert("Por favor escriba al menos 2 caracteres en el campo \"Ciudad\" .");
	  theForm.ciudad.focus();
	  return (false);
	}
	
	if (theForm.asunto.value == "0") {
	  alert("Por favor seleccione el asunto de su mensaje");
	  theForm.asunto.focus();
	  return (false);
	}
// El email no sera obligatorio, pero si el usuario agrega uno entonces si se VALIDA
	if (theForm.correo.value != "")  {
		//expresion regular
	    var validamail=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/
		if (!validamail.test(theForm.correo.value))  {  //si correo no es igual a validamail
		  alert("Por favor escriba un correo electr\u00f3nico v\u00e1lido.");
		  theForm.correo.focus();
		  return (false);
		}
	}	
	// terminamos de comprobar el primer bloque de información del cliente--------------------------
}
//  End -->


function checkdataFormENG(theForm) {
	if (theForm.nombre.value == "") {
	  alert("Please write your name");
	  theForm.nombre.focus();
	  return (false);
	}	if (theForm.nombre.value.length < 5)  {
	  alert("Please write at least 5 characters in \"Name\" field.");
	  theForm.nombre.focus();
	  return (false);
	}	
	if (theForm.telefono.value == "")  {
	  alert("Please write your phone number.");
	  theForm.telefono.focus();
	  return (false);
	}	if (theForm.telefono.value.length < 6)  {
	  alert("Please write at least 6 characters in \"Phone\" field.");
	  theForm.telefono.focus();
	  return (false);
	}
	if (theForm.ciudad.value == "") {
	  alert("Please write the name of your city.");
	  theForm.ciudad.focus();
	  return (false);
	}	if (theForm.ciudad.value.length < 2)  {
	  alert("Please write at least 2 characters in \"City\" field.");
	  theForm.ciudad.focus();
	  return (false);
	}
	
	if (theForm.asunto.value == "0") {
	  alert("Please select a subject.");
	  theForm.asunto.focus();
	  return (false);
	}
// El email no sera obligatorio, pero si el usuario agrega uno entonces si se VALIDA
	if (theForm.correo.value != "")  {
		//expresion regular
	    var validamail=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/
		if (!validamail.test(theForm.correo.value))  {  //si correo no es igual a validamail
		  alert("Please write a valid email address.");
		  theForm.correo.focus();
		  return (false);
		}
	}	
	// terminamos de comprobar el primer bloque de información del cliente--------------------------
}
//  End -->

//================================= GALERIAS de IMAGENES ======================================

// funcion onClic en las imagenes de GALERIAS --------------------
function niuwin(theURL,winName,features) { //v2.0
		  window.open(theURL,'showpag','width=345,height=350');
}


// activa popup de galeria ----------------------------------------
function galeria(nombre){
	var cadena="../galerias/eventos/"+nombre+"/galeria.htm";
	var gale=open(cadena,"gale","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=645,height=470,top=1,left=1");
	gale.focus();
}
function galeriaENG(nombre){
	var cadena="../galerias/eventos/"+nombre+"/galeria-ENG.htm";
	var gale=open(cadena,"gale","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=645,height=470,top=1,left=1");
	gale.focus();
}
// activa un mensaje alterno para un popup en la barra de estado
function statusInfo(info){
	window.status=info;
}
// END ================================= GALERIAS de IMAGENES ===========================

