var winModalWindow;
var sFeatures;
 
function IgnoreEvents(e)
{
  return false;
}
 
function ShowWindow(Url, Title, Features)
{
	if (window.showModalDialog) {
		var mDlg=window.showModalDialog(Url,null,Features);
		mDlg=null;
	}
	else {
		window.top.captureEvents (Event.CLICK|Event.FOCUS);
		window.top.onclick=IgnoreEvents;
		window.top.onfocus=HandleFocus;
		winModalWindow = window.open(Url,Title, "dependent=yes,width=510,height=480,center=yes");
		winModalWindow.focus();
	}
}

function HandleFocus()
{
  if (winModalWindow) {
    if (!winModalWindow.closed) {
      winModalWindow.focus();
    }
    else {
      window.top.releaseEvents (Event.CLICK|Event.FOCUS);
    }
  }
  return false;
}