/**
 * jQuery gpImage plugin
 *
 */ 

;(function($) {
  
  $.gpImage = function(options) {
  
  	var opts = $.extend({}, $.gpImage.defaults, options);
  	return $(opts.target).each(function() {
  		var $this = $(this);
  		
  		$this.children('img').each(function() {
  			$img = $(this);
  			var alignClass = $img.attr('align');
  			$this.addClass(alignClass);
  			$img.removeAttr('align');
  		});
  		
  	});
  };
  
	$.gpImage.defaults = {
		target: '.gp_image'
	};

})(jQuery);

/**
 * Executing the plugin
 * The default targetclass can be overrided by using the following code before running the plugin:
 * 
 * $.gpImage.defaults.target = 'your_choice';
 * $.gpImage();
 * 
 */
 
jQuery(function($) {
	$.gpImage();
});