<!--
	// ===============================================================================================
	// Instituto Francés de Valencia                               Copyright 2006 Integra Digital S.L.
	// http://www.integradigital.com                                           info@integradigital.com
	// ===============================================================================================
	
	var DEF_MENUS = 6;
	function fBack(){
		history.back();
	}
		function fOpenLegal(){
		window.open('/legal_v1.html','ifv_legal','width=400,height=300,directories=0,location=0,menubar=0,resizable=0,status=0,toolbar=0,titlebar=0,scrollbars=1');
	}
	
	function fOpenPrivacy(){
		window.open('/privacy.html','ifv_legal','width=400,height=300,directories=0,location=0,menubar=0,resizable=0,status=0,toolbar=0,titlebar=0,scrollbars=1');
	}
	function fOpenQuality(sLang){
		window.open('quality.asp?sLang=' + sLang,'quality','width=400,height=300,directories=0,location=0,menubar=0,resizable=0,status=0,toolbar=0,titlebar=0,scrollbars=0');
	}
	function fRedirect(sURL){ document.location.replace(sURL); }
	function fOpenMenu(sLeftMenuID,sMenuID){
		for (iCont = 0; iCont <= DEF_MENUS; iCont++){
			var sClass, iNext;
			if (document.getElementById('menu' + sLeftMenuID + '0' + iCont.toString())){ document.getElementById('menu' + sLeftMenuID + '0' + iCont.toString()).className = sClass; }
			if (document.getElementById('submenu' + sLeftMenuID + '0' + iCont.toString())){ document.getElementById('submenu' + sLeftMenuID + '0' + iCont.toString()).className = 'menu_off'; }
		}
		document.getElementById('lnk' + sMenuID).blur();
		document.getElementById('submenu' + sMenuID).className = 'menu_on';
		if (parseInt(sMenuID, 10) < DEF_MENUS){
			iNext = parseInt(sMenuID, 10) + 1;
			while (!document.getElementById('menu0' + iNext.toString()) && iNext < DEF_MENUS){ iNext++; }
		}
	}
	function fContactNote(sLang){
		switch (sLang){
			case 'fr':
				var asMsg = new Array ('Veuillez saisir votre code d’accès\n(les 6 derniers chiffres de votre Nº d’inscription)','Por favor, introduzca su contraseña');
				break; 
			case 'es':
			 	var asMsg = new Array ('Por favor, debe introducir su nombre usuario \n(las últimas 6 cifras de su Nº de inscripción)','Por favor, introduzca su contraseña');
				break;
		}
		var bOk = true;
		if (bOk){ if (document.getElementById('log').value == ''){ bOk = false; document.getElementById('log').focus(); alert (asMsg[0]); } }
		if (bOk){ if (document.getElementById('pas').value == ''){ bOk = false; document.getElementById('pas').focus(); alert (asMsg[1]); } }
		if (bOk){document.getElementById('frm_note').submit(); }
	}
	function fContactCult(sLang){
		switch (sLang){
			case 'fr':
				var asMsg = new Array ('Veuillez saisir votre prénom','Veuillez saisir vos noms','Veuillez saisir votre courriel');
				break; 
			case 'es':
			 	var asMsg = new Array ('Por favor, debe introducir su nombre','Por favor, debe introducir sus apellidos','Por favor, introduzca una dirección de correo electrónico válida');
				break;
		}
		var rMailCheck = /^[\w\.-]+@[\w\.-]+\.[a-zA-Z]+$/;
		var bOk = true;
		if (bOk){ if (document.getElementById('name').value == ''){ bOk = false; document.getElementById('name').focus(); alert (asMsg[0]); } }
				if (bOk){ if (document.getElementById('surname').value == ''){ bOk = false; document.getElementById('surname').focus(); alert (asMsg[1]); } }
		if (bOk){ if (!rMailCheck.test(document.getElementById('mail').value)){ bOk = false; document.getElementById('mail').focus(); alert (asMsg[2]); } }
		return(bOk);
	}
	function fContactMedia(sLang){
		switch (sLang){
			case 'fr':
				var asMsg = new Array ('Veuillez saisir votre prénom, vos noms','Veuillez saisir votre courriel');
				break;
			case 'es':
			 	var asMsg = new Array ('Por favor, debe introducir su nombre y apellidos','Por favor, introduzca una dirección de correo electrónico válida');
				break;
		}
		var rMailCheck = /^[\w\.-]+@[\w\.-]+\.[a-zA-Z]+$/;
		var bOk = true;
		if (bOk){ if (document.getElementById('name').value == ''){ bOk = false; document.getElementById('name').focus(); alert (asMsg[0]); } }
		if (bOk){ if (!rMailCheck.test(document.getElementById('mail').value)){ bOk = false; document.getElementById('mail').focus(); alert (asMsg[1]); } }
		return(bOk);
	}
	function fContactCours(sLang){
		switch (sLang){
			case 'fr':
				var asMsg = new Array ('Veuillez saisir votre prénom','Veuillez saisir vos noms','Veuillez saisir votre courriel');
				break;
			case 'es':
			 	var asMsg = new Array ('Por favor, debe introducir su nombre','Por favor introduzca sus apellidos','Por favor, introduzca una dirección de correo electrónico válida');
				break;
		}
		var rMailCheck = /^[\w\.-]+@[\w\.-]+\.[a-zA-Z]+$/;
		var bOk = true;
		if (bOk){ if (document.getElementById('dat_1').value == ''){ bOk = false; document.getElementById('dat_1').focus(); alert (asMsg[0]); } }
		if (bOk){ if (document.getElementById('dat_2').value == ''){ bOk = false; document.getElementById('dat_2').focus(); alert (asMsg[1]); } }
		if (bOk){ if (!rMailCheck.test(document.getElementById('dat_9').value)){ bOk = false; document.getElementById('dat_9').focus(); alert (asMsg[2]); } }
		return(bOk);
	}
	function fContactInfo(sLang){
		switch (sLang){
			case 'fr':
				var asMsg = new Array ('Veuillez saisir votre prénom','Veuillez saisir vos noms','Veuillez saisir votre courriel');
				break;
			case 'es':
			 	var asMsg = new Array ('Por favor, debe introducir su nombre','Por favor introduzca sus apellidos','Por favor, introduzca una dirección de correo electrónico válida');
		break; }
		var rMailCheck = /^[\w\.-]+@[\w\.-]+\.[a-zA-Z]+$/;
		var bOk = true;
		if (bOk){ if (document.getElementById('name').value == ''){ bOk = false; document.getElementById('name').focus(); alert (asMsg[0]); } }
		if (bOk){ if (document.getElementById('surname').value == ''){ bOk = false; document.getElementById('surname').focus(); alert (asMsg[1]); } }
		if (bOk){ if (!rMailCheck.test(document.getElementById('mail').value)){ bOk = false; document.getElementById('mail').focus(); alert (asMsg[2]); } }
		return(bOk);
	}
	function fSearchMedia(sLang){
		switch (sLang){
			case 'fr':
				var sMsg = ('Vous devez indiquer au moins un critère de recherche');
				break;
			case 'es':
			 	var sMsg = ('Debe indicar al menos, un criterio de búsqueda');
			 	break;
		}
		var bOk = true;
		var aobjRadio = document.getElementsByName('dat_1');
		if (bOk){ if (!(aobjRadio[0].checked) && !(aobjRadio[1].checked) && !(aobjRadio[2].checked) && !(aobjRadio[3].checked) && !(aobjRadio[4].checked) && !(aobjRadio[5].checked) && (document.getElementById('dat_2').value == '0') && (document.getElementById('dat_3').value == '')){ bOk = false; alert(sMsg); } }
		if (bOk){document.getElementById('media_search').submit(); }
	}
	function fSearchCult(sLang){
		switch (sLang){
			case 'fr':
				var asMsg = new Array('Vous devez indiquer au moins un critère de recherche', 'Saisissez la date dans l’un des formats suivants : jour/mois/année ; mois, année ;  année');
				break;
			case 'es':
			 	var asMsg = new Array('Debe indicar al menos un criterio de búsqueda', 'Introduzca la fecha en uno de los siguientes formatos: día/mes/año, mes/año, año');
			 	break;
		}
		var bOk = true;
		var bC1, bC2, bC3, bC4;
		var aobjRadio = document.getElementsByName('dat_1');
		
		bC1 = true;
		bC2 = (document.getElementById('yea').value != '' && !(document.getElementById('mon').value == '' && document.getElementById('day').value != '')) ? true : false;
		bC3 = (document.getElementById('dat_5').value != '0') ? true : false;
		bC4 = (document.getElementById('dat_6').value != '') ? true : false;
		
		if (bOk){ if (!bC2 && (document.getElementById('day').value != '' || document.getElementById('mon').value != '' || document.getElementById('mon').value != '')){ bOk = false; document.getElementById('day').focus(); alert(asMsg[1]); } }
		if (bOk){ if (!(bC1 || bC2 || bC3 || bC4)){ bOk = false; document.getElementById('dat_1').focus(); alert(asMsg[0]); } }
		if (bOk){ document.getElementById('cult_search').submit(); }	
	}
	function fCheckTest(id,sLang){
		var iHits = 0;
		var asRespuestas1 = new Array('2','2','1','1','2','1','2','0','1','1','2','1','0','1','0');
		var asRespuestas2 = new Array('0','1','2','0','2','1','1','2','2','1','1','0','2','1','1');
		var asRespuestas3 = new Array('0','0','0','1','2','0','2','0','1','0','0','2','2','0','2');
		for (i=1;i<=15;i++){
			if (eval('document.forms.dataform.q' + i + '[asRespuestas' + id + '[i-1]].checked')){ iHits++; }
		}
		switch(id){
			case '1':
				if (iHits<11){
					switch(sLang){
						case 'es':
							alert('Solo has acertado ' + iHits + ' preguntas. Necesitas\nal menos once para pasar al siguiente test.');
						break;
						case 'fr':
							alert('Vous n’avez que ' + iHits + ' réponses correctes.\nVous devez répondre correctement à onze questions pour pouvoir passer au test suivant');
						break;
					}								
				} else {
					switch(sLang){
						case 'es':
								alert('¡Muy bien!, has acertado ' + iHits + ' preguntas, a\ncontinuación inténtalo con el segundo test.');
						break;
						case 'fr':
							alert('Très bien ! Vous avez répondu correctement à ' + iHits + ' questions.\nFaites le deuxième test.');
						break;
					}		
					document.location.href='cours_test.asp?sid=02050000&tst=2';
				}
				break;
			case '2':
				if (iHits<11){
					switch(sLang){
						case 'es':
							alert('Solo has acertado ' + iHits + ' preguntas. Necesitas\nal menos once para pasar al siguiente test.');
						break;
						case 'fr':
							alert('Vous n’avez que ' + iHits + ' réponses correctes.\nVous devez répondre correctement à onze questions pour pouvoir passer au test suivant');
						break;
					}		
				} else {
					switch(sLang){
						case 'es':
							alert('¡Muy bien!, has acertado ' + iHits + ' preguntas, a\ncontinuación intentalo con el tercer test.');
						break;
						case 'fr':
							alert('Très bien ! Vous avez répondu correctement à ' + iHits + ' questions. Faites le troisième test.');
						break;
					}		
					document.location.href='cours_test.asp?sid=02050000&tst=3';
				}
				break;
			case '3':
				if (iHits<11){
					switch(sLang){
						case 'es':
							alert('Solo has acertado ' + iHits + ' preguntas. Necesitas al\nmenos once para completar la serie de tests.');
						break;
						case 'fr':
							alert('Vous n’avez que ' + iHits + ' réponses correctes.\nVous devez répondre correctement à onze questions.');
						break;
					}
				} else {
					switch(sLang){
						case 'es':
							alert('¡Muy bien!, has acertado ' + iHits + ' preguntas, Enhorabuena\npor completar los tres tests.');
						break;
						case 'fr':
						alert('Très bien ! Vous avez répondu correctement à ' + iHits + ' questions \nDes félicitations.');
						break;
					}
				}
				break;
		}
	}
	function fViewPic(sLang,sAID, sNum, sTotal, sWidth, sHeight){
		iWidth = parseInt(sWidth, 10) + 10; sWidth = iWidth.toString();
		iHeight = parseInt(sHeight, 10) + 128; sHeight = iHeight.toString();
		window.open('/'+ sLang +'/cgi-bin/viewpic.asp?aid=' + sAID + '&num=' + sNum + '&tot=' + sTotal, '_blank', 'width=' + sWidth + ',height=' + sHeight + ',menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0');
	}
	
	function fSetPicSize(lWidth, lHeight){
		window.resizeTo(lWidth, lHeight);
		window.moveTo((screen.width / 2) - (lWidth / 2), (screen.height / 2) - (lHeight/ 2))
		window.focus();
	}
//-->
