document.write("<div style='position:absolute;background-color:#000000;z-index:1000;top:0px;left:0px;filter:alpha(opacity=60);display:none;' id='ShadowDiv'></div>");
var WindowHeight=null;
function showDiv(name,fn)
{
	var MsgWindowName = "#" + name;
	var MsgWindowWidth = $(MsgWindowName).width();
	var MsgWindowHeight = $(MsgWindowName).height();
	if(WindowHeight==null)
	{
		WindowHeight=MsgWindowHeight;
	}
	if(WindowHeight!=null && WindowHeight<MsgWindowHeight)
	{
		MsgWindowHeight=WindowHeight;
	}
	var PositionWidth=document.body.clientHeight/2+document.body.scrollTop;
	var MsgWindowStyle = "z-index:100001;width:" + MsgWindowWidth + "px;height:" + MsgWindowHeight + "px;margin-left:-" + (MsgWindowWidth / 2) + "px;position:absolute;left:50%;top:"+PositionWidth+"px;margin-top:-" + (MsgWindowHeight/2) + "px;";
	$(MsgWindowName).attr("style",MsgWindowStyle);
	$("body").css("overflow","hidden");
	$("#ShadowDiv").width($("body").width());
	$("#ShadowDiv").height($("body").height());
	$("#ShadowDiv").css("top",document.body.scrollTop);
	$("#ShadowDiv").css("left",document.body.scrollLeft);
	$("#ShadowDiv").show();
	$(MsgWindowName).fadeIn("slow",fn);
	
}

function hideDiv(name,fn)
{
	var MsgWindowName = "#" + name;
	$(MsgWindowName).fadeOut("slow",function(){
		$("body").css("overflow","auto");
		$("#ShadowDiv").hide("fast",fn);
	});
}
