$.fn.center = function()
{
    this.css("position","absolute");
	//Get the window height and width 
	var winH = $(window).height(); 
	var winW = $(window).width(); 
	//Set the popup window to center 
	this.css('top', winH/2-this.height()/2); 
	this.css('left', winW/2-this.width()/2); 
	return this;
};

