
var pic = new Array();
 
function banner(name, width, link){
    this.name = name;
    this.width = width;
    this.link = link;
}
				 
pic[0] = new banner('css/img/logos/ONP.png',158,'index.html')
pic[1] = new banner('css/img/logos/sportsmanswharehouse.png',122,'index.html')
pic[2] = new banner('css/img/logos/condenast.png',266,'index.html')
pic[3] = new banner('css/img/logos/logo-furniture-row.gif',205,'index.html')
pic[4] = new banner('css/img/logos/lechateau.png',206,'index.html')
pic[5] = new banner('css/img/logos/NM.png',158,'index.html')
pic[6] = new banner('css/img/logos/lauramercier.png',205,'index.html')
//pic[7] = new banner('css/img/logos/sharperimage.png',103,'index.html')
pic[7] = new banner('css/img/logos/lululemon.png',259,'index.html')
pic[8] = new banner('css/img/logos/sportsupplygroup.png',175,'index.html')
pic[9] = new banner('css/img/logos/P&G.png',113,'index.html')
pic[10] = new banner('css/img/logos/fox.png',90,'index.html')
pic[11] = new banner('css/img/logos/AMA.png',113,'index.html')
pic[12] = new banner('css/img/logos/GM.png',85,'index.html')
pic[13] = new banner('css/img/logos/lululemon.png',259,'index.html')
pic[14] = new banner('css/img/logos/claires.png',176,'index.html')
pic[15] = new banner('css/img/logos/humana.png',158,'index.html')



var speed = 40
 
var kk = pic.length
var ii
var hhh
var nnn
var myInterval
var myPause
var mode = 0
 
 
var imgArray = new Array(kk)
var myLeft = new Array(kk)
 
for (ii=0;ii<kk;ii++){
imgArray[ii] = new Image()
imgArray[ii].src = pic[ii].name
imgArray[ii].width = pic[ii].width
 
    hhh=0
    for (nnn=0;nnn<ii;nnn++){
        hhh=hhh+pic[nnn].width
    }
    myLeft[ii] = hhh
}
 
function ready(){
    for (ii=0;ii<kk;ii++){
        if (document.images[ii].complete == false){
            return false
            break
        }
    }
return true
}
 
 
function startScrolling(){
    if (ready() == true){
        window.clearInterval(myPause)
        myInterval = setInterval("autoScroll()",speed)
    }
}
 
 
function autoScroll(){
    for (ii=0;ii<kk;ii++){
        myLeft[ii] = myLeft[ii] - 1
 
    if (myLeft[ii] == -(pic[ii].width)){
        hhh = 0
        for (nnn=0;nnn<kk;nnn++){
            if (nnn!=ii){
                hhh = hhh + pic[nnn].width
            }
        }
        myLeft[ii] =  hhh
    }
 
 
        document.images[ii].style.left = myLeft[ii]
    }
    mode = 1
}
 
function stop(){
    if (mode == 1){
        window.clearInterval(myInterval)
    }
    if (mode == 0){
        window.clearInterval(myPause)
    }
}
 
function go(){
    if (mode == 1){
        myInterval = setInterval("autoScroll()",speed)
    }
    if (mode == 0){
        myPause = setInterval("startScrolling()",700)
    }
}
 
myPause = setInterval("startScrolling()",700)
 
for (ii=0;ii<kk;ii++){
    document.write('<a href = "index.html" target="_parent" ><img space=0 hspace=0 vspace=0 border=0 height=47 style=position:absolute;top:0;left:' + myLeft[ii]  + '; src=' + pic[ii].name + ' onMouseOver=stop() onMouseOut=go()></a>');
}
