
	
		$(function(){
		
			$("#about-button").css({
				opacity: 0.3
			});
			$("#contact-button").css({
				opacity: 0.3
			});
$("#espace-button").css({
				opacity: 0.3
			});
		
            $("#page-wrap div.button").click(function(){
            	
            	$clicked = $(this);
            	
            	// if the button is not already "transformed" AND is not animated
            	if ($clicked.css("opacity") != "1" && $clicked.is(":not(animated)")) {
            		
            		$clicked.animate({
            			opacity: 1,
            			borderWidth: 5
            		}, 600 );
            		
            		// each button div MUST have a "xx-button" and the target div must have an id "xx" 
            		var idToLoad = $clicked.attr("id").split('-');
            		
            		//we search trough the content for the visible div and we fade it out
            		$("#content").find("div:visible").fadeOut("fast", function(){
            			//once the fade out is completed, we start to fade in the right div
            			$(this).parent().find("#"+idToLoad[0]).fadeIn();
            		})
            	}
            	
            	//we reset the other buttons to default style
            	$clicked.siblings(".button").animate({
            		opacity: 0.5,
            		borderWidth: 1
            	}, 600 );
            	
            });
		});
$(document).ready(function()
{

				
$("body").removeClass("accessibility");


var divdata = null;
var selecteurencours = null;
$(".liste_descriptifs li").hide();
$(".liste_descriptifs li:first").show();
$(".liste_liens a:first").addClass("img-shadow");

 $("a").filter("[id^=site]").hover(function()

         {	
		if (selecteurencours== null) 
		{
		$(".liste_descriptifs li:first").hide();
		$(".liste_liens a:first").removeClass("img-shadow");
		}
		var monId2 = '.data'+$(this).attr("id");
		if (monId2 == selecteurencours)
		{
		return false;
		}
		if (divdata != null) 
		{
		imageencours.removeClass("img-shadow");
		divdata.hide();
		}
		selecteurencours=monId2;
		divdata=$(monId2);
		divdata.show();
		$(this).addClass("img-shadow");
		imageencours=$(this);
		return false;
		
		});

$(".iframe").colorbox({width:"80%", height:"80%", iframe:true});			
});
		

			$(function(){

				// Accordion
				$("#accordion").accordion({ header: "h3" });
	
				// Tabs
				$('#tabs').tabs();
	

				// Dialog			
				$('#dialog').dialog({
					autoOpen: false,
					width: 600,
					buttons: {
						"Ok": function() { 
							$(this).dialog("close"); 
						}, 
						"Cancel": function() { 
							$(this).dialog("close"); 
						} 
					}
				});
				
				// Dialog Link
				$('#dialog_link').click(function(){
					$('#dialog').dialog('open');
					return false;
				});

				// Datepicker
				$('#datepicker').datepicker({
					inline: true
				});
				
				// Slider
				$('#slider').slider({
					range: true,
					values: [17, 67]
				});
				
				// Progressbar
				$("#progressbar").progressbar({
					value: 20 
				});
				
				//hover states on the static widgets
				$('#dialog_link, ul#icons li').hover(
					function() { $(this).addClass('ui-state-hover'); }, 
					function() { $(this).removeClass('ui-state-hover'); }
				);
				
			});
