
var flag=true;
var width ;
var height ;
var winModalWindow;

function raise(target,w,h)
{width = w;
height =h;

	if (flag)
	{
		ShowWindow(target);
	}
}

function ShowWindow(url)
{
  if (window.showModalDialog)
  {
    window.showModalDialog(url,null,"dialogWidth: "+width+"px; dialogHeight: "+height+"px; dialogTop: 100px; dialogLeft: 250px; center: No; help: No; resizable: No; status: no;");
  }
  else
  {
    window.top.captureEvents (Event.CLICK|Event.FOCUS);
    window.top.onclick=IgnoreEvents;
    window.top.onfocus=HandleFocus ;
    winModalWindow = window.open (url,"ModalChild","dependent=yes, resizable=No, width="+width+",height="+height);
    winModalWindow.focus();
  }
}

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

function ToPop()
{
	flag=true;
	return true;

}
function NotToPop()
{
	flag=false;
	return true;
}
 
