// JavaScript Document
(function($) { 
	$.fn.lien_rapports = function(options) {
		// Ajoute l'hyperlien au thumbnail par rapport au premier lien qui le suit
		$(".l-thumb-link").each(function(e) {
			if($(this).attr("src")) {
				tmpLink = $(this).next().find("a:first").attr("href");
				tmpTarget = $(this).next().find("a:first").attr("target");
				$(this).wrap("<a></a>");	
				$(this).parent().attr({
					href: tmpLink,
					target: tmpTarget
				});
			
				$(this).parent().hover(
					function() {
						$(this).next().find("a:first").addClass("l-link-on");
					},
					function() {
						$(this).next().find("a:first").removeClass("l-link-on");
					}
				);
			}
		});
	}
})(jQuery);