//
// +----------------------------------------------------------------------+
// | 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);
}

function popupCentrerNavig(sUrl, iWidth, iHeight)
{
  var sTb;
  var iTop=(screen.height-iHeight)/2;
  var iLeft=(screen.width-iWidth)/2;
  sTb = "status=yes,toolbar=yes,location=yes,scrollbars=yes,resizable=yes,menubar=yes,height=" + iHeight + ",width=" + iWidth + ",left=" + 50 + ",top=" + 50;
  window.open(sUrl, "Popup", toolbar=sTb);
}

function popupImages(sUrl, iWidth, iHeight)
{
  var sTb;
  var iTop=(screen.height-iHeight)/2;
  var iLeft=(screen.width-iWidth)/2;
  sTb = "status=0,toolbar=0,location=0,resizable=yes,scrollbars=yes,menubar=0,height=" + iHeight + ",width=" + iWidth + ",left=" + iLeft + ",top=" + iTop;
  window.open(sUrl, "Popup", sTb);
}

function turnGray() {
  if (!window.Event) {
  what = window.event.srcElement;
  if (what.tagName == "IMG") {
    if (what.src.indexOf("1.gif")>0) {
      what.src = what.src.substring(0,(what.src.indexOf("1.gif"))) + "0.gif";
	  event.cancelBubble = true;
	}
  }
}
}

function turnColored() {
  if (!window.Event) {
    what = window.event.srcElement;
    if (what.tagName == "IMG") {
        if (what.src.indexOf("0.gif")>0) {
            what.src = what.src.substring(0,(what.src.indexOf("0.gif"))) + "1.gif";
            event.cancelBubble = true;
        }
    }
  }
}
function ouvre_fenetre(x)
{
     w = window.screen.width ;
     h = window.screen.height ;
     if (w>1024) {
       largeur_fenetre = 900 ;
       hauteur_fenetre = 800;
     }
     else if (w>800) {
       largeur_fenetre = 700 ;
       hauteur_fenetre = 600;
     }
     else  {
       largeur_fenetre = 500 ;
       hauteur_fenetre = 400;
     }
     position_left = w-largeur_fenetre-30 ;
     newfen = window.open(x, 'mafenetre', 'width='+largeur_fenetre+', height='+hauteur_fenetre+', top=0, left='+position_left+', resizable=yes, menubar=yes, location=yes,toolbar=yes,scrollbars=yes');
     newfen.focus();
 }
