 /*
 * Image Centering
 * Copyright 2009 Piotr Wesołowski
 * www.dickiebirds.com
 *
 * Version 1.0
 *
 * This Image Centering jQuery plug-in is dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

(function($){
	$.fn.imgCenter = function(options) {

		var defaults = { 
			height: 100
	  	};  
	 	var opts = $.extend(defaults, options);
		var imgHeight = 0;
		var margin = 0;
		
		return this.each(function(i){
			var current = i;
			
			// Declare the current Image as a variable.
			var org_image = $(this);
			
			imgHeight = org_image.height();
			
			margin = Math.round((opts.height - imgHeight)/2);
			
			org_image.css("margin-top",margin+"px");
		});		
	}
})(jQuery);  
