/*giCurrentID = -1;
goOldLnk = 0;
goOldLnkContainer = 0;
bAutoRoll = true;
giSpeed = 3000;

window.onload = function () {
    BannerRoll();
    ComptoirRoll();
};

function findNode(poParentNode, psTagName) {
    for (var i = 0; i < poParentNode.childNodes.length; i++) {
        if (poParentNode.childNodes[i].tagName == psTagName)
            return (poParentNode.childNodes[i]);
    }
    return null;
}

function openCurrentLink() {
	if(goOldLnk != 0) {
		document.location = goOldLnk.href;
	}	
}

function ComptoirRoll() {
    if (bAutoRoll) {
        var j = 0;
        oDivContainer = document.getElementById('comptoir_des_marques');
        oUlNode = findNode(oDivContainer, 'UL');
        giCurrentID++;

        if (oUlNode != null) {
            if (giCurrentID >= giNbComptoirs)
                giCurrentID = 0;
            for (var i = 0; i < oUlNode.childNodes.length; i++) {
                if (oUlNode.childNodes[i].tagName == 'LI') {
                    if (j == giCurrentID) {
                        
                        oLnk = findNode(oUlNode.childNodes[i], 'A');
                        if (oLnk != null) {
                            loadComptoirImg(oLnk, oUlNode.childNodes[i]);
                            goOldLnk = oLnk;
                            goOldLnkContainer = oUlNode.childNodes[i];
                        }
                        break;
                    }
                    j++;
                }
            }
        }
    }
    setTimeout('ComptoirRoll()', giSpeed);
}

// Récupère la balise img pour pouvoir en changer la source
// et paramètre la classe de l'élément pour activer la couleur au dessus
function loadComptoirImg(poElem) {
	poLi = poElem.parentNode;
	
    if (goOldLnk != 0) {
        comptoirOut(goOldLnk, 0);
        if (goOldLnkContainer)
        	goOldLnkContainer.className = '';
    }
    poLi.className = 'comptoir_hover';
    poElem.className = 'comptoir_hover';
    oContainer = document.getElementById('vignette');
    oContainer.src = 'images/comptoirs/' + poElem.id;
}


// Fonction permettant d'unsetter la class de l'élément 
function comptoirOut(poElem, iFlagID) {
    if (iFlagID != 0) {
        giCurrentID = iFlagID - 1;
    }
    poElem.className = '';
}*/

var gsCurrentFocus = "";
var giSpeed = 2000;
var laChildList = new Array();
var gbRollFlag = true;
var giCurIndex = 0;
window.onload = function ()
{
	/** Ceci n'a absolument rien a voir avec les bannieres tournantes     **/
	/** mais cette operation doit etre effectuée au chargement de la page **/
	initNetAffiliationPopIn();
	/*******************************************************************/
	
	BannerRoll();
	laChildList = document.getElementById("imgDiv").getElementsByTagName("img");
	if (laChildList.length > 0)
	{
		var lsId = laChildList[0].getAttribute("id");
		var laId = lsId.split("_");
		gsCurrentFocus = laId[1];
		ComptoirRoll();
	}
}

function focusMe(psId, psUrl, pbFlag)
{
	var loLastFocus = document.getElementById("vignette_" + gsCurrentFocus);
	loLastFocus.style.display = "none";
	var loNextFocus = document.getElementById("vignette_" + psId);
	loNextFocus.style.display = "inline";
	document.getElementById("imgArea").setAttribute("href", psUrl);
	gsCurrentFocus = psId;
	if (pbFlag)
	{
		while (laChildList[giCurIndex].getAttribute("id") != loNextFocus.getAttribute("id"))
		{
			giCurIndex++;
			if (giCurIndex >= laChildList.length)
				giCurIndex = 0;
		}
		giCurIndex++;
		if (giCurIndex >= laChildList.length)
			giCurIndex = 0;
	}
}

function ComptoirRoll()
{
	if (gbRollFlag)
	{
		var laId = laChildList[giCurIndex].getAttribute("id").split("_");
		var loArea = document.getElementById("area_" + laId[1]);
		focusMe(laId[1], loArea.getAttribute("href"), false);
		giCurIndex++;
		if (giCurIndex >= laChildList.length)
			giCurIndex = 0;
	}
	setTimeout('ComptoirRoll()', giSpeed);
}

function setRoll(psRollFlagState)
{
	if (psRollFlagState == "on")
		gbRollFlag = true;
	else
		gbRollFlag = false;
}

