
/* Ajuste la hauteur la taille d'lments HTML selon l'lment le plus haut
--------------------------------------------------------------------------------------- */
function equal_height(id) 
{
	tallest = 0;
	$(id).each(function () {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	$(id).height(tallest);
	
};

/* Ouvre les liens avec "rel=external" dans une nouvelle fentre
--------------------------------------------------------------------------------------- */
function external_link()
{
	$('A[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
}

/* Anti-Spam Mailto
URL : http://www.kevinleary.net/jquery-mailto-links-plugin-version-11/
--------------------------------------------------------------------------------------- */
jQuery.fn.mailto = function() {
	return this.each(function(){
		var email = $(this).html().replace(/\s*\(.+\)\s*/, "@");
		$(this).before('<a href="mailto:' + email + '" rel="nofollow" title="Email ' + email + '">' + email + '</a>').remove();
	});
};

/* JS Ready
--------------------------------------------------------------------------------------- */
$(document).ready(function()
{
	/* Open Window Link */
	external_link();
	
	/* Anti-Spam Mailto Call */
	if ($('a.email').length > 0) { $('a.email').mailto(); }

	/* Fix equal Height */
	
		/* Home Page */
		if ($('.jq_bloc_home').length > 0) { equal_height('.jq_bloc_home'); }
		
		/* Ethics Council */
		if ($('.jq_equal_membres').length > 0) { equal_height('.jq_equal_membres'); }
		if ($('.jq_equal_membres_no_title').length > 0) { equal_height('.jq_equal_membres_no_title'); }
	
	 /* Lightbox */ 
	 if ($('a.group').length > 0) { $('a.group').fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true }); }
	
});