var dialog;

function handleDialogFocus() {
	try { 
		if (dialog && !dialog.closed) {
			dialog.focus(); 
		}
	} catch (e) { dialog = null; }
	return false;
}

function isDialogClosed_Retry(isRetry) {
	bOK	= false;
	if (dialog) {
		try {
			if (!isRetry) {
				bOK = dialog.closed;
			} else {
				bOK = true;	//default to closed on retry
			}
		} catch (e) {
			//this is a workaround for an issue introduced by an IE 6.0 patch (6.0.2900)
            dialog = null;
			setTimeout("isDlgClosed(true);", 1000);
		}
        if (bOK) dialog = null;
		return bOK;
	} else {
        dialog = null;
		return true;
	}
}

function isDialogClosed() {
	if (dialog) {
		try {
            var isDialogClosed = dialog.closed;
            if (isDialogClosed) dialog = null;
			return isDialogClosed;
		} catch (e) {
			//this is a workaround for an issue introduced by an IE 6.0 patch (6.0.2900)
            dialog = null;
			return true;
		}
	} else {
        dialog = null;
		return true;
	}
}

