// JavaScript Document

// images to show in band
var images=new Array()

images[0] = '<a href="lbimages/kaiserapotheke-070.html"><img src="lbimages/kaiserapotheke-070_tn.jpg"></a>'
images[1] = '<a href="lbimages/kaiserapotheke-048.html"><img src="lbimages/kaiserapotheke-048_tn.jpg"></a>'
images[2] = '<a href="lbimages/kaiserapotheke-059.html"><img src="lbimages/kaiserapotheke-059_tn.jpg"></a>'
images[3] = '<a href="lbimages/kaiserapotheke-075.html"><img src="lbimages/kaiserapotheke-075_tn.jpg"></a>'
images[4] = '<a href="lbimages/kaiserapotheke-077.html"><img src="lbimages/kaiserapotheke-077_tn.jpg"></a>'
images[5] = '<a href="lbimages/kaiserapotheke-078.html"><img src="lbimages/kaiserapotheke-078_tn.jpg"></a>'
images[6] = '<a href="lbimages/kaiserapotheke-079.html"><img src="lbimages/kaiserapotheke-079_tn.jpg"></a>'
images[7] = '<a href="lbimages/kaiserapotheke-081.html"><img src="lbimages/kaiserapotheke-081_tn.jpg"></a>'
images[8] = '<a href="lbimages/kaiserapotheke-082.html"><img src="lbimages/kaiserapotheke-082_tn.jpg"></a>'
images[9] = '<a href="lbimages/kaiserapotheke-083.html"><img src="lbimages/kaiserapotheke-083_tn.jpg"></a>'



// attributes for imageband
var bandwidth = "830px"
var bandheight = "180px"
var spacing = "<img src=lbimages/space.jpg width=10 height=1>"
var speed = 1
var pause = 10
//--------------------------------------------------------------------------------------------------------
images = '<nobr>'+images.join(spacing)+'</nobr>'
document.write('<div id="allImg" style="visibility:hidden; position:absolute; top:0px; left:-10000px">'+images+'</div>')
var completeWidth = ''// sum of width of all images

var bandSpeed = speed
var imgContainer
var imgContainer2

function getImgBand(){
	imgContainer = document.getElementById("first")	
	imgContainer2 = document.getElementById("next")
	// images are written into containers
	imgContainer.innerHTML = images
	imgContainer2.innerHTML = images
	
	// second container gets shifted to the end of first one
	completeWidth= document.getElementById("allImg").offsetWidth
	imgContainer2.style.left = completeWidth+pause+"px"
	// band shall "move" now
	animation = setInterval("moveBand()",20)
}


function moveBand(){
	if (parseInt(imgContainer.style.left) > (completeWidth*(-1)-1000)){
		imgContainer.style.left = parseInt(imgContainer.style.left)-bandSpeed+"px"
		}	
		
	else{
		imgContainer.style.left = parseInt(imgContainer2.style.left)+completeWidth+pause+"px"
	}

	if (parseInt(imgContainer2.style.left) > (completeWidth*(-1)-1000)){
		imgContainer2.style.left = parseInt(imgContainer2.style.left)-bandSpeed+"px"
	}
	else{
		imgContainer2.style.left = parseInt(imgContainer.style.left)+completeWidth+pause+"px"
		}

}
window.onload = getImgBand
document.write('<div style="position:relative; width:'+bandwidth+'; height:'+bandheight+'; overflow:hidden">')
document.write('<div style="position:absolute; width:'+bandwidth+'; height:'+bandheight+';" onMouseover="bandSpeed=0" onMouseout="bandSpeed=speed">')
document.write('<div id="first" style="position:absolute; left:0px; top:0px"></div>')
document.write('<div id="next" style="position:absolute; left:-500px; top:0px"></div>')
document.write('</div></div>')

