
var timer_id;
function scroll_iframe1(frm,inc,dir) {

  if (timer_id) clearTimeout(timer_id);
  if (window.frames[frm]) {
    if (dir == "v") window.frames[frm].scrollBy(0, inc);
    else 
	window.frames[frm].scrollBy(inc, 0);
    timer_id = setTimeout("scroll_iframe1('" + frm + "'," + inc + ",'" + dir + "')", 20);
  }
}

function stopScroll() { if (timer_id) clearTimeout(timer_id); }


var pic = new Array()

function banner(name, width, link){
	this.name = name
	this.width = width
	this.link = link
   }

pic[0] = new banner('../schools/img/gallery/1.jpg',65,'photo_gallery.html') 
pic[1] = new banner('../schools/img/gallery/2.jpg',65,'photo_gallery.html') 
pic[2] = new banner('../schools/img/gallery/3.jpg',65,'photo_gallery.html') 
pic[3] = new banner('../schools/img/gallery/4.jpg',65,'photo_gallery.html') 
pic[4] = new banner('../schools/img/gallery/5.jpg',65,'photo_gallery.html') 
pic[5] = new banner('../schools/img/gallery/6.jpg',65,'photo_gallery.html') 
pic[6] = new banner('../schools/img/gallery/7.jpg',65,'photo_gallery.html') 
pic[7] = new banner('../schools/img/gallery/8.jpg',65,'photo_gallery.html') 
pic[8] = new banner('../schools/img/gallery/9.jpg',65,'photo_gallery.html') 
pic[9] = new banner('../schools/img/gallery/10.jpg',65,'photo_gallery.html') 
pic[10] = new banner('../schools/img/gallery/11.jpg',65,'photo_gallery.html') 
pic[11] = new banner('../schools/img/gallery/12.jpg',65,'photo_gallery.html') 
pic[12] = new banner('../schools/img/gallery/13.jpg',65,'photo_gallery.html') 
pic[13] = new banner('../schools/img/gallery/14.jpg',65,'photo_gallery.html') 
pic[14] = new banner('../schools/img/gallery/15.jpg',65,'photo_gallery.html') 
pic[15] = new banner('../schools/img/gallery/16.jpg',65,'photo_gallery.html') 
pic[16] = new banner('../schools/img/gallery/17.jpg',65,'photo_gallery.html') 
pic[17] = new banner('../schools/img/gallery/18.jpg',65,'photo_gallery.html') 
pic[18] = new banner('../schools/img/gallery/19.jpg',65,'photo_gallery.html') 
pic[19] = new banner('../schools/img/gallery/20.jpg',65,'photo_gallery.html') 
pic[20] = new banner('../schools/img/gallery/21.jpg',65,'photo_gallery.html') 
pic[21] = new banner('../schools/img/gallery/22.jpg',65,'photo_gallery.html') 
pic[22] = new banner('../schools/img/gallery/23.jpg',65,'photo_gallery.html') 
pic[23] = new banner('../schools/img/gallery/24.jpg',65,'photo_gallery.html') 
pic[24] = new banner('../schools/img/gallery/25.jpg',65,'photo_gallery.html') 
pic[25] = new banner('../schools/img/gallery/26.jpg',65,'photo_gallery.html') 
pic[26] = new banner('../schools/img/gallery/27.jpg',65,'photo_gallery.html') 
pic[27] = new banner('../schools/img/gallery/28.jpg',65,'photo_gallery.html') 
pic[28] = new banner('../schools/img/gallery/29.jpg',65,'photo_gallery.html') 
pic[29] = new banner('../schools/img/gallery/30.jpg',65,'photo_gallery.html')
pic[30] = new banner('../schools/img/gallery/31.jpg',65,'photo_gallery.html')
pic[31] = new banner('../schools/img/gallery/32.jpg',65,'photo_gallery.html')
pic[32] = new banner('../schools/img/gallery/33.jpg',65,'photo_gallery.html')
pic[33] = new banner('../schools/img/gallery/34.jpg',65,'photo_gallery.html')
pic[34] = new banner('../schools/img/gallery/35.jpg',65,'photo_gallery.html')
pic[35] = new banner('../schools/img/gallery/36.jpg',65,'photo_gallery.html')
pic[36] = new banner('../schools/img/gallery/37.jpg',65,'photo_gallery.html')
pic[37] = new banner('../schools/img/gallery/38.jpg',65,'photo_gallery.html')

var speed = 50

var kk = pic.length
var ii
var hhh
var nnn
var myInterval
var myPause


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]
	}
}

