function lebraun_com_zoomin(element) {
	var img = null;
	var tmp_img = null;
	var loaded = false;
	var clicked = false;
	var duration = null;
	var framerate = null;
	var overTheImage = false;
	
	function __construct() {
		$(element).hover(function() {
			img = null;
			tmp_img = '<img/>';
			loaded = false;
			clicked = false;
			overTheImage = false
		
			$(tmp_img)
			.attr('src', $(this).attr('href'))
			.attr('id', 'img')
			.load(function(){
				loaded = true;
				img = $(this);
				if (clicked) {
					element.click();
				}
			}).hover(function() {
				overTheImage = true;
			}, function() {
				overTheImage = false;
			});
		
		}).click(function(event) {
			event.preventDefault();
			clicked = true;
			
			duration = 750;
			framerate = 10;
			$("#window").css("display",'none');
			$("#window").fadeIn('fast');
			$("#window").click(function() {
				if (!overTheImage) {
					$("#window").fadeOut('fast',function() {
						$("#window").html('');
						$('#window').unbind();
					});
				}
			});
			
			if (loaded) {
				setRunInterval();
			}
		});	
		
		$('body').append('<div id="window"></div>');
		preload_full_images();
	}
	
	function setRunInterval() {
		$('#window').html(img);
		$("#img").width(0);
		$("#img").css("opacity",0);
		
		var zoomDuration = 50;
		duration -= zoomDuration;
		var currentTime = 0;
		var interval = setInterval(function() {
			if (currentTime<=zoomDuration) {
				$("#img").width(easeNone(currentTime,0,500,zoomDuration));
				$("#img").css("opacity",currentTime/zoomDuration);
			} else {
				if (currentTime>duration) { animationComplete(interval); }
				$("#img").width(elasticEaseOut(currentTime,500,200,duration));
			}
			$("img").css("left",($(window).width()-$("#img").width())/2);
			$("img").css("top",($(window).height()-$("#img").height())/2);
			currentTime+=framerate;
		},framerate);
	}
	
	function preload_full_images() {
		var images = new Array();
		var pageReferences = new Array();
		$('a.camera-icon').each(function() {
			pageReferences.push($(this).attr('href'));
		});

		for (var index = 0; index < pageReferences.length; index++) {
			var theImage = pageReferences[index]; // Set the path of the image.
			var tmpImage = new Image(); // Create a new Image element.
			images.push(tmpImage); // Add the Image element to the array.
			$(tmpImage).load();
			tmpImage.src = theImage; // Start loading the image.
		}
	}
	
	function animationComplete(interval) {
		clearInterval(interval);
	}
	
	function easeNone(t, b, c, d) {
		return c * t / d + b;
	}
	
	function elasticEaseOut(t, b, c, d, a, p) {
		var s;
		if (t == 0) { return b; }
		if ((t /= d) == 1) { return b + c; }
		if (!p) { p = d * .4; }
		if (!a || a < Math.abs(c)) {
			a = c; s = p / 4;
		} else {
			s = p / (2 * Math.PI) * Math.asin(c / a);
		} return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
	}
	__construct();
}
