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: 100px; center: No; help: No; resizable: Yes; 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,width="+width+",height="+height+",scrollbars=yes,resizable =yes");
  /*  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;
}
 
