<!--
	// ===============================================================================================
	// Instituto Francés de Valencia                               Copyright 2006 Integra Digital S.L.
	// http://www.integradigital.com                                           info@integradigital.com
	// ===============================================================================================
	
	var DEF_MENUS = 6;
	
	var abMenuStates = new Array(false, false, false, false, false, false, false);
	var abMenuSubmenus = new Array(false, true, true, true, true, true, true);
	var alMenuInterval = new Array(0, 0, 0, 0, 0, 0, 0, 0);
	var alMenuTimeout = new Array(0, 0, 0, 0, 0, 0, 0, 0);
	
		
	function fMenuOver(iMenu, iLeft){
		var iCont;		
		for (iCont = 0; iCont <= 7; iCont++){ if (abMenuStates[iCont] && iCont != iMenu){ fMenuHide(iCont); } }
		if (abMenuSubmenus[iMenu] && abMenuStates[iMenu] && alMenuTimeout[iMenu]){ clearTimeout(alMenuTimeout[iMenu]); }
		if (abMenuSubmenus[iMenu] && !abMenuStates[iMenu]){
			abMenuStates[iMenu] = true;
			var objElement = document.getElementById('sub_' + iMenu.toString());
			var objAbsolute = document.getElementById('tbl');
			if (objElement.style){
				objElement.style.left = iLeft + parseInt(objAbsolute.offsetParent.offsetLeft);
				//alert( parseInt(objAbsolute.offsetParent.offsetLeft));
				objElement.style.visibility = 'visible';				
				if (objElement.filters){
					objElement.style.filter = 'alpha(opacity=0)';
					
					if (alMenuInterval[iMenu]){ clearInterval(alMenuInterval[iMenu]); }
					alMenuInterval[iMenu] = setInterval('fMenuFadeon' + iMenu.toString() + '();', 10);
				}
			}
		}
	}
	function fMenuOut(iMenu){ if (abMenuSubmenus[iMenu] && abMenuStates[iMenu]){ if (alMenuTimeout[iMenu]){ clearTimeout(alMenuTimeout[iMenu]); } alMenuTimeout[iMenu] = setTimeout('fMenuHide' + iMenu.toString() + '();', 500); } }
	
	function fMenuHide0(){ fMenuHide(0); }
	function fMenuHide1(){ fMenuHide(1); }
	function fMenuHide2(){ fMenuHide(2); }
	function fMenuHide3(){ fMenuHide(3); }
	function fMenuHide4(){ fMenuHide(4); }
	function fMenuHide5(){ fMenuHide(5); }
	function fMenuHide6(){ fMenuHide(6); }	
	function fMenuHide7(){ fMenuHide(7); }	
	function fMenuHideAll(){ var iCont; for (iCont = 0; iCont <= 7; iCont++){ if (abMenuStates[iCont]){ fMenuHide(iCont); } } }
	function fMenuHide(iMenu){
		if (abMenuSubmenus[iMenu] && abMenuStates[iMenu]){
			abMenuStates[iMenu] = false;
			if (alMenuTimeout[iMenu]){ clearTimeout(alMenuTimeout[iMenu]); }
			var objElement = document.getElementById('sub_' + iMenu.toString());			
			if (objElement.filters){
				if (alMenuInterval[iMenu]){ clearInterval(alMenuInterval[iMenu]); }
				alMenuInterval[iMenu] = setInterval('fMenuFadeoff' + iMenu.toString() + '();', 10);
			} else {
				if (objElement.style){
					objElement.style.visibility = 'hidden';					
				}
			}
		}
	}
	function fMenuFadeon0(){ fMenuFadeon(0); }
	function fMenuFadeon1(){ fMenuFadeon(1); }
	function fMenuFadeon2(){ fMenuFadeon(2); }
	function fMenuFadeon3(){ fMenuFadeon(3); }
	function fMenuFadeon4(){ fMenuFadeon(4); }
	function fMenuFadeon5(){ fMenuFadeon(5); }
	function fMenuFadeon6(){ fMenuFadeon(6); }	
	function fMenuFadeon7(){ fMenuFadeon(7); }	
	function fMenuFadeon(iMenu){
		var objElement = document.getElementById('sub_' + iMenu .toString());
		if (objElement.filters){
			if (objElement.filters.alpha.opacity < 100){
				objElement.filters.alpha.opacity += 25;				
			} else if (alMenuInterval[iMenu]){
				if (alMenuInterval[iMenu]){ clearInterval(alMenuInterval[iMenu]); }
			}
		}
	}
	function fMenuFadeoff0(){ fMenuFadeoff(0); }
	function fMenuFadeoff1(){ fMenuFadeoff(1); }
	function fMenuFadeoff2(){ fMenuFadeoff(2); }
	function fMenuFadeoff3(){ fMenuFadeoff(3); }
	function fMenuFadeoff4(){ fMenuFadeoff(4); }
	function fMenuFadeoff5(){ fMenuFadeoff(5); }
	function fMenuFadeoff6(){ fMenuFadeoff(6); }
	function fMenuFadeoff7(){ fMenuFadeoff(7); }
	
	function fMenuFadeoff(iMenu){
		var objElement = document.getElementById('sub_' + iMenu.toString());	
		if (objElement.filters){
			if (objElement.filters.alpha.opacity > 0){
				objElement.filters.alpha.opacity -= 25;				
			} else if (alMenuInterval[iMenu]){
				if (alMenuInterval[iMenu]){ clearInterval(alMenuInterval[iMenu]); }
				if (objElement.style){
					objElement.style.visibility = 'hidden';					
				}
			}
		}
	}
	
	function fMenuSubOver(sSubMenu){
		var objSymbol = document.getElementById('symbol_' + sSubMenu)
		var objBg = document.getElementById('bg_' + sSubMenu)
		var objBgRight = document.getElementById('bg_right_' + sSubMenu)		
		if(objSymbol){ objSymbol.className = 'symbol_sub_on'; }
		if(objBg){ objBg.className = 'bg_sub_on'; }
		if(objBgRight){ objBgRight.className = 'bg_right_sub_on'; }
	}	
	function fMenuSubOut(sSubMenu){
		var objSymbol = document.getElementById('symbol_' + sSubMenu)
		var objBg = document.getElementById('bg_' + sSubMenu)
		var objBgRight = document.getElementById('bg_right_' + sSubMenu)
		if(objSymbol){ objSymbol.className = 'symbol_sub_off'; }
		if(objBg){ objBg.className = 'bg_sub_off'; }
		if(objBgRight){ objBgRight.className = 'bg_right_sub_off'; }
	}	
	
	
	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();
	}
	function fSendArticle(sSID, sAID, sLang){
		var rMailCheck = /^[\w\.-]+@[\w\.-]+\.[a-zA-Z]+$/;
		switch (sLang){
			case 'es':
				var asTXT = new Array('Introduzca su nombre, para que aparezca como remitente del mensaje:', 'Introduzca su dirección de correo electrónico:', 'Debe especificar una dirección de correo electrónico válida', 'Introduzca el nombre del destinatario:', 'Introduzca la dirección de correo electrónico del destinatario:');
				break;
			case 'fr':
				var asTXT = new Array('Introduisez votre nom, afin qu\'il apparaisse comme expéditeur:', 'Introduisez votre adresse électronique:', 'Vous devez introduire une adresse électronique valide', 'Introduisez le nom du destinataire:', 'Introduisez l\'adresse électronique du destinataire:');
				break;
		}
		var sFromName = prompt(asTXT[0],'');
		
		if (sFromName){
			var sFromMail = prompt(asTXT[1],'');
			if (sFromMail){
				if (!rMailCheck.test(sFromMail)){
					alert(asTXT[2]);
				} else {
					var sToName = prompt(asTXT[3],'');
					if (sToName){
						var sToMail = prompt(asTXT[4],'');
						if (sToMail){
							if (!rMailCheck.test(sToMail)){
								alert(asTXT[2]);
							} else {
								if (sAID == '0'){
									window.open('/' + sLang + '/cgi-bin/section_send.asp?sid=' + sSID + '&fn=' + sFromName + '&fm=' + sFromMail + '&tn=' + sToName + '&tm=' + sToMail, '_blank', 'directories=0,width=450,height=100,location=0,menubar=0,resizable=0,status=0,toolbar=0,titlebar=0,scrollbars=0');
								} else {
									window.open('/' + sLang + '/cgi-bin/article_send.asp?sid=' + sSID + '&aid=' + sAID + '&fn=' + sFromName + '&fm=' + sFromMail + '&tn=' + sToName + '&tm=' + sToMail, '_blank', 'directories=0,width=450,height=100,location=0,menubar=0,resizable=0,status=0,toolbar=0,titlebar=0,scrollbars=0');
								}
							}
						}
					}
				}
			}
		}
	}
	function fCheckFrmTpv(sLang){
		var bOk = true;
		var rMailCheck = /^[\w\.-]+@[\w\.-]+\.[a-zA-Z]+$/;
		switch (sLang){
			case 'fr':
				var asMsg = new Array ('Merci de bien vouloir remplir tous les champs du formulaire','Merci d\'indiquer une adresse électronique valide', 'Merci d\'indiquer le cours que vous souhaitez payer');
				break;
			case 'es':
			 	var asMsg = new Array ('Por favor, debe rellenar todos los campos del formulario','Por favor, introduzca una dirección de correo electrónico válida', 'Por favor, debe indicar el curso que quiere pagar');
		break; }
		for (iCont = 1; iCont <= 8; iCont++){
			if (bOk){ if (document.getElementById('dat'+ iCont.toString()).value == ''){ bOk = false; document.getElementById('dat'+ iCont.toString()).focus(); alert (asMsg[0]); } }
		}
		if (bOk){ if (!rMailCheck.test(document.getElementById('dat8').value)){ bOk = false; document.getElementById('dat8').focus(); alert (asMsg[1]); } }
		if (bOk){ if (document.getElementById('dat9').value == ''){ bOk = false; document.getElementById('dat9').focus(); alert (asMsg[2]); } }
		if (bOk){ if (document.getElementById('dat10').value == ''){ bOk = false; document.getElementById('dat10').focus(); alert (asMsg[2]); } }
		if (bOk){ if (document.getElementById('dat11').value == ''){ bOk = false; document.getElementById('dat11').focus(); alert (asMsg[2]); } }
		return(bOk);
	}
	function calc() {		
		window.open('','tpv','width=1024,height=760,scrollbars=no,resizable=yes,status=yes,menubar=no,location=no');
		document.forms[0].submit();
	}
	function fBackTPV(){
		//window.close();
		//window.parent.document.location.replace('/es/cgi-bin/section.asp?sid=02030200');
		window.opener.location.href = '/es/cgi-bin/section.asp?sid=02030200';
	}
	function fOpenVisa(){ window.open('/info_visa.html','ifv_legal','width=500,height=500,directories=0,location=0,menubar=0,resizable=0,status=0,toolbar=0,titlebar=0,scrollbars=1'); }   
	function fOpenMaster(){ window.open('/info_master.html','ifv_legal','width=500,height=500,directories=0,location=0,menubar=0,resizable=0,status=0,toolbar=0,titlebar=0,scrollbars=1'); }   
//-->