function clearFields()
	{
	frmBoletin.email.value = "";
	frmInvita.recomienda = "";
	frmInvita.amigo = "";
	}
// ---------------------------------------------
function validEmail(email)
	{
	if (email.length 		== 0 || 
	    email.indexOf("@") 			== -1 ||
	    email.indexOf(".") 			== -1 ||
	    email.indexOf(" ") 			!= -1 ||
	    email.indexOf("..")			!= -1 ||
	    email.indexOf(".@")			!= -1 ||
	    email.indexOf("@.")			!= -1 ||
	    email.indexOf("@@")			!= -1 ||
	    email.lastIndexOf("@")+1	== email.length ||
	    email.lastIndexOf(".")+1	== email.length ||
	    email.indexOf("@")			== 0 ||
	    email.indexOf(".")			== 0 ||
	    email.indexOf("¡")			!= -1 || 
	    email.indexOf("!")			!= -1 ||
	    email.indexOf("#")			!= -1 ||
	    email.indexOf("$")			!= -1 ||
	    email.indexOf("%")			!= -1 ||
	    email.indexOf("^")			!= -1 ||
	    email.indexOf("&")			!= -1 ||
	    email.indexOf("*")			!= -1 ||
	    email.indexOf("(")			!= -1 ||
	    email.indexOf(")")			!= -1 ||
	    email.indexOf("[")			!= -1 ||
	    email.indexOf("]")			!= -1 ||
  	    email.indexOf(",")			!= -1 ||
  	    email.indexOf(";")			!= -1 ||
  	    email.indexOf(":")			!= -1 ||
	    email.indexOf("<")			!= -1 ||
	    email.indexOf(">")			!= -1 ||
  	    email.indexOf("|")			!= -1 ||
  	    email.indexOf("^")			!= -1 ||
  	    email.indexOf("/")			!= -1 ||
  	    email.indexOf("¿")			!= -1 || 
  	    email.indexOf("?")			!= -1 ||
   	    email.indexOf("~")			!= -1 ||
   	    email.indexOf("`")			!= -1 ||
   	    email.indexOf("°")			!= -1 ||
  	    email.indexOf("á")			!= -1 ||
  	    email.indexOf("é")			!= -1 ||
  	    email.indexOf("í")			!= -1 ||
  	    email.indexOf("ó")			!= -1 ||
  	    email.indexOf("ú")			!= -1 ||
  	    email.indexOf("ä")			!= -1 ||
  	    email.indexOf("ë")			!= -1 ||
  	    email.indexOf("ï")			!= -1 ||
  	    email.indexOf("ö")			!= -1 ||
  	    email.indexOf("ü")			!= -1 ||
  	    email.indexOf("ñ")			!= -1
	   )
		{
		alert ("Escribe una dirección de correo electrónico válida.");
		document.frmBoletin.txtEmail.select();
		document.frmBoletin.txtEmail.focus();
		return false;		
		} 
	else
		{ 
		document.frmBoletin.hidUser.value 		= email.substring(0, email.indexOf("@"));
		document.frmBoletin.hidBrowser.value		= navigator.appName + " " + navigator.appVersion;

		var fullDate="";
		var fullTime="";
		var hoy = new Date();                     	//Create Date object.
		fullDate += (hoy.getMonth() + 1) + "/";      //Get month
		fullDate += hoy.getDate() + "/";             //Get day
		fullDate += hoy.getYear() + " ";             //Get year
		
		fullTime += hoy.getHours() + ":" + hoy.getMinutes();

		var WeekDays = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");

 		document.frmBoletin.hidOptInDate.value	= fullDate;
		document.frmBoletin.hidOptInYear.value 	= hoy.getYear();
		document.frmBoletin.hidOptInMonth.value	= hoy.getMonth()+1;
		document.frmBoletin.hidOptInDay.value		= hoy.getDate();
		document.frmBoletin.hidOptInTime.value	= fullTime;
		document.frmBoletin.hidOptInWeekDay.value	= WeekDays[hoy.getDay()];

//		alert(document.frmBoletin.hidUser.value);
//		alert(document.frmBoletin.txtEmail.value);
//		alert(document.frmBoletin.hidBrowser.value);
//		alert(document.frmBoletin.hidOptInDate.value);
//		alert(document.frmBoletin.hidOptInYear.value);
//		alert(document.frmBoletin.hidOptInMonth.value);
//		alert(document.frmBoletin.hidOptInDay.value);
//		alert(document.frmBoletin.hidOptInTime.value);
//		alert(document.frmBoletin.hidOptInWeekDay.value);

		return true;
		}
	}

