(function($) {
	/*$.fn.extend({
		'ixLiensExternes': function(params){
			
			params = $.extend({
				exclude : /^$/
			}, params);
			
			$(this)
			.filter(function() {
				var $this = $(this);
				if ($this.is('a[@href$=\.pdf]')) { return true; }
				if ($this.is("a[@href^=http]") && !$this.attr('href').match(params.exclude)) { return true; }
			})
			.addClass('externe')
			.attr('target', '_blank')
		}
	});*/
})(jQuery);

$(document).ready(function(){
	var $links = $('a');

	window.domainWithoutSubdomain = function(domainWithSubdomain) {
		var matches = domainWithSubdomain.match(DOMAIN_REGEX);
		return matches ? matches[0] : null;
	};

	var links = $links.get(),
		l = links.length;

	while (l--) {
		link = links[l];
		if (!link.className.match(/fancybox/) && !link.href.match(/^(javascript:|mailto:)/) && (domainWithoutSubdomain(link.hostname) != domainWithoutSubdomain(location.hostname) || link.href.match(/\.(docx?|xlsx?|pptx?|pdf|eps|zip|vsd|vxd|rar|wma|mov|avi|wmv|mp3|mp4|mpg|mpeg|mpeg4|m4a|m4v|f4v|flv|csv|xml|ogg|oga|ogv|webm|jpg|jpeg|png|gif|webp|svg|ico|txt|css|js)$/))) {
			link.target = '_blank';
			link.title += link.title ? ' – S’ouvre dans une nouvelle fenêtre.' : 'S’ouvre dans une nouvelle fenêtre.';
			link.className += link.className.indexOf('externe') == -1 ? ' externe' : '';
		}
	}

	$('div#pub ul li a').attr('target','_blank');

	/*$('a').ixLiensExternes({
		exclude : window.location.host
	});*/
	
/* =Menu emplois
   ----------------------------------------------------*/


if ($('.emploi').length > 0) {
	$('ul.emploi li div.description').hide();

	$('ul.emploi li div.titre')

		.mouseover(function(){

				$(this).addClass('hover');

				$(this).bind('mouseleave',
					(function(){
							$(this).removeClass('hover');

					})
				)
		})

		.click(function(){
			$(this).next('div').slideToggle();
		})
}



});

