// JavaScript Document
$(document).ready(function() {

	//move the image in pixel
	var move = -6;
	
	//zoom percentage, 1.2 =120%
	var zoom = 1.1;
////////////////////////////////////////////////////////// -- client logos -- ///////////////////////////////////////////////////
	//On mouse over those thumbnail
	$('.client-logo').hover(function() {
		
		//Set the width and height according to the zoom percentage
		width = $('.client-logo,').width() * zoom;
		height = $('.client-logo').height() * zoom;
		
		//Move and zoom the image
		$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200});
		

	},
	function() {
		//Reset the image
		$(this).find('img').stop(false,true).animate({'width':$('.client-logo').width(), 'height':$('.client-logo').height(), 'top':'0', 'left':'0'}, {duration:100});	

	});
	
	
////////////////////////////////////////////////////////// -- finest moments big -- ///////////////////////////////////////////////////

	//move the image in pixel
	var bigMove = -10;
	
	//On mouse over those thumbnail
	$('.fm-image-big').hover(function() {
	
		//Set the width and height according to the zoom percentage
		width = $('.fm-image-big').width() * zoom;
		height = $('.fm-image-big').height() * zoom;
		
		//Move and zoom the image
		$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':bigMove, 'left':bigMove}, {duration:200});
		
		//Display the caption
		$(this).find('div.caption').stop(false,true).fadeIn(200);
	},
	function() {
	
		//Hide the caption
		$(this).find('div.caption').stop(false,true).fadeOut(200);
		
		//Reset the image
		$(this).find('img').stop(false,true).animate({'width':$('.fm-image-big').width(), 'height':$('.fm-image-big').height(), 'top':'0', 'left':'0'}, {duration:100});	
	});
	
////////////////////////////////////////////////////////// -- finest moments small -- ///////////////////////////////////////////////////	
	
	//On mouse over those thumbnail
	$('.fm-image-small').hover(function() {
	
		//Set the width and height according to the zoom percentage
		width = $('.fm-image-small').width() * zoom;
		height = $('.fm-image-small').height() * zoom;
		
		//Move and zoom the image
		$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200});
		
		//Display the caption
		$(this).find('div.caption').stop(false,true).fadeIn(200);
	},
	function() {
	
		//Hide the caption
		$(this).find('div.caption').stop(false,true).fadeOut(200);
		
		//Reset the image
		$(this).find('img').stop(false,true).animate({'width':$('.fm-image-small').width(), 'height':$('.fm-image-small').height(), 'top':'0', 'left':'0'}, {duration:100});	
	});

////////////////////////////////////////////////////////// -- flickr thumbs -- ///////////////////////////////////////////////////

	//move the image in pixel
	var flmove = -3;
	
	//On mouse over those thumbnail
	$('.flickrlist').hover(function() {
	
		//Set the width and height according to the zoom percentage
		width = $('.flickrlist').width() * zoom;
		height = $('.flickrlist').height() * zoom;
		
		//Move and zoom the image
		$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':flmove, 'left':flmove}, {duration:200});

	},
	function() {

		
		//Reset the image
		$(this).find('img').stop(false,true).animate({'width':$('.flickrlist').width(), 'height':$('.flickrlist').height(), 'top':'0', 'left':'0'}, {duration:100});	
	});

});

