







	/*Object ElemMenu*/
	function ElemMenu(idancestor,id,dcr)
	{
		this.idancestor = idancestor;
		this.id = id;
		this.dcr = dcr;
	}
	/*Object ItemMenu*/
	function ItemMenu(name)
	{
		this.name = name;
		this.tabDcrs = new Array;/*Table of DCRs contained in this item*/
		this.tabElems = new Array;/*Table of ElemMenu contained in this item*/
		this.addElem = addElemMenu;
		this.containDcr = containDcrMenu;
		this.getTabIds = getTabIdsMenu;
		this.getElemMenuById = getElemMenuById;
	}
	/*Function for add an ElemeMenu in ItemMenu*/
	function addElemMenu(idancestor,id,dcr)
	{
		this.tabDcrs.push(dcr);
		var newElem = new ElemMenu(idancestor,id,dcr);
		this.tabElems.push(newElem);
	}
	/*Function for find if ItemMenu contain a dcr*/
	function containDcrMenu(dcr)
	{
		for(var i=0;i<this.tabDcrs.length;i++){
			if(this.tabDcrs[i] == dcr) {
				return true;
			}
		}
		return false;
	}
	/*Function for get an ElemeMenu in ItemMenu by Id*/
	function getElemMenuById(id)
	{
		for(var i=0;i<this.tabElems.length;i++){
			if(this.tabElems[i].id == id) {
				return this.tabElems[i];
			}
		}
		return false;
	}
	/*Function for get the table of self and ancestor IDs ElemeMenu in ItemMenu by dcr*/
	function getTabIdsMenu(dcr)
	{
		if(this.containDcr(dcr)) {
			var tabIds = new Array;
			for(var i=0;i<this.tabElems.length;i++){
				if(this.tabElems[i].dcr == dcr) {
					tabIds.push(this.tabElems[i].id);
					var idancestor = this.tabElems[i].idancestor;
					while(idancestor > 0){
						var ancestor = this.getElemMenuById(idancestor);
						if(ancestor) {
							tabIds.push(ancestor.id);
							idancestor = ancestor.idancestor;
						} else {
							idancestor = 0;
						}
					}
					return tabIds;
				}
			}
		}
		return false;
	}
	/*Object MenuAF*/
	function MenuAF()
	{
		this.tabItems = new Array;/*Table of Items contained in this menu*/
		this.addItem = addItemMenu;
		this.getCurrentRubrique = getCurrentRubrique;
		this.getCurrentItem = getCurrentItem;		
	}
	/*Function for add an item in MenuAF*/
	function addItemMenu(newItem)
	{
		this.tabItems.push(newItem);
	}
	/*Function for get the current ItemMenu object through cu_Dcr set in tpl*/
	function getCurrentItem()
	{
		if(cu_Dcr && cu_Dcr.length > 0){
			for(var i=0;i<this.tabItems.length;i++){
				if(this.tabItems[i].containDcr(cu_Dcr)) {
					return this.tabItems[i];
				}
			}
		}
		return false;
	}
	/*Function for get the currentRubrique through cu_Dcr set in tpl*/
	function getCurrentRubrique()
	{
		var currentItemMenu = this.getCurrentItem();
		if(currentItemMenu) {
			return "id_" + currentItemMenu.name;
		}
		return false;
	}



