$(document).ready(function(){
	$(".menu a").mouseout(function(){
		$("span", $(this)).removeClass("hot");
	});
	//$(".shadow, .slider, .boxes li, .tagline, .informations img, .footer, .title_1, .title_3 img, h4 img, .title_2 img, .le_spa dt, .calendar, .calendar_title, .calendar_footer img, .team dt img, .date img, div.image, div.image_2, .window .window_bg, .window .window_bg_b, .window .close").pngfix();
	$(".jqmWindow").jqm({
		onShow: function(hash){
			$(".jqmWindow").fadeIn().jqmShow();
		},
		onHide: function(hash){
			$(".jqmWindow").fadeOut().jqmHide();
			$(".jqmOverlay").remove();
		}
	});
	$(".team dd p a").click(function(){
		var team= $(this).attr('id');	
		var idTeam='#id_team'+team;
		var win_y = $(window).height();  
  		var scroll_y = $(window).scrollTop()+200;  
	   var jqmWindow=".jqmWindow"+team;
	
		$("div"+idTeam).css("position", "absolute");
		$("div.window").css("top", scroll_y+"px");
  	 
		$(idTeam).jqm({modal:true}).jqmShow().jqmAddClose('#close'+team);

		return false;

	});

	$(".calendar_2 li").click(function() {
		if ($("font", this).size() < 1) return false;
		var cid = $("font", this).attr("cid");
		$(".win_calendar").attr("cid", cid);
		$(".popup_window").jqmShow();
	});
	
	$(".win_calendar").jqm({
		onShow: function(hash){
		
			$.get("/groups/get/" + $(".win_calendar").attr("cid"), function(ret) {
				$(".win_calendar .popup_window_content").html(ret);
				$(".jqmWindow").fadeIn().jqmShow();
			});
			
		},
		onHide: function(hash){
			$(".jqmWindow").fadeOut().jqmHide();
			$(".jqmOverlay").remove();
		}
	});
	// print Group 
	$(".printfriendly").click(function(){

		$('#printWindow').attr('src', '/groups/printfriendly');
		$(".jqmWindow1").jqmShow();

		return false;
	});
	$(".jqmWindow1").jqm({
		onShow: function(hash){
			$(".jqmWindow1").fadeIn().jqmShow();
		},
		onHide: function(hash){
			$(".jqmWindow1").fadeOut().jqmHide();
			$(".jqmOverlay").remove();
		}
	});
//Jamal
	$(".jqmWindow2").jqm({
		onShow: function(hash){
			$(".jqmWindow2").fadeIn().jqmShow();
		},
		onHide: function(hash){
			$(".jqmWindow2").fadeOut().jqmHide();
			$(".jqmOverlay").remove();
		}
	});
	$(".jqmWindow3").jqm({
		onShow: function(hash){
			$(".jqmWindow3").fadeIn().jqmShow();
		},
		onHide: function(hash){
			$(".jqmWindow3").fadeOut().jqmHide();
			$(".jqmOverlay").remove();
		}
	});
	$(".jqmWindow4").jqm({
		onShow: function(hash){
			$(".jqmWindow4").fadeIn().jqmShow();
		},
		onHide: function(hash){
			$(".jqmWindow4").fadeOut().jqmHide();
			$(".jqmOverlay").remove();
		}
	});
        $(".jqmWindow5").jqm({
		onShow: function(hash){
			$(".jqmWindow5").fadeIn().jqmShow();
		},
		onHide: function(hash){
			$(".jqmWindow5").fadeOut().jqmHide();
			$(".jqmOverlay").remove();
		}
	});
         $(".jqmWindow6").jqm({
		onShow: function(hash){
			$(".jqmWindow6").fadeIn().jqmShow();
		},
		onHide: function(hash){
			$(".jqmWindow6").fadeOut().jqmHide();
			$(".jqmOverlay").remove();
		}
	});
        $(".jqmWindow7").jqm({
                        onShow: function(hash){
                                $(".jqmWindow7").fadeIn().jqmShow();
                        },
                        onHide: function(hash){
                                $(".jqmWindow7").fadeOut().jqmHide();
                                $(".jqmOverlay").remove();
                        }
                });
        
	

// Filter equipe administration 
	$("#administration").click(function(){
	  $("span#administration").css("color","#badb81");
	  $("span#allequipe").css("color","#FFF");
	  $("span#massage").css("color","#FFF");
	  $("span#other").css("color","#FFF");
	  $("dt").each(function(){
			var id= $(this).attr('id');	
   			if(id=="massage" || id=="other" ) $(this).css("display","none");
			else  $(this).css("display","block");
 		});
	 $("dd").each(function(){
			var id= $(this).attr('id');	
   			if(id=="massage" || id=="other" ) $(this).css("display","none");
			else  $(this).css("display","block");
 		});

		return false;
	});
	$("#allequipe").click(function(){
	  $("span#administration").css("color","#FFF");
	  $("span#massage").css("color","#FFF");
	  $("span#other").css("color","#FFF");
	  $("span#allequipe").css("color","#badb81");
		$("dt").each(function(){
			var id= $(this).attr('id');	
   			if(id=="massage" || id=="other" || id=="admin") $(this).css("display","block");
 		});
	 $("dd").each(function(){
			var id= $(this).attr('id');	
   			if(id=="massage" || id=="other" || id=="admin") $(this).css("display","block");
 		});

		return false;
	});
	
	$("#massage").click(function(){
	  $("span#administration").css("color","#FFF");
	  $("span#allequipe").css("color","#FFF");
	  $("span#massage").css("color","#badb81");
	  $("span#other").css("color","#FFF");
	$("dt").each(function(){
			var id= $(this).attr('id');	
   			if(id=="admin" || id=="other") $(this).css("display","none");
			else  $(this).css("display","block");
 		});
	 $("dd").each(function(){
			var id= $(this).attr('id');	
   			if(id=="admin" || id=="other" ) $(this).css("display","none");
			else  $(this).css("display","block");
 		});

		return false;
	});
	$("#other").click(function(){
	  $("span#administration").css("color","#FFF");
	  $("span#allequipe").css("color","#FFF");
	  $("span#massage").css("color","#FFF");
	  $("span#other").css("color","#badb81");
		$("dt").each(function(){
			var id= $(this).attr('id');	
   			if(id=="massage" || id=="admin") $(this).css("display","none");
			else  $(this).css("display","block");
 		});
	 $("dd").each(function(){
			var id= $(this).attr('id');	
   			if(id=="massage" || id=="admin" ) $(this).css("display","none");
			else  $(this).css("display","block");
 		});

		return false;
	});
	$("#showprice").click(function(){

		$(".jqmWindow").jqmShow();

		return false;
	});


	
});
