function open_window(page, frame, x, y)
{
    if (x!=undefined && y!=undefined)
        pre_open(frame, x, y);
    else
        pre_open(frame);
    window.open(page, frame);
}

function close_window()
{
  for (var i=0; i<wh_childrens.length; i++)
    if (wh_childrens[i]!=undefined && !wh_childrens[i].closed) 
      wh_childrens[i].close_window(); 

  if (top.opener!=undefined && !top.opener.closed) 
    top.opener.focus();
  top.close();
}