/*Begin set of ItemMenu Objects with xml menu*/

		
		var menuAF = new MenuAF();
		
		
		var itemUn = new ItemMenu('itemUn');
		menuAF.addItem(itemUn);
		itemUn.addElem(0,1,"accueil_achat_enregistrement");itemUn.addElem(1,2,"reservation_achat");itemUn.addElem(2,3,"reservation");itemUn.addElem(2,4,"UM");itemUn.addElem(1,5,"tarifs_promotions");itemUn.addElem(1,6,"option_payante");itemUn.addElem(1,7,"autre_service");itemUn.addElem(7,8,"reservation_site");itemUn.addElem(7,9,"hertz_voitures");itemUn.addElem(7,10,"tourisme");itemUn.addElem(1,11,"reservation_af_keep_in_touch_onglet");itemUn.addElem(1,12,"reservation_gerer");itemUn.addElem(1,13,"enregistrement_onglet");itemUn.addElem(13,14,"enregistrement_hle");
		
		var itemDeux = new ItemMenu('itemDeux');
		menuAF.addItem(itemDeux);
		itemDeux.addElem(0,1,"accueil_infos_vols_destinations");itemDeux.addElem(1,2,"horaires");itemDeux.addElem(2,3,"telechargement_horaire");itemDeux.addElem(1,4,"reseau_onglet");itemDeux.addElem(4,5,"avion_train_onglet");itemDeux.addElem(1,6,"guide_destinations");itemDeux.addElem(1,7,"calculateur_co2");
		
		var itemTrois = new ItemMenu('itemTrois');
		menuAF.addItem(itemTrois);
		itemTrois.addElem(0,1,"accueil_preparation_voyage");itemTrois.addElem(1,2,"formalite_onglet");itemTrois.addElem(1,3,"bien_etre_sante");itemTrois.addElem(3,4,"bien_etre_onglet");itemTrois.addElem(3,5,"bien_etre_sante_vaccination");itemTrois.addElem(3,6,"anti_stress");itemTrois.addElem(1,7,"assistance_passager");itemTrois.addElem(7,8,"famille_enfant_onglet");itemTrois.addElem(7,9,"femme_enceinte");itemTrois.addElem(7,10,"pmr_onglet");itemTrois.addElem(7,11,"pfc");itemTrois.addElem(1,12,"bagage");itemTrois.addElem(12,13,"bagage_cabine_onglet");itemTrois.addElem(12,14,"bagage_soute_onglet");itemTrois.addElem(12,15,"bagage_special_onglet");itemTrois.addElem(12,16,"bagage_incident_onglet");itemTrois.addElem(1,17,"animal_onglet");
		
		var itemQuatre = new ItemMenu('itemQuatre');
		menuAF.addItem(itemQuatre);
		itemQuatre.addElem(0,1,"accueil_aeroport");itemQuatre.addElem(1,2,"aeroport_enregistrement");itemQuatre.addElem(1,3,"la_premiere_aeroport");itemQuatre.addElem(1,4,"premium_europe_aeroport");itemQuatre.addElem(1,5,"salon_onglet");itemQuatre.addElem(5,6,"salon_partenaire");itemQuatre.addElem(1,7,"correspondance_cdg");itemQuatre.addElem(1,8,"car_airfrance");itemQuatre.addElem(1,9,"airfrance.travel-guides");
		
		var itemCinq = new ItemMenu('itemCinq');
		menuAF.addItem(itemCinq);
		itemCinq.addElem(0,1,"accueil_a_bord");itemCinq.addElem(1,2,"vols_intercontinentaux");itemCinq.addElem(2,3,"la_premiere_onglet");itemCinq.addElem(2,4,"affaires_onglet");itemCinq.addElem(2,5,"premium_voyageur_onglet");itemCinq.addElem(2,6,"alize_onglet");itemCinq.addElem(2,7,"voyageur_onglet");itemCinq.addElem(1,8,"nouvelle_classe_europe_onglet");itemCinq.addElem(1,9,"vols_en_france");itemCinq.addElem(1,10,"divertissement");itemCinq.addElem(1,11,"plan_cabine");
		
		var itemSix = new ItemMenu('itemSix');
		menuAF.addItem(itemSix);
		itemSix.addElem(0,1,"accueil_flying_blue");itemSix.addElem(1,2,"fblue");itemSix.addElem(2,3,"fblue_essentiel_onglet");itemSix.addElem(2,4,"Adhesion");itemSix.addElem(2,5,"moncompte");itemSix.addElem(2,6,"abt");itemSix.addElem(2,7,"fblue_regulariser");itemSix.addElem(2,8,"fblue_gagner_utiliser_onglet");itemSix.addElem(2,9,"fblue_profiter_tout_sur_prime_onglet");itemSix.addElem(2,10,"fblue_acheter");itemSix.addElem(2,11,"fblue_news_promotions");itemSix.addElem(2,12,"fblue_avantages_elite_onglet");itemSix.addElem(2,13,"fblue_service_client");itemSix.addElem(1,14,"petroleum");itemSix.addElem(14,15,"petroleum_programme_onglet");itemSix.addElem(14,16,"petroleum_deja_adherant");itemSix.addElem(14,17,"petroleum_services_client");itemSix.addElem(14,18,"petroleum_decouverte_adherer");
		
		var itemSept = new ItemMenu('itemSept');
		menuAF.addItem(itemSept);
		itemSept.addElem(0,1,"accueil_offre_entreprise_zz");itemSept.addElem(1,2,"bluebiz_onglet");itemSept.addElem(2,3,"bluebiz_compte");itemSept.addElem(2,4,"bluebiz_prime");itemSept.addElem(2,5,"bluebiz_espace_client");itemSept.addElem(2,6,"bluebiz_adherer");itemSept.addElem(1,7,"global_travel");itemSept.addElem(1,8,"accords_commerciaux");itemSept.addElem(1,9,"global_meeting");itemSept.addElem(1,10,"congres_salon_seminaire");

		
		var itemFooter = new ItemMenu('itemFooter');
		menuAF.addItem(itemFooter);
		itemFooter.addElem(0,0,"footer");itemFooter.addElem(0,1,"aide_et_contact");itemFooter.addElem(0,2,"plan_du_site");itemFooter.addElem(0,3,"air_france");itemFooter.addElem(0,4,"developpement_durable");itemFooter.addElem(0,5,"edito_preambule");itemFooter.addElem(0,6,"klm");itemFooter.addElem(0,7,"airfrance.com");itemFooter.addElem(0,8,"empire_of_sports");itemFooter.addElem(0,9,"SkyTeam");itemFooter.addElem(0,10,"bluenity");itemFooter.addElem(0,11,"twitter");itemFooter.addElem(0,12,"facebook");

