
  $(document).ready(function () {

	  $("a[href^=http://]").not("a[href^=http://www.savoirfer.fr]").attr("target", "blank");  
	  $("a[href^=http://]").not("a[href^=http://www.savoirfer.fr]").attr("rel", "external");

    $(".scrollable").scrollable().navigator();  

    $(".yoxview").yoxview({
      onClose: function(){
          $("#swf").show();
      },
      onOpen: function(){
          $("#swf").hide();
      }
    });
  
  $(function() {

$(".diapo").scrollable().navigator();


$("#realisations-vues-box img").click(function() {

	// see if same thumb is being clicked
	if ($(this).hasClass("active")) { return; }
  
	if ($(this).hasClass("video")) { 
    $("#image_wrap").load("realisations/video.htm");
    return;
  }

	// calclulate large image's URL based on the thumbnail URL (flickr specific)
	var url = $(this).attr("src").replace("_t", "");

	// get handle to element that wraps the image and make it semi-transparent
	var wrap = $("#image_wrap").fadeTo("medium", 0.1);

	// the large image from www.flickr.com
	var img = new Image();


	// call this function after it's loaded
	img.onload = function() {

		// make wrapper fully visible
		wrap.fadeTo("fast", 1);

    
		if(wrap.find("img").length == 0) {
      wrap.html('<img src="images/blank.gif" />');
    }
    
		wrap.find("img").attr("src", url);

	};

	// begin loading the image from www.flickr.com
	img.src = url;

	// activate item
	$(".items img").removeClass("active");
	$(this).addClass("active");

// when page loads simulate a "click" on the first image
});
});
  
  //  $('.opacity').css({opacity: 0.6});
  //  $('.opacity').hover(
  //  function () {
  //    $(this).stop().animate({opacity: 1});
  //  }, 
  //  function () {
  //    $(this).stop().animate({opacity: 0.6});
  //  });
  
  });
  