// ---------------------------------------------
function validTaller(email)
	{
	if (email.length 		== 0 || 
	    email.indexOf("@") 			== -1 ||
	    email.indexOf(".") 			== -1 ||
	    email.indexOf(" ") 			!= -1 ||
	    email.indexOf("..")			!= -1 ||
	    email.indexOf(".@")			!= -1 ||
	    email.indexOf("@.")			!= -1 ||
	    email.indexOf("@@")			!= -1 ||
	    email.lastIndexOf("@")+1	== email.length ||
	    email.lastIndexOf(".")+1	== email.length ||
	    email.indexOf("@")			== 0 ||
	    email.indexOf(".")			== 0 ||
	    email.indexOf("¡")			!= -1 || 
	    email.indexOf("!")			!= -1 ||
	    email.indexOf("#")			!= -1 ||
	    email.indexOf("$")			!= -1 ||
	    email.indexOf("%")			!= -1 ||
	    email.indexOf("^")			!= -1 ||
	    email.indexOf("&")			!= -1 ||
	    email.indexOf("*")			!= -1 ||
	    email.indexOf("(")			!= -1 ||
	    email.indexOf(")")			!= -1 ||
	    email.indexOf("[")			!= -1 ||
	    email.indexOf("]")			!= -1 ||
  	    email.indexOf(",")			!= -1 ||
  	    email.indexOf(";")			!= -1 ||
  	    email.indexOf(":")			!= -1 ||
	    email.indexOf("<")			!= -1 ||
	    email.indexOf(">")			!= -1 ||
  	    email.indexOf("|")			!= -1 ||
  	    email.indexOf("^")			!= -1 ||
  	    email.indexOf("/")			!= -1 ||
  	    email.indexOf("¿")			!= -1 || 
  	    email.indexOf("?")			!= -1 ||
   	    email.indexOf("~")			!= -1 ||
   	    email.indexOf("`")			!= -1 ||
   	    email.indexOf("°")			!= -1 ||
  	    email.indexOf("á")			!= -1 ||
  	    email.indexOf("é")			!= -1 ||
  	    email.indexOf("í")			!= -1 ||
  	    email.indexOf("ó")			!= -1 ||
  	    email.indexOf("ú")			!= -1 ||
  	    email.indexOf("ä")			!= -1 ||
  	    email.indexOf("ë")			!= -1 ||
  	    email.indexOf("ï")			!= -1 ||
  	    email.indexOf("ö")			!= -1 ||
  	    email.indexOf("ü")			!= -1 ||
  	    email.indexOf("ñ")			!= -1
	   )
		{
		alert ("Escribe una dirección de correo electrónico válida.");
		document.frmTalleres.txtEmail.select();
		document.frmTalleres.txtEmail.focus();
		return false;		
		} 
	else
		{ 
		document.frmTalleres.hidUser.value 		= email.substring(0, email.indexOf("@"));
		document.frmTalleres.hidBrowser.value		= navigator.appName + " " + navigator.appVersion;

		var fullDate="";
		var fullTime="";
		var hoy = new Date();                     	//Create Date object.
		fullDate += (hoy.getMonth() + 1) + "/";      //Get month
		fullDate += hoy.getDate() + "/";             //Get day
		fullDate += hoy.getYear() + " ";             //Get year
		
		fullTime += hoy.getHours() + ":" + hoy.getMinutes();

		var WeekDays = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");

 		document.frmTalleres.hidOptInDate.value		= fullDate;
//		document.frmTalleres.hidOptInYear.value 	= hoy.getYear();
//		document.frmTalleres.hidOptInMonth.value	= hoy.getMonth()+1;
//		document.frmTalleres.hidOptInDay.value		= hoy.getDate();
//		document.frmTalleres.hidOptInTime.value		= fullTime;
//		document.frmTalleres.hidOptInWeekDay.value	= WeekDays[hoy.getDay()];

//		alert(document.frmTalleres.hidUser.value);
//		alert(document.frmTalleres.txtEmail.value);
//		alert(document.frmTalleres.hidBrowser.value);
//		alert(document.frmTalleres.hidOptInDate.value);
//		alert(document.frmTalleres.hidOptInYear.value);
//		alert(document.frmBoletin.hidOptInMonth.value);
//		alert(document.frmBoletin.hidOptInDay.value);
//		alert(document.frmBoletin.hidOptInTime.value);
//		alert(document.frmBoletin.hidOptInWeekDay.value);

		return true;
		}
	}

// ---------------------------------------------
function validInvita(recomienda, prospecto)
	{
	if (recomienda.length == 0)
		{
		alert ("Escribe tu nombre");
		return false;
		}
	if (prospecto.length == 0 || 
	    prospecto.indexOf("@") == -1 ||
	    prospecto.indexOf(".") == -1 ||
	    prospecto.indexOf(" ") != -1
	   )
		{
		alert ("Escribe una dirección de correo electrónico válida.");
		return false;		
		} 
	else
		{
		return true;
		}
	}
// ----------------------------------------------
function emptyField(fieldValue)
	{
	if (fieldValue=="")
		{
		return true;
		}
	else
		{
		return false;
		}
	}

// ----------------------------------------------
function validEscribenos(nombre, email, mensaje)
	{
	if (nombre.length == 0)
		{
		alert ("Escribe tu nombre");
		return false;
		}
	if (email.length == 0 || 
	    email.indexOf("@") == -1 ||
	    email.indexOf(".") == -1 ||
	    email.indexOf(" ") != -1
	   )
		{
		alert ("Escribe una dirección de correo válida");
		return false;
		}
	if (mensaje.length == 0)
		{
		alert ("Escribe un mensaje");
		return false;
		}
	else
		{
		return true;
		}
	}
// ---------------------------------------------
function validSugerenciaForo(email, tema)
	{
	if (email.length == 0 || 
	    email.indexOf("@") == -1 ||
	    email.indexOf(".") == -1 ||
	    email.indexOf(" ") != -1
	   )
		{
		alert ("Escribe una dirección de correo válida");
		return false;
		}
	if (sugerencia.tema == 0)
		{
		alert ("Escribe el tema que te interesa discutir");
		return false;
		}
	return true;
	}
// ---------------------------------------------
function submitVote(voto)
	{
	if (validVote(voto))
		{document.frmEncuesta.submit();
		}
	else
		{alert("Selecciona una opcion");
		}
	}
// ---------------------------------------------
function validVote(voto)
	{
	var i = null;
	for (i=0; i<voto.length; i++)
		{if (voto[i].checked)
			{return true;
			}
		}
	return false
	}