jQuery.fn.center = function()
{
   return this.each(function()
   {
		var $self = jQuery(this);
		var width = $self.width();
		var containerWidth = $self.parent().width();
		var offset = (containerWidth-width)/2;
		
		$self.css('margin-left', offset);
   });
};

$(function(){
	
	$(".center").center();
});
