
	
function actuar(peso, anchura, altura)	{
	this.peso.value = peso;
	this.ancho.value = anchura;
	this.alto.value = altura;
}

function validar(f)	{
	
	if ((document.getElementById("DNI").value == "") || (document.getElementById("Apellido1").value=="") || (document.getElementById("Nombre").value=="") || (document.getElementById("TelMovil").value=="") || (document.getElementById("Correo").value=="") || (document.getElementById("Lugar").value=="") || (document.getElementById("archivo1").value=="")) {
			if (document.getElementById("Idioma").value==2)
			{
				alert ("(*) ikurraz markatutako eremuak nahitaez bete behar dira.");
			}else{
        		alert ("Los campos marcados con (*) son obligatorios.");
			}
	        return false;
		 }
	
	enviar = /\.(jpg|jpeg)$/i.test(f.archivo1.value);
	if (!enviar)	alert("seleccione una imagen valida");
	return enviar;
}

function limpiar()	{
	
}

function datosImagen(peso, ancho, alto, error)	{
	function mostrar_error()	{
		enviar = false;					
		mensaje = "Ha habido un error (error nº " + error + "):";
		if (error % 2 == 1) // tipo incorrecto
			mensaje += "\nel fichero no es válido";
		error = parseInt(error / 2);
		if (error % 2 == 1) // excede en peso
			mensaje += "\nla imagen pesa mogollón (" + peso + ").";
		error = parseInt(error / 2);
		if (error % 2 == 1) // excede en anchura
			mensaje += "\nla imagen excede en anchura (" + ancho + ").";
		error = parseInt(error / 2);
		if (error % 2 == 1) // excede en altura
			mensaje += "\nla imagen excede en altura (" + alto + ").";
		error = parseInt(error / 2);
		alert (mensaje);
		limpiar();
	}
	if (error == 0)
		document.forms.formu.actualizar(peso, ancho, alto);
	else
		mostrar_error();
}
