﻿/* Modification des couleurs de l'interface, via flash */
var interfaceColor = function(c){
	//alert(c);
	if (c == '#000000'){c='#0551af';}
	document.getElementById('allPage').style.background=c; 
}

/* Menu Langue*/
var setRollOver = function(imgId, imgNormal, imgOver) 
		{ 
		   if(!document.getElementById) return; 
		   
		   i1 = new Image();
		   i1.src = imgOver;
		   // Identification de l'élément 
		   var img = document.getElementById(imgId); 
		   if(!img) {
			   alert (imgId +" Introuvable");
			   return;
		   }
		   
		   // Survol
		   img.onmouseover = function() { img.src=imgOver; img.className='menuBoutonOver';}; 
		 
		   // Retour à l'état d'origine 
		   img.onmouseout = function() { img.src=imgNormal; img.className='menuBoutonNormal';}; 
		   
		   //
		   img.onmousedown = function() { changeLangue('flashMain', img.id); };
		} 

var buildMenuLangue = function (){
	setRollOver('fr', 'interface/drapeaux/fr.png', 'interface/drapeaux/fr_over.png');
	setRollOver('de', 'interface/drapeaux/de.png', 'interface/drapeaux/de_over.png');
	setRollOver('gb', 'interface/drapeaux/gb.png', 'interface/drapeaux/gb_over.png');
}
	
var changeLangue = function (flashId, langueId){
	document.getElementById(flashId).setLangueFromJS(langueId);
  
  // paramètres pour IFrame de recherche : 
  
	switch (langueId) {
		case 'fr':
		document.getElementById('mentionsLink').innerHTML ="Mentions légales";
		document.getElementById('contactLink').innerHTML ="Contact / Accès";
		document.getElementById('animation').langue.value = 'fr';
    document.getElementById('brochuresLink').innerHTML = 'Documents à télécharger';
    document.getElementById('documentsLink').innerHTML = 'Espace Pro';
    document.getElementById('groupesLink').innerHTML = 'Groupes';
    document.getElementById('audioGuidesLink').innerHTML = 'Audio Guides';
    // IFrame de recherche : 
    document.getElementById('reservationIFrame').innerHTML = '<iframe src="php/elements/blocTourismeAlsace.php?langue=fr" frameborder="0" scrolling="no">';
		break;
		case 'de':
		document.getElementById('mentionsLink').innerHTML ="Impressum";
		document.getElementById('contactLink').innerHTML ="Contact / Anfahrt";
		document.getElementById('animation').langue.value = 'de';
    document.getElementById('brochuresLink').innerHTML = 'Downloads';
    document.getElementById('documentsLink').innerHTML = 'Espace Pro';
    document.getElementById('groupesLink').innerHTML = 'Gruppen';
    document.getElementById('audioGuidesLink').innerHTML = 'Audio Guides';
    // IFrame de recherche : 
    document.getElementById('reservationIFrame').innerHTML = '<iframe src="php/elements/blocTourismeAlsace.php?langue=de" frameborder="0" scrolling="no">';
		break;
		case 'gb':
		document.getElementById('mentionsLink').innerHTML ="Legal information and notices";
		document.getElementById('contactLink').innerHTML =" Contact / Access";
		document.getElementById('animation').langue.value = 'gb';
    document.getElementById('brochuresLink').innerHTML = 'Downloads';
    document.getElementById('documentsLink').innerHTML = 'Espace Pro';
    document.getElementById('groupesLink').innerHTML = 'Groups';
    document.getElementById('audioGuidesLink').innerHTML = 'Audio Guides';
    // IFrame de recherche : 
    document.getElementById('reservationIFrame').innerHTML = '<iframe src="php/elements/blocTourismeAlsace.php?langue=en" frameborder="0" scrolling="no">';
		break;
	}
}
var setContactButton = function(flashId){
	if(!document.getElementById) return; 
	var contact = document.getElementById('contactLink'); 

   contact.onmouseover = function() { contact.className='contactOver';}; 
   contact.onmouseout = function() { contact.className='contactNormal';}; 
   contact.onmousedown = function() { showContact(flashId); };
}
var showContact = function(flashId){
	document.getElementById(flashId).gotoContactFromJS();
}
var setGaleriesButton = function(flashId){
	if(!document.getElementById) return; 
	var galeries = document.getElementById('galeriesLink'); 
  
   galeries.onmouseover = function() { galeries.className='contactOver';}; 
   galeries.onmouseout = function() { galeries.className='contactNormal';}; 
   galeries.onmousedown = function() { showGaleries(flashId); };
}
var showGaleries = function(flashId){
	document.getElementById(flashId).gotoGaleriesFromJS();
}
var setMentionsButton = function(flashId){
	if(!document.getElementById) return; 
	var mentions = document.getElementById('mentionsLink'); 

   mentions.onmouseover = function() { mentions.className='contactOver';}; 
   mentions.onmouseout = function() { mentions.className='contactNormal';}; 
   mentions.onmousedown = function() { showMentions(flashId); };
}

