function ShowDivDialog(url, dialogWidth, dialogHeight)
{
	ShowDivDialog(url, dialogWidth, dialogHeight, null, null);
}

function ShowDivDialog(url, dialogWidth, dialogHeight, dialogLeft, dialogTop)
{	
	var oBody = document.body;
	var left = oBody.scrollLeft + (oBody.clientWidth - dialogWidth) / 2;
	var top  = oBody.scrollTop + (oBody.clientHeight - dialogHeight) / 2;
	
	if ( dialogLeft != null )
	{
		left = oBody.scrollLeft + dialogLeft;
	}
	
	if ( dialogTop != null )
	{
		top = oBody.scrollTop + dialogTop;
	}

	if ( left < 0 )	{ left = 0; }
	if ( top < 0 ) { top = 0; }
	
	var divDialog = new DivDialog();
	divDialog.Create(url, dialogWidth, dialogHeight, left, top);	
}

function CloseDivDialog()
{
	try
	{
		parent.DivDialog_PopupFormDiv.style.display = "none";
		parent.DivDialog_PopupFormFrame.location.href = "about:blank";
	}
	catch ( e )
	{}
}

/// DivDialog 的摘要说明。
function DivDialog()
{
	//
	// TODO: 在此处添加构造函数逻辑
	//
}

DivDialog.prototype.Create = function(url, dialogWidth, dialogHeight, dialogLeft, dialogTop)
{	
	if ( typeof(document.all.DivDialog_PopupFormDiv) == 'object' )
	{		
		document.body.removeChild(document.all.DivDialog_PopupFormDiv);
	}

	var oBody = document.body;
	
	var oDiv = document.createElement("div");
	oBody.appendChild(oDiv);	
	oDiv.id                    = "DivDialog_PopupFormDiv";
	oDiv.name                  = "DivDialog_PopupFormDiv";
	oDiv.style.position        = "absolute";
	oDiv.style.border          = "1px outset #D5E4F0";
	oDiv.style.backgroundColor = "#EEF0F2";
	oDiv.style.width           = dialogWidth;
	oDiv.style.height          = dialogHeight;
	oDiv.style.left            = dialogLeft;
	oDiv.style.top             = dialogTop;	
	
	var oIframe = oBody.document.createElement("iframe");
	oDiv.appendChild(oIframe);
	oIframe.id           = "DivDialog_PopupFormFrame";
	oIframe.style.width  = "100%";
	oIframe.style.height = "100%";
	oIframe.frameborder  = 0;
	
	// document.all.DivDialog_PopupFormFrame 与 window.frames["DivDialog_PopupFormFrame"]; 有何区别？
	// oIframe.src = url;
	window.frames["DivDialog_PopupFormFrame"].location.href = url;
}