(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('.ic_caption').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');
			$('.ic_caption',$this).css({'color':'#4C4847','background-color':'rgba(255,255,255,0.5)','position':'absolute','top':'52px','left':'10px','width':'186px','height':'65px'});
			$('.overlay',$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)
					$('.overlays',$(this)).show();
					else
					$('.overlays',$(this)).fadeIn();
					if(!o.showcaption)
						$(this).find('.ic_caption').fadeIn(700);
					else
						$('.ic_text',$(this)).fadeIn(700);
				},
				function () {
					if((navigator.appVersion).indexOf('MSIE 7.0') > 0)
					$('.overlays',$(this)).hide();
					else
					$('.overlays',$(this)).fadeOut();
					if(!o.showcaption)
						$(this).find('.ic_caption').fadeOut(700);
					else
						$('.ic_text',$(this)).fadeOut(700);
				}
			);
		});
	};
	$.fn.capslide.defaults = {
		caption_color	: 'white',
		caption_bgcolor	: 'black',
		overlay_bgcolor : 'blue',
		border			: '1px solid #fff',
		showcaption	    : true
	};
})(jQuery);