var showMentions = function(flashId){
	document.getElementById(flashId).gotoMentionsFromJS();
}

var setBrochuresButton = function(flashId){
	if(!document.getElementById) return; 
	var brochures = document.getElementById('brochuresLink'); 

   brochures.onmouseover = function() { brochures.className='contactOver';}; 
   brochures.onmouseout = function() { brochures.className='contactNormal';}; 
   brochures.onmousedown = function() { showBrochures(flashId); };
}

var showBrochures = function(flashId){
	document.getElementById(flashId).gotoBrochuresFromJS();
}

var setDocumentsButton = function(flashId){
	if(!document.getElementById) return; 
	var documents = document.getElementById('documentsLink'); 
  
   documents.onmouseover = function() { documents.className='contactOver';}; 
   documents.onmouseout = function() { documents.className='contactNormal';}; 
   documents.onmousedown = function() { showDocuments(flashId); };
}
var showDocuments = function(flashId){
	document.getElementById(flashId).gotoDocumentsFromJS();
}

var setGroupesButton = function(flashId){
	if(!document.getElementById) return; 
	var groupes = document.getElementById('groupesLink'); 
  
   groupes.onmouseover = function() { groupes.className='contactOver';}; 
   groupes.onmouseout = function() { groupes.className='contactNormal';}; 
   groupes.onmousedown = function() { showGroupes(flashId); };
}
var showGroupes = function(flashId){
	document.getElementById(flashId).gotoGroupesFromJS();
}

var setAudioGuidesButton = function(flashId){
	if(!document.getElementById) return; 
	var audioGuides = document.getElementById('audioGuidesLink'); 
  
   audioGuides.onmouseover = function() { audioGuides.className='contactOver';}; 
   audioGuides.onmouseout = function() { audioGuides.className='contactNormal';}; 
   audioGuides.onmousedown = function() { showAudioGuides(flashId); };
}

var showAudioGuides = function(flashId){
	document.getElementById(flashId).gotoAudioGuidesFromJS();
}

// pour hébergement : 
var showReservationHebergement = function(){
  document.getElementById('reservationPrincipale').className = 'visible';
  document.getElementById('reservationPrincipale').innerHTML = '<a href="http://www.nethotels-reserver.com/saverne/default.htm" target="_blank">Effectuer une recherche avancée pour trouver un hébergement</a>';
}
var showReservationSejour = function(){
  document.getElementById('reservationPrincipale').className = 'visible';
  document.getElementById('reservationPrincipale').innerHTML = '<a href="http://fr.nethotels.com/saverne/view_package.asp" target="_blank">Consultez les forfaits "séjour".</a>';
}
var hideReservation = function(){
  document.getElementById('reservationPrincipale').className='hide';
}

