

var pic = new Array()

function banner(name, width, link){
	this.name = name
	this.width = width
	this.link = link
   }

pic[0] = new banner('/public/buttons/hot_brain.gif',132,'http://hotbrain.pl/')
pic[1] = new banner('/public/buttons/kiper.gif',152,'http://kiper.com.pl')
pic[2] = new banner('/public/buttons/verwa.gif',162,' ')
pic[3] = new banner('/public/buttons/weizen.gif',132,'http://www.weizen.pl')
pic[4] = new banner('/public/buttons/beczkowe.gif',132,' ')
pic[5] = new banner('/public/buttons/hot_brain.gif',132,'http://hotbrain.pl/')
pic[6] = new banner('/public/buttons/kiper.gif',152,'http://kiper.com.pl')
pic[7] = new banner('/public/buttons/verwa.gif',162,' ')
pic[8] = new banner('/public/buttons/weizen.gif',132,'http://www.weizen.pl')
pic[9] = new banner('/public/buttons/beczkowe.gif',132,' ')

var speed = 50

var kk = pic.length
var ii
var hhh
var nnn
var myInterval
var myPause
var mode = 1


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 startScrolling(){
			
		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()",10)
	}	
}




 