var pic = new Array()
 
function banner(name, width, link){
	this.name = name
	this.width = width
	this.link = link
   }
 
pic[0] = new banner('../images/gallery/thumbs/1_t.jpg',114,'../images/gallery/thumbs/1_t.jpg')
pic[1] = new banner('../images/gallery/thumbs/2_t.jpg',114,'../images/gallery/thumbs/2_t.jpg')
pic[2] = new banner('../images/gallery/thumbs/3_t.jpg',114,'../images/gallery/thumbs/3_t.jpg')
pic[3] = new banner('../images/gallery/thumbs/4_t.jpg',114,'../images/gallery/thumbs/4_t.jpg')
pic[4] = new banner('../images/gallery/thumbs/5_t.jpg',114,'../images/gallery/thumbs/5_t.jpg')
pic[5] = new banner('../images/gallery/thumbs/6_t.jpg',114,'../images/gallery/thumbs/6_t.jpg')
pic[6] = new banner('../images/gallery/thumbs/7_t.jpg',114,'../images/gallery/thumbs/7_t.jpg')
pic[7] = new banner('../images/gallery/thumbs/8_t.jpg',114,'../images/gallery/thumbs/8_t.jpg')
pic[8] = new banner('../images/gallery/thumbs/1_t.jpg',114,'../images/gallery/thumbs/1_t.jpg')
pic[9] = new banner('../images/gallery/thumbs/2_t.jpg',114,'../images/gallery/thumbs/2_t.jpg')
pic[10] = new banner('../images/gallery/thumbs/3_t.jpg',114,'../images/gallery/thumbs/3_t.jpg')
pic[11] = new banner('../images/gallery/thumbs/4_t.jpg',114,'../images/gallery/thumbs/4_t.jpg')
pic[12] = new banner('../images/gallery/thumbs/5_t.jpg',114,'../images/gallery/thumbs/5_t.jpg')
pic[13] = new banner('../images/gallery/thumbs/6_t.jpg',114,'../images/gallery/thumbs/6_t.jpg')
pic[14] = new banner('../images/gallery/thumbs/7_t.jpg',114,'../images/gallery/thumbs/7_t.jpg')
pic[15] = new banner('../images/gallery/thumbs/no.png',1,'../images/gallery/thumbs/no.png')

var speed = 50
 
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()",3000)
	}	
}
 
myPause = setInterval("startScrolling()",3000)

