
$.fn.okImageCaption = function(options) {
	options = $.extend($.fn.okImageCaption.defaultOptions, options);
	
	this.each(function(i, e) {
		var $this   = $(this);
		var $image  = $this.find('img');
		var content = '';
		
		$image.remove();
		content = $this.html();
		$this.html('');
		$image.appendTo($this);
		
		var $caption = $('<div class="image-caption-desc" />')
						.css({ display: 'none' })
						.appendTo($this);
		
		var $content = $('<div class="image-caption-desc-content" />')
						.html(content)
						.appendTo($caption);
		
		$this.hover(
			function(e) {
				$caption.stop().animate({ height: $image.height() * options.height }, {
					duration: options.duration[0],
					easing:   options.easing[0]
				});
			},
			function(e) {
				$caption.stop().animate({ height: 0 }, {
					duration: options.duration[options.duration.length - 1],
					easing:   options.easing[options.easing.length - 1]
				});
			}
		);
	});
	
};

$.fn.okImageCaption.defaultOptions = {
	height:   0.5,
	duration: [ 350, 350 ],
	easing:   [ 'linear', 'linear' ]
};
