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