/*End set of ItemMenu Objects with xml menu*/

cu_Http="http://";
cu_Https="https://";


/*fonction pour ouvrir les liens du menu (permet la gestion des params d'ouverture en popup)*/
function af_md(iu_UrlMenu,iu_HttpsMenu,iu_ParametreMenu)
{
  var vo_UrlMenu=new String(iu_UrlMenu) ;
  if (vo_UrlMenu.length && vo_UrlMenu.substr(0,7)!= "http://" && vo_UrlMenu.substr(0,8)!= "https://"){
  	/*Si on a une action ou une jsp on ajoute la chaine base cgi-bin/AF et la session*/
		if (vo_UrlMenu.indexOf(".do")>0 || vo_UrlMenu.indexOf(".jsp")>0){
			vo_UrlMenu=(iu_HttpsMenu?cu_Https:cu_Http)+cu_Serveur+chaineBase+vo_UrlMenu;
		}
		else{   	/*Si on a une page statique on ajoute juste la session*/
			if (vo_UrlMenu.indexOf(".htm")>0 || vo_UrlMenu.indexOf(".html")>0){
				vo_UrlMenu=(iu_HttpsMenu?cu_Https:cu_Http)+cu_Serveur+vo_UrlMenu;
			}
		}
  }
  /*affichage du lien en popum avec les params recup du xml menu*/
  if (iu_ParametreMenu)
  {
    var vo_FenetreMenu = window.open(vo_UrlMenu,"popup",iu_ParametreMenu);
    vo_FenetreMenu.focus();
		var vo_PopMenu = window.open(vo_UrlMenu,"popup",iu_ParametreMenu+",scrollbars=yes");
		if((!vo_PopMenu) || (vo_PopMenu.closed)){
		      alert(".");
		} else{
		 vo_FenetreMenu.focus();
		}	  
	}
  else 	/*Si url complete on la passe telle suelle*/
  {
	document.location=vo_UrlMenu;
  }
}


/*Alimentation des variables utiles pour le header*/
var affichagePicto = "Yes";
var countryLabel = "Россия";
var searchInSiteUrl = "";
var defaultSeachInputContent = "";
var aideUrl = "/RU/ru/local/transverse/footer/aide_et_contact.htm?menu=false";
var aideParamUrl = "";
var aideLibUrl = "Связаться с нами ";
var faqUrl = " ";
var faqParamUrl = "";
var faqLibUrl = " ";
var champsRechercher = "";

