
jQuery(document).ready(function() { 
(function ($) {
	$.fn.center = function() {
//		return this.each(function() {

			var width  = this.width();
			var height = this.height();
        
            var scrollTop = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
            var scrollLeft = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
                
			var left = ($(window).width()/2 + scrollLeft) - width/2;
			var top  = ($(window).height()/2 + scrollTop) - height/2;

			this.css({top: top + 'px', left: left + 'px', position: 'absolute'});
	
			return this;
//		});
	};

}) (jQuery);
});
