// JavaScript Document

function ChangeFond(fond) {

	switch(fond)
	{
	case 'accueil' :
		document.location.href = "index.php";
		/*document.getElementById('global').style.backgroundImage = 'url("img/design/F-accueil.jpg")';
		document.getElementById('page').style.backgroundColor = 'transparent';
		ajax_loadContent('page','accueil.php');*/
		break;
	case 'restaurant' :
		document.getElementById('global').style.backgroundImage = 'url("img/design/F-restaurant.jpg")';
		document.getElementById('page').style.backgroundColor = '#ffffff';
		document.getElementById('page').style.filter='alpha(opacity=95)';
		document.getElementById('page').style.opacity =0.95;
		document.getElementById('page').style.MozOpacity = 0.95;
		document.getElementById('page').style.KhtmlOpacity = 0.95;
		ajax_loadContent('page','restaurant.php');
		break;
	case 'hotel' :
		document.getElementById('global').style.backgroundImage = 'url("img/design/F-hotel.jpg")';
		document.getElementById('page').style.backgroundColor = '#ffffff';
		document.getElementById('page').style.filter='alpha(opacity=85)';
		document.getElementById('page').style.opacity =0.85;
		document.getElementById('page').style.MozOpacity = 0.85;
		document.getElementById('page').style.KhtmlOpacity = 0.85;
		ajax_loadContent('page','hotel.php');
		break;
	case 'region' :
		document.getElementById('global').style.backgroundImage = 'url("img/design/F-region.jpg")';
		document.getElementById('page').style.backgroundColor = '#ffffff';
		document.getElementById('page').style.filter='alpha(opacity=85)';
		document.getElementById('page').style.opacity =0.85;
		document.getElementById('page').style.MozOpacity = 0.85;
		document.getElementById('page').style.KhtmlOpacity = 0.85;
		ajax_loadContent('page','region.php');
		break;
	case 'contact' :
		document.getElementById('global').style.backgroundImage = 'url("img/design/F-contact.jpg")';
		document.getElementById('page').style.backgroundColor = '#ffffff';
		document.getElementById('page').style.filter='alpha(opacity=85)';
		document.getElementById('page').style.opacity =0.85;
		document.getElementById('page').style.MozOpacity = 0.85;
		document.getElementById('page').style.KhtmlOpacity = 0.85;
		ajax_loadContent('page','contact.php');
		break;
	case 'plan' :
		document.getElementById('global').style.backgroundImage = 'url("img/design/F-accueil.jpg")';
		document.getElementById('page').style.backgroundColor = '#ffffff';
		document.getElementById('page').style.filter='alpha(opacity=85)';
		document.getElementById('page').style.opacity =0.85;
		document.getElementById('page').style.MozOpacity = 0.85;
		document.getElementById('page').style.KhtmlOpacity = 0.85;
		ajax_loadContent('page','plan.php');
		break;
	case 'mentions' :
		document.getElementById('global').style.backgroundImage = 'url("img/design/F-accueil.jpg")';
		document.getElementById('page').style.backgroundColor = '#ffffff';
		document.getElementById('page').style.filter='alpha(opacity=85)';
		document.getElementById('page').style.opacity =0.85;
		document.getElementById('page').style.MozOpacity = 0.85;
		document.getElementById('page').style.KhtmlOpacity = 0.85;
		ajax_loadContent('page','mentions.php');
		break;
	
	default :
		document.getElementById('global').style.backgroundImage = 'url("img/design/F-accueil.jpg")';
		document.getElementById('page').style.backgroundColor = 'transparent';
		ajax_loadContent('page','accueil.php');
	}

}

// ----------------------------------------------


// BANDEAU DIAPORAMA -----

var dossier="img/bandeau/";
var nombredimage=8;
var opaa=0;
var opab=100;
var compteur=2;
var vitesse=3000;
//var boucle=1;


	function defilmage(reg){
	var oxo=reg;
	
		if(compteur==nombredimage){
		compteur=0;
		}
	
		if(oxo==1){
		compteur++;
		opaa=30;
		document.getElementById('divimageb').src=dossier+compteur+".jpg";
		oxo=0;
		}
		
	var imacibleb=document.getElementById('divimagea');
	var imaciblea=document.getElementById('divimageb');
	opaa+=2; // 5
	opab-=2; // 10
	
		if(document.all && !window.opera){ 
		imaciblea.style.filter = 'alpha(opacity=' + opaa + ');' ;
		imacibleb.style.filter = 'alpha(opacity=' + opab + ');';
		} 
			else{ 
			imaciblea.style.opacity = opaa/100;
			imacibleb.style.opacity = opab/100;
			}
			
		if(opaa>=100){
		opaa=30;
		opab=100;
		imacibleb.src=imaciblea.src;
		marche=setTimeout("defilmage(1)",vitesse);
		return false
		}
		
	setTimeout("defilmage()",25);
	}
	

document.onload=setTimeout(defilmage,vitesse);

// ----------


function VerifForm_Contact()
{
	var Nom;
	var Prenom;
	var Email;
	var Telephone;
	var Message;

	Nom=document.FormContact.nom.value;
	Prenom=document.FormContact.prenom.value;
	Email=document.FormContact.email.value;
	Telephone=document.FormContact.telephone.value;
	Message=document.FormContact.message.value;
	
	if (Nom=="")
	{
         window.alert("Veuillez indiquer votre nom.");
		 document.FormContact.nom.value="";
		 document.FormContact.nom.focus();
         return false;
	}

	if ((Email.indexOf("@")<=0)&&(Email.indexOf(".")<=0))
	{
         window.alert("Veuillez saisir une adresse e-mail valide.");
		 document.FormContact.email.value="";
		 document.FormContact.email.focus();
         return false;
	}

	if (Message=="")
	{
         window.alert("Veuillez saisir un message.");
		 document.FormContact.message.value="";
		 document.FormContact.message.focus();
         return false;
	}
	
	else
	{
	//ajax_loadContent('page','contactSEND.php?var1="+form1.total.value+"');
		ajax_loadContent('page',' contactSEND.php?Nom='+Nom+'&Prenom='+Prenom+'&Email='+Email+'&Telephone='+Telephone+'&Message='+Message+' ');

	//document.FormContact.submit();
	}

}

// **********

function Redir_Get(page) {
	
window.location.replace(page);

}

// **********


function Plan()
{
window.open('plan-print.htm', 'Plan', 'width=530, height=470,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no, left='+((screen.width/2)-275)+', top=40');
}




// others -----

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// ----------
