jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
    this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
    return this;
}
$(function(){
	/*var advert = $("<div></div>").addClass('advert').css({'background-color':'#fff','border':'1px solid #ccc','display':'none','width':'500px','height':'200px','position':'absolute','z-index':'10'});
	var shadow = $("<div></div>").addClass('advert').css({'background-color':'#000','opacity':'0.5','filter':'alpha(opacity=50)','display':'none','width':'100%','height':'100%','left':'0','bottom':'0','position':'absolute','z-index':'9'});
	var timeout = setTimeout(function(){
		$('body').append(advert).append(shadow);
		$(advert).center().load('advert.html', function(){$(this).fadeIn('slow')});
		$(shadow).fadeIn('slow');
	},3000);*/
});