(function($) {
	
	$.fn.sebUniqueSlider = function(params) {
		var $this = $(this);
		$this.mouseenter($this.sebUniqueSlider.showPopup);
		$this.mouseleave($this.sebUniqueSlider.hidePopup);
		
		$('#unique-popup').mouseenter($this.sebUniqueSlider.keepPopup);
		$('#unique-popup').mouseleave($this.sebUniqueSlider.hidePopupFromPopup);
	};
	
	$.fn.sebUniqueSlider.showPopup = function(event) {
		
		var $this = $(this);
		$this.find("p.content").addClass('red');
		$this.find("span.arrow").removeClass('display-none');
		$('#unique-popup').removeClass('display-none');
		
		return false;
	};
	
	$.fn.sebUniqueSlider.hidePopup = function(event) {
		
		var $this = $(this);
		$this.find("p.content").removeClass('red');
		$this.find("span.arrow").addClass('display-none');
		$('#unique-popup').addClass('display-none');
		
		return false;
	};
	
	$.fn.sebUniqueSlider.keepPopup = function(event) {
		
		var $this = $(this);
		$this.removeClass('display-none');
		
		var item = $("#unique-temoin");
		item.find("p.content").addClass('red');
		item.find("span.arrow").removeClass('display-none');
		
		return false;
	};
	
	$.fn.sebUniqueSlider.hidePopupFromPopup = function(event) {
		
		var $this = $(this);
		$this.addClass('display-none');
		
		var item = $("#unique-temoin");
		item.find("p.content").removeClass('red');
		item.find("span.arrow").addClass('display-none');
		
		return false;
	};
	
})(jQuery);
