/***********************************************************************
 *   Fichier : Concerts.js                                             *
 *   Scripts pour les concerts                                         *
 ***********************************************************************/

var gSound, gLabel, gNN, gIE;

gSound = "";
gLabel = "";

/***********************************************************************
 * Change la photo                                                     *
 ***********************************************************************/

function mvChange(pNumber, pMax)
{
var wPhoto, wFunction;

wPhoto  = "../Decor/Photos/Concert";
wPhoto += ((pNumber < 10) ? "0" : "");
wPhoto += pNumber + ".jpg";
document.images['PhotoConcert'].src = wPhoto;
pNumber++;
if (pNumber > pMax)
  pNumber = 1;
wFunction = "mvChange(" + pNumber + ", " + pMax + ")";
setTimeout(wFunction, 3000);
}

/***********************************************************************
 * Afficher un concert                                                 *
 ***********************************************************************/

function mvConcertPreview(pCode)
{
var wState, wView, wWidth, wLeft, wTop, wHeight, wString;

wString = "ConcertsPreview.php?code=" + pCode;
wWidth = 640;
wHeight = 480;
wLeft = (screen.Width - wWidth) / 2;
wTop = (screen.Height - wHeight) / 2;
wState = "toolbar=no, location=no, directories=no, status=no, scrollbars=yes, ";
wState += "resizable=no, copyhistory=no, width=" + wWidth;
wState += ", height=" + wHeight + ", left=" + wLeft + ", top=" + wTop;
wView = window.open(wString, "PopupConcerts", wState);
}

/***********************************************************************
 * Ouvrir une page                                                     *
 ***********************************************************************/

function mvReplace(pUrl)
{
window.top.frames['frClient'].document.location.replace(pUrl);
}

/***********************************************************************
 * Gestion du pointeur de la souris sur une cellule                    *
 ***********************************************************************/

function mvSelect(pRow, pColor)
{
pRow.style.backgroundColor = pColor;
}

/***********************************************************************
 * Gestion du pointeur de la souris sur une cellule                    *
 ***********************************************************************/

function mvUnselect(pRow)
{
pRow.style.backgroundColor = "transparent";
}

/***********************************************************************
 * Jouer un son dans une division                                      *
 ***********************************************************************/

function mvPlay(pSound, pLabel)
{
var wState, wView, wWidth, wLeft, wTop, wHeight, wString;

wString = "Sounds/" + pSound;
wWidth = 400;
wHeight = 80;
wLeft = (screen.Width - wWidth) / 2;
wTop = (screen.Height - wHeight) / 2;
wState = "toolbar=no, location=no, directories=no, status=no, scrollbars=yes, ";
wState += "resizable=no, copyhistory=no, width=" + wWidth;
wState += ", height=" + wHeight + ", left=" + wLeft + ", top=" + wTop;
wView = window.open(wString, "Musique", wState);
}

/***********************************************************************
 * 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;
}
