  wins = new Array();
  function wopen(wurl,trgt,w,h,top,left) {
    var w = w ? w : 800;
    var h = h ? h : 800;
    var top = top ? top : 300;
    var left = left ? left : 300;
    win = wins[trgt];
    if (!win || win.closed) {
      wins[trgt] = window.open(wurl,trgt,'height='+h+',width='+w+',resizable=yes,scrollbars=auto,menubar=no,status=yes,top='+top+',left='+left+'');
      win = wins[trgt];
    }
    win.focus();
    return false;
  }

  function SelfClose(stay) {
    if (!stay && window.opener) {
      setTimeout('if (!window.opener.closed) window.opener.WinRefresh(); self.close();',2000);
    } else {
      setTimeout('self.close();',2000);
    }
  }

  function SelfCloseGo(location) {
    if(!window.opener) {
       setTimeout('self.close();',2000);
       return;
    }
    if (location){
       window.opener.location = location;
       setTimeout('self.close();',2000);
    }
    else {
       setTimeout('if (!window.opener.closed) window.opener.WinRefresh(); self.close();',2000);
    }
  }

  function WinRefresh(url) {
    self.focus();
    window.location.href = url || window.location;
  }

  function SendMail(nick, host) {
    window.open('mailto:'+nick+'@'+host);
    return false;
  }

