//this does it for three
function sortNum(a,b) { return b-a}
function fixH2(one,two,three) {
if (document.getElementById(one)) {
var obj=new Array(3);
var option=[one,two,three];
for(var i=0; i<option.length; i++) {
document.getElementById(option[i]).style.height="auto";
obj[i]=document.getElementById(option[i]).offsetHeight;
nh=obj.sort(sortNum);
}
nh1=nh.splice(1,2);
for(var i=0; i<option.length; i++) {
document.getElementById(option[i]).style.height=nh+"px";
}
}
}
//

window.onload=function(){
fixH2('izq','drc','medio');
fixH2('min_iz','min_centro','min_dr');
}

function Validar2(form){

if (alta_empre.empresa.value == "")
{ alert("Indiquemos en nombre de su empresa. Gracias"); alta_empre.empresa.focus(); return false }

if (alta_empre.nombre.value == "")
{ alert("Inserte el nombre de la persona de contacto, por favor."); alta_empre.nombre.focus(); return false }

if (alta_empre.tlf.value == "")
{ alert("Indiquenos su teléfono de contacto."); alta_empre.tlf.focus(); return false }

if (alta_empre.oferta.value == "")
{ alert("Diganos que tipo de profesional está buscando"); alta_empre.oferta.focus(); return false }

}



function Validar(form){

if (alta_curr.nombre.value == "")
{ alert("Por favor ingrese su nombre y apellidos"); alta_curr.nombre.focus(); return false }

if (alta_curr.email.value.indexOf('@', 0) == -1 || alta_curr.email.value.indexOf('.', 0) == -1)
{ alert("Dirección de e-mail inválida"); document.alta_curr.email.focus(); return false }

if (alta_curr.anio.value == "")
{ alert("Seleccione su año de nacimiento por favor"); alta_curr.anio.focus(); return false }

if (alta_curr.provincia.value == "")
{ alert("Seleccione la provincia en la que desea trabajar"); alta_curr.provincia.focus(); return false }

if (alta_curr.categoria.value == "")
{ alert("Seleccione su categoría profesional"); alta_curr.categoria.focus(); return false }

if (alta_curr.subcategoria)
{ if (alta_curr.subcategoria.value == "")
{ alert("Debe seleccionar el área concreta de su perfil laboral"); alta_curr.subcategoria.focus(); return false } }

if (alta_curr.clave.value == "")
{ alert("Introduce una o varias palabras clave.  Puedes utilizar el título exacto de tu profesión"); alta_curr.clave.focus(); return false }

if (alta_curr.doc.value =="")
{ alert("Debe seleccionar un fichero word."); alta_curr.doc.focus(); return false }


if(alta_curr.doc.value!="")
    {
    fail=alta_curr.doc.value.substring(alta_curr.doc.value.length-4)
    if((fail!=".doc") && (fail!="docx") && (fail!=".pdf")) 
       
        {
        alert("Sólo puedes introducir archivos Word y PDF")
        alta_curr.doc.focus()
        return false
        }
		
	cortes=alta_curr.doc.value.split(".")
	if(cortes.length>2) {
		alert("El nombre del arhivo no puede contener puntos")
        alta_curr.doc.focus()
        return false
	}
    } 

if (alta_curr.privacidad.checked) { return true; } else 
{ alert("Debe aceptar nuestra política de privacidad para enviarnos su currículum."); alta_curr.privacidad.focus(); return false }




}

