(function($) {
	$.fn.targetContainer = function(target){
		$(this).each(function(){
			$(this).children('li').children('a')[($.fn.hoverIntent) ? 'hoverIntent' : 'hover' ](function() {
				_a = $(this);
				_thumb = $(this).children('img');
				var _src = _a.attr('href');
				_title = _thumb.attr('title');
				var _target = $(target + ' img, p');
				$(_thumb).attr("title",'');
				if ($(_target).attr("src") != _src) {
					var _img = new Image();
					$(_img).load(function(){
						$(_target).stop();
						$(this).hide();
						$(_target).fadeOut(1000);
						$(_target).remove();
						var _caption = "<p class='caption'>" + _title + "</p>";
						$(_caption).hide();
						$(target).append(this).append(_caption);
						$(this).fadeIn(1000);
						$(_caption).fadeIn(1000);
					}).attr({
						src: _src,
						title: '',
						alt: _title
					});
					$(this).click(function(){
						return false; 
					});
				} else {
					$(this).click(function(){
						return false; 
					});
				}
			},
				function() {
				$(_thumb).attr("title",_title);
				return;
			});
		});
	};
})(jQuery);