$.fn.wrapimg = function(options){
	
	var options = $.extend({
		showAlt: true,
		showTitle:true   
	}, options);

	return this.each(function() {
		
		var title = $(this).attr('title');
		var alt = $(this).attr('alt');
		
		var align = $(this).attr('align');
		var w = $(this).attr('width');
		var h = $(this).attr('h');
								
		$(this).removeAttr('align').wrap('<div/>').parent().addClass('wrap-img').css({'width': w, 'height': h, 'float': (align ? align : 'none'), 'marginLeft': (align == 'left' ? '0' : '15px'), 'marginRight': (align == 'left' ? '15px' : '0')}).append('<span class="img-title">' + title + '</span><span class="img-alt">' + alt + '</span>');	
								 
	});


	
}

