jQuery.fn.extend({
	showDialog: function(title, text){
		if(text == '[object Object]'){
			text = $(text).html();
		}
		
		$("<div id='splash_screen'></div>")
			.prependTo("body")
			.css({
					width:"100%",
					height:$(document).height(), 
					position:"absolute",
					left: "0",
					top: "0",
					opacity: "0",
					background: "#000000",
					zIndex: "1000"
				})
			.fadeTo("slow",0.5);
		$("body").prepend("<div id='popup'></div>");
		$("div#popup")
			.css({
					position:"absolute",
					minHeight:"47px",
					zIndex:"1001",
					fontSize:"1.2em",
					border:"1px solid #eee",
					opacity:"1",
					top: 50,
					left: ($("body").width()/2 - ($("div#popup").width()/2) )
				});
		$("div#popup").html("<div class='popup_close_div' align='right'><span class='popup_title'>"+title+"</span><a class='popup_close' href='javascript:void(0)'>X</a></div><div class='text'></div>");
		$("div#popup div.text").html(text)
		$("div#popup").css("top", $("body").height()/2 - ($("div#popup").height()/2) );
		$("div#popup a.popup_close")
			.click(function(){
				$("div#popup").fadeOut(200,function(){
					$("div#splash_screen").fadeTo(500,0,function(){
						$("div#splash_screen").remove();
					})
				})
				
			});
	}
});