
$(window).resize(function(){ 
	$('#wrapper').center();
});
$(document).ready(function() {
	$('#wrapper').center();
});

$.fn.center = function ($arg) {
	var add = 0;
	if($.browser.msie){
		add = -60;
	}
		
	this.css("position","absolute");
	var newtop = ( $(window).height() - this.height() ) / 2+$(window).scrollTop();
	newtop += add;
	var newleft = ( $(window).width() - this.width() ) / 2+$(window).scrollLeft();
	this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
	this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
	//this.stop().animate({top:newtop+'px', left:newleft+'px'});
	return this;
}
