function validar_inscripcion()
{
	if (document.form1.nombre.value==""||document.form1.apellidos.value==""||document.form1.entidad.value==""||document.form1.cargo.value==""||document.form1.CV.value==""||document.form1.telefono.value==""||document.form1.email.value=="")
	{
		if (idioma_actual()=="es")
			alert ("Rellena todos los campos obligatorios");
		else alert ("Fill in all the mandatory fields");
		return(false);
	}

	if (!es_numerico(document.form1.telefono.value))
	{
	    if (idioma_actual()=="es")
			alert ("El teléfono no es válido");
		else alert ("The phone must be numeric");
		return(false);
	}

	if (!esMail(document.form1.email.value))
	{
	    if (idioma_actual()=="es")
			alert ("El correo electrónico no es válido");
		else alert ("The e-mail is not valid");
		return(false);
	}

	if (document.form1.userfile.value!="" && !esImagen(document.form1.userfile.value))
	{
	    if (idioma_actual()=="es")
			alert ("La imagen debe ser un archivo .jpg, .gif o .png");
		else alert ("The image format must be .jpg, .gif or .png");
		return(false);
	}

	return(true);
}

function validar_ponente()
{
	if (document.form1.nombre.value==""||document.form1.apellidos.value==""||document.form1.entidad.value==""||document.form1.cargo.value==""||document.form1.CV.value==""||document.form1.telefono.value==""||document.form1.email.value=="")
	{
		if (idioma_actual()=="es")
			alert ("Rellena todos los campos obligatorios");
		else alert ("Fill in all the mandatory fields");
		return(false);
	}

	if (document.form1.password && document.form1.password.value!="")
	{
		if (document.form1.password.value != document.form1.password2.value)
		{
			if (idioma_actual()=="es")
				alert ("La contraseña y su confirmación no coinciden");
			else alert ("Password and its confirmation must be different");
			return(false);
		}
	}

	if (!es_numerico(document.form1.telefono.value))
	{
	    if (idioma_actual()=="es")
			alert ("El teléfono no es válido");
		else alert ("The phone must be numeric");
		return(false);
	}

	if (!esMail(document.form1.email.value))
	{
	    if (idioma_actual()=="es")
			alert ("El correo electrónico no es válido");
		else alert ("The e-mail is not valid");
		return(false);
	}

	if (document.form1.userfile.value!="" && !esImagen(document.form1.userfile.value))
	{
	    if (idioma_actual()=="es")
			alert ("La imagen debe ser un archivo .jpg, .gif o .png");
		else alert ("The image format must be .jpg, .gif or .png");
		return(false);
	}

	if (document.form1.noches && (!es_numerico(document.form1.noches.value) || document.form1.noches.value==""))
	{
	    if (idioma_actual()=="es")
			alert ("Introduce el numero de noches en Malaga (Puede ser 0)");
		else alert ("Insert the number of nights in Malaga (It can be 0)");
		return(false);
	}

	return(true);
}


function validar_contacta()
{
	if (document.form1.nombre.value==""||document.form1.email.value==""||document.form1.comentario.value=="")
	{
		if (idioma_actual()=="es")
			alert ("El nombre, el correo y el comentario son obligatorios");
		else alert ("Name, e-mail and comments are mandatory fields");
		return(false);
	}

	else if (!esMail(document.form1.email.value))
	{
	    if (idioma_actual()=="es")
			alert ("El correo electrónico no es válido");
		else alert ("The e-mail is not valid");
		return(false);
	}

	return(true);
}

function cambiar_asistencia()
{
	if (document.form1.asistio.value=="1")
	{
		document.getElementById("zona_dias_asistencia").className="";
		document.getElementById("dias_asistencia").disabled=false;
	}
	else
	{
		document.getElementById("zona_dias_asistencia").className="oculto";
		document.getElementById("dias_asistencia").disabled=true;
	}

	return(true);
}

function cambiar_adaptacion()
{
	if (document.form1.necesita_adaptacion.value=="1")
	{
		document.getElementById("zona_adaptacion").className="";
		document.getElementById("tipo_adaptacion").disabled=false;
	}
	else
	{
		document.getElementById("zona_adaptacion").className="oculto";
		document.getElementById("tipo_adaptacion").disabled=true;
	}

	return(true);
}