//
// +----------------------------------------------------------------------+
// | PHP Version 4                                                        |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 Lille Metropole Communaute Urbaine (LMCU)         |
// +----------------------------------------------------------------------+
// | This file is part of Tiny.                                           |
// |                                                                      |
// | Tiny is free software; you can redistribute it and/or modify         |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or    |
// | (at your option) any later version.                                  |
// |                                                                      |
// | Tiny is distributed in the hope that it will be useful,              |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with Tiny; if not, write to the Free Software Foundation,      |
// | Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA        |
// +----------------------------------------------------------------------+
// | Authors: Laurent Glock <lglock@cudl-lille.fr>                        |
// +----------------------------------------------------------------------+
//

function popupCentrer(sUrl, iWidth, iHeight)
{
  var sTb;
  var iTop=(screen.height-iHeight)/2;
  var iLeft=(screen.width-iWidth)/2;
  if (iWidth*iHeight == 0) {
    sTb = "status=yes,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,height=600,width=800,left=" + (screen.width-800)/2 + ",top=" + (screen.height-600)/2;
  } else {
    sTb = "status=yes,scrollbars=no,resizable=no,height=" + iHeight + ",width=" + iWidth + ",left=" + iLeft + ",top=" + iTop;
  }
  window.open(sUrl, "Popup", toolbar=sTb);
}
