(function($){
					$.fn.jqCenter = function(options) {
						var opts = $.extend({}, $.fn.jqCenter.defaults, options);
						return this.each( function() {
							var center = function(centerMe) {
								if(opts.dimensions == 'vertical' || opts.dimensions == 'both')
								{
									var tHeight = (opts.centerIn == document.body || opts.centerIn == window) ? $(window).height() : $(opts.centerIn).outerHeight();
									pTop = 	((tHeight - $(centerMe).outerHeight()) > 0) ? 
										((tHeight - $(centerMe).outerHeight()) / 2) + 'px' :
										'0px';
									if(opts.animation == 'fade')
									{
										$(centerMe).css({position:'absolute',opacity:0,display:'block'}).css({top:pTop}).animate({opacity:1}, 1500);
									}else if(opts.animation == 'position'){
										$(centerMe).css({position:'absolute'}).animate({top:pTop}, 800);
									}else{
										$(centerMe).css({position:'absolute',top:pTop});
									}
								}
								if(opts.dimensions == 'horizontal' || opts.dimensions == 'both')
								{
									pLeft = (($(opts.centerIn).width() - $(centerMe).width()) > 0) ? 
										(($(opts.centerIn).width() - $(centerMe).width()) / 2) + 'px' :
										'0px';
									if(opts.animation == 'none')
									{
										$(centerMe).css({position:'absolute',left:pLeft});
									}else{
										$(centerMe).css({position:'absolute'}).animate({left:pLeft}, 800);
									}
								}
								opts.animation = 'position';
							}
							var obj = this;
							$(opts.centerIn).bind('resize' + opts.namespace, function() {
								center(obj);
							})
							center(this);
						});
					}
					
					$.fn.jqCenter.defaults = {
						dimensions : 'vertical',
						namespace : '.default',
						animation : 'position',
						centerIn : window
					}
					
			})(jQuery);
