﻿//Specify speed of scroll. Larger=faster (ie: 5)
var scrollspeed = cache = 1

//Specify intial delay before scroller starts scrolling (in miliseconds):
var initialdelay = 2000

function initializeScroller() {
    dataobj = document.all ? document.all.Scroll : document.getElementById("Scroll")
    dataobj.style.top = "70px"
    setTimeout("getdataheight()", initialdelay)
}

function getdataheight() {
    thelength = dataobj.offsetHeight

    if (thelength == 0)
        setTimeout("getdataheight()", 10)
    else
        scrollDiv()
}

function scrollDiv() {
    dataobj.style.top = parseInt(dataobj.style.top) - scrollspeed + "px"
    if (parseInt(dataobj.style.top) < thelength * (-1))
        dataobj.style.top = "70px"
    setTimeout("scrollDiv()", 80)
}

function changeCSS(id) //sans recup url/target
{
    var leBloc, nomClass;

    if (id.className == undefined) leBloc = document.getElementById(id); // cas où id est l'id du bloc
    else leBloc = id;                                                  // cas où id est this

    nomClass = leBloc.className;

    var rechercheCSS = new RegExp("Hover.*$");

    if (nomClass.match(rechercheCSS)) {
        nomClass = nomClass.replace('Hover', '');
        leBloc.className = nomClass;
    }
    else {
        leBloc.className = nomClass + 'Hover';
    }
}

if (window.addEventListener)
    window.addEventListener("load", initializeScroller, false)
else if (window.attachEvent)
    window.attachEvent("onload", initializeScroller)
else
    window.onload = initializeScroller
