﻿jQuery.fn.center = function(offsetTop, offsetLeft) {
	if (!offsetTop) offsetTop = 0;
	if (!offsetLeft) offsetLeft = 0;
	this.css("position", "absolute");
	this.css("top", (($(window).height() - this.height()) / 2 + $(window).scrollTop()) + offsetTop + "px");
	this.css("left", (($(window).width() - this.width()) / 2 + $(window).scrollLeft()) + offsetLeft + "px");
	return this;
}
