
var winModalWindow

function IgnoreEvents(e)
{
	return false
}

function ShowWindow(vURL, vWidth, vHeight, vScroll, vHelp, vStatus, vResizable)
{
	var strOption = "";
	
	if (window.showModalDialog)
	{
		var returnValue = 0;
		
		strOption = "help:" + vHelp;
		strOption += ";scroll:" + vScroll;
		strOption += ";status:" + vStatus;
		strOption += ";resizable:" + vResizable;		
		
		returnValue = window.showModalDialog(vURL, window, strOption);
		return returnValue;
	}
	else
	{
		strOption = "height=" + vHeight;
		strOption += ",width=" + vWidth;
		strOption += ",scrollbar=" + vScroll;
		strOption += ",resizable=" + vResizable;
		strOption += ",status=" + vStatus;
				
		if (window.parent != window.top) {
			window.parent.captureEvents(Event.CLICK|Event.FOCUS)
			window.parent.onclick=IgnoreEvents
			window.parent.onfocus=HandleFocus
		}
		else {
			window.top.captureEvents(Event.CLICK|Event.FOCUS)
			window.top.onclick=IgnoreEvents
			window.top.onfocus=HandleFocus
		}
		
		winModalWindow = window.open(vURL,'ModalChild' + vURL,
			'dependent=yes,' + strOption)
		winModalWindow.focus()
	}
}

function HandleFocus()
{
	if (winModalWindow)
	{
		if (!winModalWindow.closed)
		{
			winModalWindow.focus()
		}
		else
		{
			if (window.parent != window.top) {
				window.parent.releaseEvents(Event.CLICK|Event.FOCUS)
				window.parent.onclick="";
			}
			else {
				window.top.releaseEvents(Event.CLICK|Event.FOCUS)
				window.top.onclick="";
			}
		}
	}
	
	return false
}

function ForcePostBack(vPostBack)
{
	__doPostBack(vPostBack,'Refresh');

}