(function($) {
/* ***************** */

jQuery.fn.reAlign = function(options) 
{
	options = jQuery.extend({
		h:true, // boolean
		v:true // boolean
	}, options);

	var org = {};

	$(this).css({'position':'absolute'});
	org.left = $(this).css('left');
	org.top = $(this).css('top');

	$(this).css({'left':0,'top':0})
	var offset = $(this).offset();

	$(this).css({'left':org.left,'top':org.top});
	

	if(options.v==true)
	{
		$(this).css({
			'position':'absolute',
			'top':Math.round(($(window).height()-$(this).height())/2)-offset.top
		});
	}
	
	if(options.h==true)
	{
		$(this).css({
			'position':'absolute',
			'left':Math.round(($(window).width()-$(this).width())/2)-offset.left
		});
	}
}

/* ***************** */
})(jQuery);