$.fn.center = function() {
	return this.each(function(i) {
		var $el = $(this);
		var $win = $(window);
		
		var scrollLeft = $win.scrollLeft();
		var scrollTop = $win.scrollTop();
		
		$el.css("position", "absolute");
		
		$el.css({
			left: Math.round(($win.width() - $el.outerWidth()) / 2) + scrollLeft,
			top: Math.round(($win.height() - $el.outerHeight()) / 2) + scrollTop
		});
	});
}