
var begin = Math.random();
function showBrand(wEvent)  {
var s = getSrcElement(wEvent);
if (s.getAttribute("to") != null) {
window.open(s.getAttribute("to"),"_self");
}
}

var speed=-2;
function g1(event) {
speed=10;
}
function g2(event) {
speed=2;
}
function d1(event) {
speed=-10;
}
function d2(event) {
speed=-2;
}
//attention : 21000 = la taille de tous les logos (il faudrait la calculer)
var maxsc=15000;
var bCaroussel =false;
function sc() {
bCaroussel = true;
}
function sCaroussel() {
var imgs=window.document.images;
var t=0;
    for (var i=0;i<imgs.length;i++) {
        if (imgs[i].getAttribute("bsrc") != null) {
            imgs[i].setAttribute("src",imgs[i].getAttribute("bsrc"));
            t=t+1;
        }
    }
window.setTimeout("startCaroussel();",1000);
}

function startCaroussel() {
var ix=Math.random()*maxsc+"";
ix = ix.substring(0,ix.indexOf("."));
getElement_By_Id("ds").style.left = "-" + ix + "px";
sc1();
}

function sc1() {
var le = getElement_By_Id("ds").style.left.replace("px","")*1;
var wi = getElement_By_Id("ds").offsetWidth;
var wie = getElement_By_Id("ds").offsetLeft;
if (wi>maxsc) 
    le=100;
if (wie>400) {
  getElement_By_Id("ds").style.left = "-" + maxsc + "px";
  window.setTimeout("sc1()",10);
  return;
  }
if (wie<-maxsc) {
  getElement_By_Id("ds").style.left = "0px";
  window.setTimeout("sc1()",10);
  return;
  }
getElement_By_Id("ds").style.left = (le + speed) + "px";
window.setTimeout("sc1()",10);
}
function scstop() {
speed=0;
}
function scstart() {
speed=-2;
}