// JavaScript Document

$(document).ready(function(){
	
	if(document.getElementById('header')){
		$('#header').load(function() {
			$("#header").fadeIn("slow");	
		});
	}
	
	$("#promotion").fadeIn(2000);
  
  $('#clubs').change(function() {
  	if($(this).val()!=0){
  		club = $(this).val();
 			$.ajax({
				url: "list-cours.php?club_id="+club,
				async:false,
				success:function(html){
					$("#list-cours").html(html).show();
				},
				error:function(XMLHttpRequest,textStatus, errorThrown){
					afficher("erreur lors du chargement de la page");
				}
			});
		} else {
			$(location).attr("href", "http://www.harmony.ch/cours-fitness/cours-fitness-collectifs.php");
		}
	});
	
		
	jQuery(function($){
	
	var openFx = function(){
			
	};openFx();
	
	var openFxInf = function(){
				$("#panorama").center();
		$("#infoBox").center();
		$("#info3D").center();
		$("#infoBox").fadeIn();
		$(".masque").fadeIn();
	};
	
	var openFx3D = function(){
		$("#info3D").fadeIn();
		$(".masque").fadeIn();
	};
	

	
	$("#open").click(openFx);
	$("#openInfo").click(openFxInf);
	$("#open3D").click(openFx3D);
	
	$(".masque, .fermerBox").click(function(){
		$("#diaporama").fadeOut();
		$(".masque").fadeOut();
		$("#infoBox").fadeOut();
		$("#info3D").fadeOut();
	});

	jQuery.fn.center = function () {
	  	this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px");
    	this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
	    return this;
	}
	
		$("#panorama").center();
		$("#infoBox").center();
		$("#info3D").center();
	
});

//Fonction Background plein ecran


});