var premiereLangue =  "Русский";
var deuxiemeLangue =  "English";
var troisiemeLangue =  "";
var isMultiLangues = premiereLangue && deuxiemeLangue;
var autresPays = "другие страны";
var premiereLangueUrl = chaineBase + "/RU/ru/local/home/home/HomePageAction.do";
var deuxiemeLangueUrl = chaineBase + "/RU/en/local/home/home/HomePageAction.do";
var troisiemeLangueUrl = chaineBase + "";
var autresPaysUrl = chaineBase + "/RU/ru/local/home/home/redirection_home.jsp";
var traductionPays= "Россия";
var urlQgo =  "http://faq.airfrance.fr/b2c/AskQuestion.do";
var qgoRechercher =  "Ask a question here (English only)";
var qgoOk =  "ok";


function initFaqPopup() {
  document.getElementById('idFaqQuestion').value = document.getElementById('idQgoQuestion').value;
  document.getElementById('idFaqLanguage').value = cu_Langue;
  document.getElementById('idFaqCountry').value = cu_Marche;
  document.getElementById('idFaqReferrer').value = cu_Serveur;
  document.getElementById('idFaqDefaultQuestionBoolean').value = (document.getElementById('idQgoQuestion').value==document.getElementById('idQgoQuestion').defaultValue);
  var popup = window.open('','faqPopup','menubar=no, location=no, scrollbars=no, statusbar=no, width=890, height=450');
  document.faqForm.action = 'http://faq.airfrance.fr/b2c/AskQuestion.do';
  document.faqForm.target = 'faqPopup';
  document.faqForm.submit();
}

function goToHome() {
  var urlHomePage = "";
  for (var i=0;i<cu_Monet.length;i++){
     if (cu_Marche == cu_Monet[i]) { 
          urlHomePage = chaineBase + '/' + cu_Marche + '/' + cu_Langue + '/common/home/home/HomePageAction.do'; 
          break;
     }
  }
  if (urlHomePage == ""){
		for (i=0; i<cu_MonetNonVendeur.length; i++){
			if (cu_Marche == cu_MonetNonVendeur[i]) {
				urlHomePage = chaineBase + '/' + cu_Marche + '/' + cu_Langue + '/common/home/home/HomePageAction.do' + '?' + chaineLien;
				break;
			}
		}
	}
	
  if (urlHomePage == ""){
     urlHomePage = chaineBase + '/' + cu_Marche + '/' + cu_Langue + '/common/util/forwardClusterAction.do?url=flyingblue.htm';     
  }
  document.location = urlHomePage;
}

