(function($) {
	$.fn.capslide = function(options) {
		var opts = $.extend({}, $.fn.capslide.defaults, options);
		return this.each(function() {
			$this = $(this);
			var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
			
			if(!o.showcaption)	$this.find(o.capitulo).css('display','none');
			else $this.find('.ic_text').css('display','none');
				
			var _img = $this.find('img:first');
			var w = _img.css('width');
			var h = _img.css('height');
			$(o.capitulo,$this).css({'color':o.caption_color,'background-color':o.caption_bgcolor,'bottom':'0px','width':w});
			$(o.fundo,$this).css('background-color',o.overlay_bgcolor);
			$this.css({'width':w , 'height':h, 'border':o.border});
			$this.hover(
				function () {
					if((navigator.appVersion).indexOf('MSIE 7.0') > 0)
					$(o.fundo,$(this)).show();
					else
					$(o.fundo,$(this)).fadeIn();
					if(!o.showcaption)
						$(this).find(o.capitulo).slideDown(500);
					else
						$('.ic_text',$(this)).slideDown(500);	
				},
				function () {
					if((navigator.appVersion).indexOf('MSIE 7.0') > 0)
					$(o.fundo,$(this)).hide();
					else
					$(o.fundo,$(this)).fadeOut();
					if(!o.showcaption)
						$(this).find(o.capitulo).slideUp(200);
					else
						$('.ic_text',$(this)).slideUp(200);
				}
			);
		});
	};
	$.fn.capslide.defaults = {
		caption_color	: 'white',
		caption_bgcolor	: 'black',
		overlay_bgcolor : 'blue',
		border			: '1px solid #fff',
		capitulo		: '.ic_caption_left',
		fundo			: '.overlay_left',
		showcaption	    : true
	};
})(jQuery);
