imageSize=100 // % size the image is shown at, if set to zero the fixed width and heights are used
fixedWidth=180 // set a fixed width
spacerWidth=10 // space between images

autoHeight=0 // 0 = no, 1 = yes, sets the width to the widest image size

defaultSpeed=2 
maxSpeed=50

totalHeight=0
displayWidth=0
displayHeight=0
step=defaultSpeed

function initVS1(){

imgBox=document.getElementById("sponsor_box")
imgTags=imgBox.getElementsByTagName("IMG")
imgNum=imgTags.length // number of images

if(document.getElementById&&document.all&&document.compatMode!="CSS1Compat"){
ieBorder=parseInt(document.getElementById("inner_box").style.borderWidth)*2
}
else{
ieBorder=0
}

for(var i=0;i<imgNum;i++){

if(imageSize!=0){ // use percentage size
//imgTags[i].style.width=imgTags[i].offsetWidth/100*imageSize+"px"
imgTags[i].style.height=(imgTags[i].offsetHeight/100)*imageSize+"px"
}
else{ // use fixed size
imgTags[i].style.width=fixedWidth+"px"
}

}

for(var i=0;i<imgNum;i++){
totalHeight+=(document.getElementById("pic"+i).offsetHeight)
document.getElementById("pic"+i).style.marginBottom=spacerWidth+"px"

if(autoHeight==1){
if(document.getElementById("pic"+i).offsetHeight>displayHeight){
displayHeight=document.getElementById("pic"+i).offsetHeight
}

}
else{
displayHeight=parseInt(document.getElementById("inner_box").style.height)
}


if(document.getElementById("pic"+i).offsetWidth>displayWidth){
displayWidth=document.getElementById("pic"+i).offsetWidth+ieBorder
}

}

totalHeight=totalHeight+(imgNum*spacerWidth);

imgHolderHeight=displayHeight
document.getElementById("outer_box").style.height=imgHolderHeight+"px"
document.getElementById("inner_box").style.height=imgHolderHeight+"px"
imgBox.style.height=totalHeight+"px"

imgHolderWidth=displayWidth

document.getElementById("outer_box").style.width=imgHolderWidth+"px"
document.getElementById("inner_box").style.width=imgHolderWidth+"px"
document.getElementById("inner_box").style.clip="rect(0,"+(imgHolderWidth+"px")+","+(imgHolderHeight+"px")+",0)"

scrollVS1(1);
}

imgBox=document.getElementById("sponsor_box")

timer=""
function scrollVS1(n){
clearTimeout(timer)

imgBoxPos=parseInt(imgBox.style.top)
if(n==1){
imgBoxPos-=step
}
else{
imgBoxPos+=step
}

imgBox.style.top=imgBoxPos+"px"
timer=setTimeout("scrollVS1("+n+")",50)

if(n==1&&imgBoxPos< -(totalHeight-imgHolderHeight)+(step+spacerWidth)){
//imgBox.style.top=-(totalHeight-imgHolderHeight)+spacerWidth+"px";
//clearTimeout(timer)
    scrollVS1(0)
}

if(n==0&&imgBoxPos> 0-step+20){
imgBox.style.top=20
clearTimeout(timer)
    scrollVS1(1)
}
}

function fast(){
step=maxSpeed
}

function slow(){
step=defaultSpeed
}

function pause(){
clearTimeout(timer)
}

