// JavaScript Main Document
$(document).ready(function() {

	/*** Gestion du menu deroulant ***/
	$('.chambre').mouseenter(
		function() {
			$('.ss-menu-elmt:hidden').slideDown(300);
		}
	);
	
	$('ul').parent('.chambre').mouseleave(
		function() {
			//$('.ss-menu-elmt').delay(300).slideUp(300);
			$('.ss-menu-elmt:visible').slideUp(300);
		}
	);

	/*** Fin de gestion du menu deroulant ***/
	
	/*** Fonction de hover pour les images dans les li ***/
	$('.chambre').hover(
		function() {
			$('.chambre img.img-menu-elmt').attr('src','../utiles/images/menu/fr/nos_chambres_hover.jpg');
		},
		function() {
			$('.chambre img.img-menu-elmt').attr('src','../utiles/images/menu/fr/nos_chambres.jpg');
		}
	);
	
		$('.grand_lit').hover(
			function() {
				$('.grand_lit img').attr('src','../utiles/images/menu/fr/chambre_grand_lit_confort_hover.jpg');
			},
			function() {
				$('.grand_lit img').attr('src','../utiles/images/menu/fr/chambre_grand_lit_confort.jpg');
			}
		);
		
		$('.deux_lits').hover(
			function() {
				$('.deux_lits img').attr('src','../utiles/images/menu/fr/chambre_deux_lits_confort_hover.jpg');
			},
			function() {
				$('.deux_lits img').attr('src','../utiles/images/menu/fr/chambre_deux_lits_confort.jpg');
			}
		);
		
		$('.mobilite_reduite').hover(
			function() {
				$('.mobilite_reduite img').attr('src','../utiles/images/menu/fr/chambre_personne_mobilite_reduite_hover.jpg');
			},
			function() {
				$('.mobilite_reduite img').attr('src','../utiles/images/menu/fr/chambre_personne_mobilite_reduite.jpg');
			}
		);
		
		$('.familiale').hover(
			function() {
				$('.familiale img').attr('src','../utiles/images/menu/fr/chambre_familiale_hover.jpg');
			},
			function() {
				$('.familiale img').attr('src','../utiles/images/menu/fr/chambre_familiale.jpg');
			}
		);
		
		$('.standard').hover(
			function() {
				$('.standard img').attr('src','../utiles/images/menu/fr/chambre_standard_hover.jpg');
			},
			function() {
				$('.standard img').attr('src','../utiles/images/menu/fr/chambre_standard.jpg');
			}
		);
	
	$('.terrasse').hover(
		function() {
			$('.terrasse img').attr('src','../utiles/images/menu/fr/notre_terrasse_hover.jpg');
		},
		function() {
			$('.terrasse img').attr('src','../utiles/images/menu/fr/notre_terrasse.jpg');
		}
	);
	
	$('.prestations').hover(
		function() {
			$('.prestations img').attr('src','../utiles/images/menu/fr/nos_prestations_hover.jpg');
		},
		function() {
			$('.prestations img').attr('src','../utiles/images/menu/fr/nos_prestations.jpg');
		}
	);
	
	$('.decouverte').hover(
		function() {
			$('.decouverte img').attr('src','../utiles/images/menu/fr/decouverte_hover.jpg');
		},
		function() {
			$('.decouverte img').attr('src','../utiles/images/menu/fr/decouverte.jpg');
		}
	);
	
	$('.tarifs').hover(
		function() {
			$('.tarifs img').attr('src','../utiles/images/menu/fr/nos_tarifs_hover.jpg');
		},
		function() {
			$('.tarifs img').attr('src','../utiles/images/menu/fr/nos_tarifs.jpg');
		}
	);
	
	$('.plan').hover(
		function() {
			$('.plan img').attr('src','../utiles/images/menu/fr/contact_plan_hover.jpg');
		},
		function() {
			$('.plan img').attr('src','../utiles/images/menu/fr/contact_plan.jpg');
		}
	);
	/*** Fin de gestion des fonctions de hover pour les images dans les li ***/


	/*** Debut de gestion des fonctions de hover pour les images dans le footer/header ***/
	$('#retour_accueil').hover(
		function() {
			$('#retour_accueil img').attr('src','../utiles/images/footer/fr/bottom_link_accueil_hover.jpg');
		},
		function() {
			$('#retour_accueil img').attr('src','../utiles/images/footer/fr/bottom_link_accueil.jpg');
		}
	);
	
	$('#mentions').hover(
		function() {
			$('#mentions img').attr('src','../utiles/images/footer/fr/bottom_link_mentions_hover.jpg');
		},
		function() {
			$('#mentions img').attr('src','../utiles/images/footer/fr/bottom_link_mentions.jpg');
		}
	);
	
	$('#sitemap').hover(
		function() {
			$('#sitemap img').attr('src','../utiles/images/footer/fr/bottom_link_sitemap_hover.jpg');
		},
		function() {
			$('#sitemap img').attr('src','../utiles/images/footer/fr/bottom_link_sitemap.jpg');
		}
	);
	
	$('#reservez').hover(
		function() {
			$('#reservez img').attr('src','../utiles/images/footer/fr/bouton_reservez_hover.jpg');
		},
		function() {
			$('#reservez img').attr('src','../utiles/images/footer/fr/bouton_reservez.jpg');
		}
	);
	
	$('#contactez-nous').hover(
		function() {
			$('#contactez-nous img').attr('src','../utiles/images/header/fr/bouton_contactez_nous_hover.png');
		},
		function() {
			$('#contactez-nous img').attr('src','../utiles/images/header/fr/bouton_contactez_nous.png');
		}
	);
	
	$('#reservez-home').hover(
		function() {
			$('#reservez-home img').attr('src','utiles/images/footer/fr/bouton_reservez_hover.jpg');
		},
		function() {
			$('#reservez-home img').attr('src','utiles/images/footer/fr/bouton_reservez.jpg');
		}
	);
	
	$('#bienvenue-home').hover(
		function() {
			$('#bienvenue-home img').attr('src','utiles/images/home/bienvenue_hover.jpg');
		},
		function() {
			$('#bienvenue-home img').attr('src','utiles/images/home/bienvenue.jpg');
		}
	);
	
	$('#willkommen-home').hover(
		function() {
			$('#willkommen-home img').attr('src','utiles/images/home/willkommen_hover.jpg');
		},
		function() {
			$('#willkommen-home img').attr('src','utiles/images/home/willkommen.jpg');
		}
	);
	
	$('#welcome-home').hover(
		function() {
			$('#welcome-home img').attr('src','utiles/images/home/welcome_hover.jpg');
		},
		function() {
			$('#welcome-home img').attr('src','utiles/images/home/welcome.jpg');
		}
	);
	/*** Fin de gestion des fonctions de hover pour les images dans le footer/header ***/

	/*** Appel du plug-in slideshow ***/
	slideShow();
	/*** Fin appel du plug-in slideshow ***/
	
	/*** Appel du plug-in easySlider ***/
	$("#slider").easySlider();
	/*** Fin appel du plug-in easySlider ***/
	
	/*** Effet de clignotement du boutton contactez nous ***/
	setInterval('contactez_nous()',4500);
	
	//Initialisation qui evite d'attendre les 4.5 premiere seconde avant declanchement de l'effet
	$('#contactez-nous').animate({opacity: 0.4}, 2000);
	
	$('#contactez-nous').animate({opacity: 1.0}, 2000);
	/*** Fin Effet de clignotement du boutton contactez nous ***/
	
	/*** Overlay Contact Plan ***/
	$('.contact-plan a.lightbox_over').overlay({
		is_image:true,
		is_form:false,
		inside_height: '620',
		opacity: '0.6',
		url_bg_image1: '../utiles/images/lightbox_contact/grand_plan.jpg',
		url_bg_image2: '../utiles/images/lightbox_contact/petit_plan.jpg',
		content: '<img src="" width="800" height="620" />'
	});
	/*** Fin Overlay ***/
	
	/*** Overlay Reservation Court Séjour ***/
	$('.contactez-nous a#contactez-nous"').overlay({
		is_image:false,
		is_form:true,
		opacity: '0.6',
		inside_height: '550',
		content: '<center><iframe id="formissima" name="formissima" src="http://formissima.logomotion.fr/forms/makeform.php?idform=42"  height="500" width="500" frameborder="0" scrolling="no" style="margin-top:50px;">Votre navigateur ne supporte pas les iframes</iframe></center>'
	});
	/*** Fin Overlay ***/
});

//Fonction d'effet sur le boutton du header : Contactez-nous !
function contactez_nous(){
	$('#contactez-nous').animate({opacity: 0.4}, 2000);
	
	$('#contactez-nous').animate({opacity: 1.0}, 2000);
}
