function test1(lng) {		if (document.getElementById("nom").value.length<2) {		if (lng=='es') alert ("Nombre incorrecto.");		if (lng=='en') alert ("Invalid name.");		if (lng=='ca') alert ("Nom incorrecte.");		if (lng=='fr') alert ("Invalid name.");		return false;	}	if (document.getElementById("cognoms").value.length<2) {		if (lng=='es') alert ("Apellidos incorrectos.");		if (lng=='en') alert ("Invalid surnames.");		if (lng=='ca') alert ("Cognoms incorrectes.");		if (lng=='fr') alert ("Invalid surnames.");		return false;	}	if(document.getElementById("sexe").value == 0){		if (lng=='es') alert ("Marcar sexo.");		if (lng=='en') alert ("Mark gender.");		if (lng=='ca') alert ("Marcar sexe.");		if (lng=='fr') alert ("Mark gender.");		return false;	}		/*if(document.getElementsByName("sexe").length > 0){			var test=false;			for (var i=0; i<document.getElementsByName("sexe").length; i++) {				  if (document.getElementsByName("sexe")[i].checked) {			    test = true;			    break;			  }			}			if (!test) {				if (lng=='es') alert ("Marcar sexo.");				if (lng=='en') alert ("Mark gender.");				if (lng=='ca') alert ("Marcar sexe.");				return false;			}	}*/		if (document.getElementById("data_neix").value.length<10 || (document.getElementById("data_neix").value.substring(2,3)!='/' || document.getElementById("data_neix").value.substring(5,6)!='/') || document.getElementById("data_neix").value.substring(1,2)=="d") {		if (lng=='es') alert ("Fecha de nacimiento incorrecta.");		if (lng=='en') alert ("Invalid birthday.");		if (lng=='ca') alert ("Aniversari incorrecte.");		if (lng=='fr') alert ("Invalid birthday.");		return false;	}			if (document.getElementById("pais").value=="Seleccionar") {		if (lng=='es') alert ("Pais incorrecto.");		if (lng=='en') alert ("Invalid country.");		if (lng=='ca') alert ("Pais incorrecte.");		if (lng=='fr') alert ("Invalid country.");		return false;	}			/*if (document.getElementById("ciutat").value.length<3) {		if (lng=='es') alert ("Ciudad incorrecta.");		if (lng=='en') alert ("Invalid city.");		if (lng=='ca') alert ("Ciutat incorrecta.");		if (lng=='fr') alert ("Invalid city.");		return false;	}*/	if (document.getElementById("tel_fix").value.length<9) {		if (lng=='es') alert ("Telefono incorrecto. Introducir codigo de pais.");		if (lng=='en') alert ("Invalid phone. Write it with country code.");		if (lng=='ca') alert ("Telefon incorrecte. Introduir el codi de pais.");		if (lng=='fr') alert ("Invalid phone. Write it with country code.");		return false;	}	/*if (document.getElementById("tel_mob").value.length<9) {		if (lng=='es') alert ("Telefono movil incorrecto. Introducir codigo de pais.");		if (lng=='en') alert ("Invalid cellular phone. Write it with country code.");		if (lng=='ca') alert ("Telefon mobil incorrecte. Introduir el codi de pais.");		if (lng=='fr') alert ("Invalid cellular phone. Write it with country code.");		return false;	}*/	if( !(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i.test(document.getElementById("email").value)) ) {		if (lng=='es') alert ("Email incorrecto.");		if (lng=='en') alert ("Invalid email.");		if (lng=='ca') alert ("Email incorrecte.");		if (lng=='fr') alert ("Invalid email.");		return false;	}		/*test=false;	for (var i=0; i<document.getElementsByName("idioma_cnt").length; i++) {		  if (document.getElementsByName("idioma_cnt")[i].checked) {	    test = true;	    break;	  }	}	if (!test) {		if (lng=='es') alert ("Seleccionar idioma.");		if (lng=='en') alert ("Choose language.");		if (lng=='ca') alert ("S'ha de seleccionar un idioma.");		return false;	}*/					test=false;	for (var i=0; i<document.getElementsByName("habitacio").length; i++) {		  if (document.getElementsByName("habitacio")[i].checked) {	    test = true;	    break;	  }	}	if (!test) {		if (lng=='es') alert ("Seleccionar habitacion.");		if (lng=='en') alert ("Choose room.");		if (lng=='ca') alert ("S'ha de seleccionar una habitacio.");		if (lng=='fr') alert ("Choose room.");		return false;	}				test=true;	var inici_dia=document.getElementById("des_de").value.substring(0,2);	var inici_mes=document.getElementById("des_de").value.substring(3,5);	var inici_any=document.getElementById("des_de").value.substring(6);	var fi_dia=document.getElementById("fins_a").value.substring(0,2);	var fi_mes=document.getElementById("fins_a").value.substring(3,5);	var fi_any=document.getElementById("fins_a").value.substring(6);			data = new Date();	var dia=data.getDate();	var mes=data.getMonth()+1;	var any=data.getFullYear();	if (document.getElementById("des_de").value.length<10 || (document.getElementById("des_de").value.substring(2,3)!='/' || document.getElementById("des_de").value.substring(5,6)!='/') || document.getElementById("des_de").value.substring(1,2)=="d") {		test=false;	}	if (inici_any<=any) {		if (inici_mes<=mes) {			if (inici_dia<=dia) test=false;		}	}	if (!test) {		if (lng=='es') alert ("Fecha de entrada no valida.");		if (lng=='en') alert ("Invalid enter date.");		if (lng=='ca') alert ("Data d'entrada no valida.");		if (lng=='fr') alert ("Invalid enter date.");		return false;	}		test=true;	if (document.getElementById("fins_a").value.length<10 || (document.getElementById("fins_a").value.substring(2,3)!='/' || document.getElementById("fins_a").value.substring(5,6)!='/') || document.getElementById("fins_a").value.substring(1,2)=="d") {		test=false	}		if (fi_any<=inici_any) {		if (fi_mes<=inici_mes) {			if (fi_dia<=inici_dia) test=false;		}	}		if (!test) {		if (lng=='es') alert ("Fecha de salida no valida.");		if (lng=='en') alert ("Invalid exit date.");		if (lng=='ca') alert ("Data de sortida no valida.");		if (lng=='fr') alert ("Invalid exit date.");		return false;	}				/*test=false;	for (var i=0; i<document.getElementsByName("ocupacio").length; i++) {		  if (document.getElementsByName("ocupacio")[i].checked) {	    test = true;	    break;	  }	}	if (!test) {		if (lng=='es') alert ("Seleccionar ocupacion.");		if (lng=='en') alert ("Choose ocupation.");		if (lng=='ca') alert ("S'ha de seleccionar una ocupacio.");		return false;	}*/	if(document.getElementById("ocupacio").value == 0){		if (lng=='es') alert ("Seleccionar ocupacion.");		if (lng=='en') alert ("Choose ocupation.");		if (lng=='ca') alert ("S'ha de seleccionar una ocupacio.");		if (lng=='fr') alert ("Choose ocupation.");		return false;	}				/*test=false;	for (var i=0; i<document.getElementsByName("motiu").length; i++) {		  if (document.getElementsByName("motiu")[i].checked) {	    test = true;	    break;	  }	}	if (!test) {		if (lng=='es') alert ("Seleccionar motivo de la estancia.");		if (lng=='en') alert ("Select a reason for stay.");		if (lng=='ca') alert ("S'ha de seleccionar el motiu de l'estan�a.");		return false;	}*/	/*if(document.getElementById("motiu").value == 0){		if (lng=='es') alert ("Seleccionar motivo de la estancia.");		if (lng=='en') alert ("Select a reason for stay.");		if (lng=='ca') alert ("S'ha de seleccionar el motiu de l'estan�a.");		if (lng=='fr') alert ("Select a reason for stay.");		return false;	}		if(document.getElementById("intercanvi").value == 0){		if (lng=='es') alert ("Seleccionar programa de intercambio academico.");		if (lng=='en') alert ("Choose Student exchange program.");		if (lng=='ca') alert ("S'ha de seleccionar el programa d'intercanvi academic");		if (lng=='fr') alert ("Choose Student exchange program.");		return false;	}*/		/*test=false;	for (var i=0; i<document.getElementsByName("intercanvi").length; i++) {		  if (document.getElementsByName("intercanvi")[i].checked) {	    test = true;	    break;	  }	}	if (!test) {		if (lng=='es') alert ("Seleccionar programa de intercambio academico.");		if (lng=='en') alert ("Choose Student exchange program.");		if (lng=='ca') alert ("S'ha de seleccionar el programa d'intercanvi academic");		return false;	}*/		if (document.getElementById("uni_desti_tria").value=="Seleccionar") {		if (lng=='es') alert ("Indicar universidad/escuela/empresa de destino.");		if (lng=='en') alert ("Choose university/school/company of destination.");		if (lng=='ca') alert ("Indicar universitat/escola/empresa de desti.");		if (lng=='fr') alert ("Choose university/school/company of destination.");		return false;	}		else {			if (document.getElementById("uni_desti_tria").value=="Otro") {				if (document.getElementById("uni_desti").value.length<2) {					if (lng=='es') alert ("Indicar universidad/escuela/empresa de destino.");					if (lng=='en') alert ("Choose university/school/company of destination.");					if (lng=='ca') alert ("Indicar universitat/escola/empresa de desti.");					if (lng=='fr') alert ("Choose university/school/company of destination.");					return false;				}			}				else {					document.getElementById("uni_desti").value=document.getElementById("uni_desti_tria").value;				}		}			if (document.getElementById("medi_coneix").value=="0") {		if (lng=='es') alert ("Medio por el cual conocio Melondistrict?.");		if (lng=='en') alert ("How did you hear about Melondistrict?.");		if (lng=='ca') alert ("Mitja pel qual va coneixer Melondistrict?.");		if (lng=='fr') alert ("How did you hear about Melondistrict?.");		return false;	}	return true;}function testAtraczion1(lng) {	if (document.getElementById("nom").value.length<2) {		if (lng=='es') alert ("Nombre incorrecto.");		if (lng=='en') alert ("Invalid name.");		if (lng=='ca') alert ("Nom incorrecte.");		if (lng=='fr') alert ("Invalid name.");		return false;	}	if (document.getElementById("cognoms").value.length<2) {		if (lng=='es') alert ("Apellidos incorrectos.");		if (lng=='en') alert ("Invalid surnames.");		if (lng=='ca') alert ("Cognoms incorrectes.");		if (lng=='fr') alert ("Invalid surnames.");		return false;	}		if (document.getElementById("data_neix").value.length<10 || (document.getElementById("data_neix").value.substring(2,3)!='/' || document.getElementById("data_neix").value.substring(5,6)!='/') || document.getElementById("data_neix").value.substring(1,2)=="d") {		if (lng=='es') alert ("Fecha de nacimiento incorrecta.");		if (lng=='en') alert ("Invalid birthday.");		if (lng=='ca') alert ("Aniversari incorrecte.");		if (lng=='fr') alert ("Invalid birthday.");		return false;	}			if( !(/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(document.getElementById("email").value)) ) {		if (lng=='es') alert ("Email incorrecto.");		if (lng=='en') alert ("Invalid email.");		if (lng=='ca') alert ("Email incorrecte.");		if (lng=='fr') alert ("Invalid email.");		return false;	}		test=false;	for (var i=0; i<document.getElementsByName("habitacio").length; i++) {		  if (document.getElementsByName("habitacio")[i].checked) {	    test = true;	    break;	  }	}	if (!test) {		if (lng=='es') alert ("Seleccionar habitacion.");		if (lng=='en') alert ("Choose room.");		if (lng=='ca') alert ("S'ha de seleccionar una habitacio.");		if (lng=='fr') alert ("Choose room.");		return false;	}				test=true;	var inici_dia=document.getElementById("des_de").value.substring(0,2);	var inici_mes=document.getElementById("des_de").value.substring(3,5);	var inici_any=document.getElementById("des_de").value.substring(6);	var fi_dia=document.getElementById("fins_a").value.substring(0,2);	var fi_mes=document.getElementById("fins_a").value.substring(3,5);	var fi_any=document.getElementById("fins_a").value.substring(6);			data = new Date();	var dia=data.getDate();	var mes=data.getMonth()+1;	var any=data.getFullYear();	if (document.getElementById("des_de").value.length<10 || (document.getElementById("des_de").value.substring(2,3)!='/' || document.getElementById("des_de").value.substring(5,6)!='/') || document.getElementById("des_de").value.substring(1,2)=="d") {		test=false;	}	if (inici_any<=any) {		if (inici_mes<=mes) {			if (inici_dia<=dia) test=false;		}	}	if (!test) {		if (lng=='es') alert ("Fecha de entrada no valida.");		if (lng=='en') alert ("Invalid enter date.");		if (lng=='ca') alert ("Data d'entrada no valida.");		if (lng=='fr') alert ("Invalid enter date.");		return false;	}		test=true;	if (document.getElementById("fins_a").value.length<10 || (document.getElementById("fins_a").value.substring(2,3)!='/' || document.getElementById("fins_a").value.substring(5,6)!='/') || document.getElementById("fins_a").value.substring(1,2)=="d") {		test=false	}		if (fi_any<=inici_any) {		if (fi_mes<=inici_mes) {			if (fi_dia<=inici_dia) test=false;		}	}		if (!test) {		if (lng=='es') alert ("Fecha de salida no valida.");		if (lng=='en') alert ("Invalid exit date.");		if (lng=='ca') alert ("Data de sortida no valida.");		if (lng=='fr') alert ("Invalid exit date.");		return false;	}		return true;}function testAtraczion2(lng) {	if (document.getElementById("nom").value.length<2) {		if (lng=='es') alert ("Nombre incorrecto.");		if (lng=='en') alert ("Invalid name.");		if (lng=='ca') alert ("Nom incorrecte.");		if (lng=='fr') alert ("Invalid name.");		return false;	}	if (document.getElementById("cognoms").value.length<2) {		if (lng=='es') alert ("Apellidos incorrectos.");		if (lng=='en') alert ("Invalid surnames.");		if (lng=='ca') alert ("Cognoms incorrectes.");		if (lng=='fr') alert ("Invalid surnames.");		return false;	}		if (document.getElementById("data_neix").value.length<10 || (document.getElementById("data_neix").value.substring(2,3)!='/' || document.getElementById("data_neix").value.substring(5,6)!='/') || document.getElementById("data_neix").value.substring(1,2)=="d") {		if (lng=='es') alert ("Fecha de nacimiento incorrecta.");		if (lng=='en') alert ("Invalid birthday.");		if (lng=='ca') alert ("Aniversari incorrecte.");		if (lng=='fr') alert ("Invalid birthday.");		return false;	}			if( !(/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(document.getElementById("email").value)) ) {		if (lng=='es') alert ("Email incorrecto.");		if (lng=='en') alert ("Invalid email.");		if (lng=='ca') alert ("Email incorrecte.");		if (lng=='fr') alert ("Invalid email.");		return false;	}		test=false;	for (var i=0; i<document.getElementsByName("habitacio").length; i++) {		  if (document.getElementsByName("habitacio")[i].checked) {	    test = true;	    break;	  }	}	if (!test) {		if (lng=='es') alert ("Seleccionar habitacion.");		if (lng=='en') alert ("Choose room.");		if (lng=='ca') alert ("S'ha de seleccionar una habitacio.");		if (lng=='fr') alert ("Choose room.");		return false;	}			test=true;	var inici_dia=document.getElementById("des_de").value.substring(0,2);	var inici_mes=document.getElementById("des_de").value.substring(3,5);	var inici_any=document.getElementById("des_de").value.substring(6);	var fi_dia=document.getElementById("fins_a").value.substring(0,2);	var fi_mes=document.getElementById("fins_a").value.substring(3,5);	var fi_any=document.getElementById("fins_a").value.substring(6);					data = new Date();	var dia=data.getDate();	var mes=data.getMonth()+1;	var any=data.getFullYear();	if (document.getElementById("des_de").value.length<10 || (document.getElementById("des_de").value.substring(2,3)!='/' || document.getElementById("des_de").value.substring(5,6)!='/') || document.getElementById("des_de").value.substring(1,2)=="d") {		test=false;	}	if (inici_any<=any) {		if (inici_mes<=mes) {			if (inici_dia<=dia) test=false;		}	}	if (!test) {		if (lng=='es') alert ("Fecha de entrada no valida.");		if (lng=='en') alert ("Invalid enter date.");		if (lng=='ca') alert ("Data d'entrada no valida.");		if (lng=='fr') alert ("Invalid enter date.");		return false;	}		test=true;	if (document.getElementById("fins_a").value.length<10 || (document.getElementById("fins_a").value.substring(2,3)!='/' || document.getElementById("fins_a").value.substring(5,6)!='/') || document.getElementById("fins_a").value.substring(1,2)=="d") {		test=false	}		if (fi_any<=inici_any) {		if (fi_mes<=inici_mes) {			if (fi_dia<=inici_dia) test=false;		}	}		if (!test) {		if (lng=='es') alert ("Fecha de salida no valida.");		if (lng=='en') alert ("Invalid exit date.");		if (lng=='ca') alert ("Data de sortida no valida.");		if (lng=='fr') alert ("Invalid exit date.");		return false;	}		return true;}function activar() {	if (document.getElementById("uni_desti_tria").value=="Otro") document.getElementById("uni_desti").disabled="";		else document.getElementById("uni_desti").disabled="disabled";}function enfocar (quin){	if(quin.className == 'camp_text') quin.className = 'camp_text_focus';	if(quin.className == 'camp_text_left') quin.className = 'camp_text_focus_left';	if(quin.className == 'camp_text_left2') quin.className = 'camp_text_focus_left2';	if(quin.className == 'camp_data') quin.className = 'camp_data_focus';	if(quin.className == 'camp_data_left') quin.className = 'camp_data_focus_left';	if(quin.className == 'camp_data_left2') quin.className = 'camp_data_focus_left2';	if ((quin.value == "dd/mm/aaaa") || (quin.value == "dd/mm/yyyy"))quin.value='';}function desenfocar (quin){	if(quin.className=='camp_text_focus') quin.className = 'camp_text';	if(quin.className=='camp_text_focus_left') quin.className = 'camp_text_left';	if(quin.className=='camp_text_focus_left2') quin.className = 'camp_text_left2';	if(quin.className=='camp_data_focus') quin.className = 'camp_data';	if(quin.className=='camp_data_focus_left') quin.className = 'camp_data_left';	if(quin.className=='camp_data_focus_left2') quin.className = 'camp_data_left2';}function enfocar_elprimer(formulito, campito){	document[formulito][campito].focus();}

