$(document).ready(function(){

	/* 
	 |
	 | JS POUR TRANSFORMER NOS IMAGES EN VIDEO YOUTUBE, DAILYMOTION OU AUTRE SWF LISABLE SANS PLAYER FLV
	 |
	 */
	
	// Ajout du rollover sur les images
	$(".rollover img").hover(
			function()
			{
				this.src = this.src.replace("-off","-on");
			},
		function()
		{
			this.src = this.src.replace("-on","-off");
		}
	);
	
	$("img.youtube").flash(
		  { },   
  		  { version: 8 },
  		  function(htmlOptions) {
  		  	$this = $(this);
  		  	
  		  	var LinkOfVideo = $this.attr('alt');
  		  	
  		  	if( LinkOfVideo.search("dailymotion") != -1  ){
		  		
		  		if( LinkOfVideo.search("related=0") == -1 )
		  			LinkOfVideo += "&amp;related=0";
		  		
		  		LinkOfVideo = LinkOfVideo.replace(/dailymotion.com\/video/,"dailymotion.com\/swf");
		  	}
  		  	else if( LinkOfVideo.search("youtube") != -1  ){

  		  		if( LinkOfVideo.search("watch?v=") ){
  		  			
  		  			LinkOfVideo += "&amp;hl=fr&amp;fs=1&amp;";
  		  			LinkOfVideo = LinkOfVideo.replace(/watch\?v=/,"v/");
  		  		}
  		  		
  		  	}
  		  	
  		  	htmlOptions.src    = LinkOfVideo;
  		  	
  		  	if( $this.css("width") != 'auto' )
  		  		htmlOptions.width  = $this.css("width");
  		  	
  		  	else
  		  		htmlOptions.width  = "320";
  		  	
  		  	if( $this.css("height") != 'auto' )
  		  		htmlOptions.height = $this.css("height");
		  	
		  	else
		  		htmlOptions.height  = "240";
  		  	
  		  	
  		  	$this.before($.fn.flash.transform(htmlOptions));
  		  	$this.remove();
  		  });


	
	/* 
	 |
	 | TOUTE IMAGE POINTANT VIA UN LIEN SUR UNE IMAGE SERA ZOOMER AUTOMATIQUEMENT
	 |
	 */

	$("a.none").zoomimage({
		controls:0,
		caption:0
	});
	
	$("a.fromsakka").zoomimage({
		controls:0,
		caption:0
	});
	
	$("a").zoomimage({
		controls:0,
		caption:0
	});
	
});

