(function($){ 
     $.fn.extend({  
         alignCenter: function() { 
              
            return this.each(function(){ 
         
                //Creating a reference to the object 
                var obj			= $(this);
				var browser		= $(window);
				
				//Align Object to Center
				function alignObject(){
					if(((browser.height() - obj.height()) / 2) > 0){
						objPosY = ((browser.height() - obj.height()) / 2);	
					} else {
						objPosY = 0;
					}
					
					if(((browser.width() - obj.width()) / 2) > 0){
						objPosX = ((browser.width() - obj.width()) / 2);	
					} else {
						objPosX = 0;
					}
					
					obj.css({
							'position': 'absolute',
							'top': objPosY,
							'left': objPosX
							});
				}
				
				//Move Object On Resize
				browser.resize(function(){
					alignObject();
				});
				
				alignObject();
                 
            }); 
        } 
    }); 
})(jQuery); 