/* Variables pour le bloc FB */
	var libBoutonDepliantShow = "Show";
	var libBoutonDepliantHide = "Hide";

  var msgNoReservation = "You do not have any active reservations";
  var msgOtherReservations = "All your reservations";
  var labelRef = "Ref.";

	var urlLoginXml = chaineBase + '/' + cu_Marche + '/' + cu_Langue + '/local/home/login/XmlLoginAction.do';

	var libNiveauxTier = new Array();
	libNiveauxTier[0] = "Flying Blue Ivory member";
	libNiveauxTier[1] = "Flying Blue Silver member";
	libNiveauxTier[2] = "Flying Blue Club 2000 member";
	libNiveauxTier[3] = "Flying Blue Jeune member";
	libNiveauxTier[4] = "Flying Blue Jeune member";
	libNiveauxTier[5] = "Flying Blue Gold member";
	libNiveauxTier[6] = "Flying Blue Platinum member";
	
	var msg_plage_longueur_alphanum = "Поле Номер карты/имя пользователя должно содержать от {1} до {2} знаков";
	var msg_champs_alphanumeriques = "Поле {0} не должно содержать пробелов, символов *+-/, других специальных знаков";
	var msgMandatoryField = "Пожалуйста, заполните все поля, отмеченные красным восклицательным знаком !";

	var vocaIdentifiant	= "Log-in";
	var vocaMotDePasse	= "Pincode";
	
	/** Controle : Identifiant **/
	var msgFbNumberLength = msg_plage_longueur_alphanum.replace('\{0\}', vocaIdentifiant);
	msgFbNumberLength = msgFbNumberLength.replace("\{1\}", "6");
	msgFbNumberLength = msgFbNumberLength.replace("\{2\}", "16");
	msgFbNumberLength = msgFbNumberLength.replace("'", "\'");

	var msgFbNumberAlphaNum = msg_champs_alphanumeriques.replace("\{0\}", vocaIdentifiant);
	msgFbNumberAlphaNum = msgFbNumberAlphaNum.replace("'", "\'");
  

	/** Controle : Mot de passe **/
	var msgFbPasswordLength = msg_plage_longueur_alphanum.replace("\{0\}",vocaMotDePasse);
	msgFbPasswordLength = msgFbPasswordLength.replace("\{1\}", "4");
	msgFbPasswordLength = msgFbPasswordLength.replace("\{2\}", "10");
	msgFbPasswordLength = msgFbPasswordLength.replace("'", "\'");

	var msgFbPasswordAlphaNum = msg_champs_alphanumeriques.replace("\{0\}", vocaMotDePasse);
	msgFbPasswordAlphaNum = msgFbPasswordAlphaNum.replace("'", "\'");

	function showLoginError(errorCode) {
		var errorMsg;
		if(errorCode == 'COMM_MESG_LOGIN_NON_TROUVE') {
			errorMsg = "";
		}
		if(errorCode == 'COMM_MESG_LOGIN_INVALIDE') {
			errorMsg = "Этот пароль не соответствует указанному Вами имени пользователя или номеру карточки Flying Blue.";
		}
		if(errorCode == 'COMM_MESG_FORMAT_PASSWORD') {
			errorMsg = "";
		}
		if(errorCode == 'COMM_MESG_LOGIN_BLOQUE') {
			errorMsg = "Доступ к Вашим данным приостоновлен на 30 минут.";
		}
		if(errorCode == 'COMM_MESG_LOGIN_INVALIDE_BLOQUE') {
			errorMsg = "Доступ к Вашим данным будет приостоновлен на 30 минут.";
		}
		if(errorCode == 'COMM_MESG_POSSEDE_LOGIN') {
			errorMsg = "";
		} 
		if(errorCode == 'COMM_MESG_REFUSER') {
			errorMsg = "";
		}  
		if(errorCode == 'COMM_MESG_ERREUR_TECHNIQUE') {
			errorMsg = "Actuellement, nous ne pouvons satisfaire votre demande. Nous vous présentons nos excuses.";
		}
		alert(errorMsg);
	}

function toggleLoginBoxState(){
 if(document.getElementById("FBNotLoggued") != null){
	 if(document.getElementById("FBNotLoggued").style.display =="block"){
		 document.getElementById("FBNotLoggued").style.display = "none";
		 if(document.getElementById("toggleLogoFB") != null)document.getElementById("toggleLogoFB").src = "/FR/common/common/img/logos/FBLogo_closed.gif";
	 }
	 else {
		 if(document.getElementById("toggleLogoFB") != null)document.getElementById("toggleLogoFB").src = "/FR/common/common/img/logos/FBLogo_open.gif";
			 document.getElementById("FBNotLoggued").style.display = "block";
		
		 }
 }
}

/* Ajustement pour IE version superieure a 6 : IE7 et IE8 */
document.write('<!--[if gt IE 6]>');
	document.write('<style type="text/css">');
		document.write('#headerFB #FBLoggued .links {');
			document.write('padding-top:7px !important;');
		document.write('}');
		document.write('#headerFB #FBNotLoggued .links {');
			document.write('padding-top:0px !important;');
		document.write('}');
		document.write('#FBLogguedIdentity {');
			document.write('padding-top:6px !important;');
		document.write('}');
		document.write('#surheader #blocQgo #idQgoOk {');
			document.write('margin:0 0px 0 4px !important;');
		document.write('}');
	document.write('</style>');
document.write('<![endif]-->');

document.write('<!--[if gte IE 8]>');
	document.write('<style type="text/css">');
		document.write('.depliantBottom .boutonDepliant img {');
			document.write('top:-2px !important;');
		document.write('}');
	document.write('</style>');
document.write('<![endif]-->');

/* Fin Variables pour le bloc FB */






