/***********************************************************************
 *   Fichier : Scripts.js                                              *
 *   Fonctions globales                                                *
 ***********************************************************************/

var gSound, gLabel, gImg, gId, gFondu;

gSound = "";
gLabel = "";
gImg = 0;

/***********************************************************************
 * Fondu enchaîné                                                      *
 ***********************************************************************/

function mvProgress()
{
gFondu += 2;
if (gFondu > 100)
  return;
mvOpacity(gId, gFondu);
setTimeout("mvProgress()", 1);
}

/***********************************************************************
 * Fondu enchaîné de l'image                                           *
 ***********************************************************************/

function mvFondu(pId)
{
gFondu = 0;
gId = document.getElementById(pId);
mvProgress();
}

/***********************************************************************
 * Opacité d'une image                                                 *
 ***********************************************************************/

function mvOpacity(pCur, pOpacity)
{
if (document.getElementById)
  {
  if (document.all)
    pCur.filters.alpha.opacity = pOpacity;
    else
      {
      wOpacity = pOpacity / 100;
      pCur.style.setProperty("-moz-opacity", wOpacity, "");
      }
  }
}

/***********************************************************************
 * Ouvrir une page                                                     *
 ***********************************************************************/

function mvReplace(pUrl, pBack, pCode)
{
var wString;

wString = "Summary.php?goback=";
if (pBack > 0)
  wString += "yes";
  else
    wString += "no";
wString += "&code=" + pCode;
window.top.frames['frSummary'].document.location.replace(wString);
window.top.frames['frClient'].document.location.replace(pUrl);
}

/***********************************************************************
 * Gestion du pointeur de la souris sur une cellule                    *
 ***********************************************************************/

function mvPointer(pRow, pDefaultColor, pPointerColor)
{
pRow.style.color = pDefaultColor;
pRow.style.backgroundColor = pPointerColor;
}

/***********************************************************************
 * Jouer un son dans une division                                      *
 ***********************************************************************/

function mvPlay(pSound, pLabel)
{
var wString;

gSound = pSound;
gLabel = pLabel;
wString = "<embed src='" + gSound + "' width=145 height=60 autostart='true'>";
document.all['DivSound'].innerHTML = wString;
wString  = "<img src='Decor/SoundCursor.gif'>";
wString += "<img src='Decor/SoundPlay.gif' style='position: absolute; left: 15px; top: 7px; cursor: pointer;'>";
wString += "<img src='Decor/SoundStop.gif' style='position: absolute; left: 50px; top: 7px; cursor: pointer;' onclick='JavaScript:mvStop();'>";
wString += "<span class='mvLabel'>" + gLabel + "</span>";
document.all['ShowSound'].innerHTML = wString;
}

/***********************************************************************
 * Stopper le son dans une division                                    *
 ***********************************************************************/

function mvStop()
{
document.all['DivSound'].innerHTML = "<embed src='#' width=145 height=60 autostart='false'>";
wString  = "<img src='Decor/SoundCursor.gif'>";
wString += "<img src='Decor/SoundPlay.gif' style='position: absolute; left: 15px; top: 7px; cursor: pointer;' onclick='JavaScript:mvPlay(gSound, gLabel);'>";
wString += "<img src='Decor/SoundStop.gif' style='position: absolute; left: 50px; top: 7px; cursor: pointer;'>";
wString += "<span class='mvLabel'>" + gLabel + "</span>";
document.all['ShowSound'].innerHTML = wString;
}
