// JavaScript Document

// Simple Scroll Animation

var imgObj = null;
var animate ;
function init(num){
   imgObj = document.getElementById('gallery');
   imgObj.style.top = '1px';
   imgNum = num //10; // change for number of images
}

function scrollerUp(){

   if (parseInt(imgObj.style.top) > - ((imgNum*90)-324)){ // (number of images*90)-305 // 90=heigth of each image // -305 = heigth of box
   imgObj.style.top = parseInt(imgObj.style.top) - 4 + 'px';
   animate = setTimeout(scrollerUp,30); // call moveRight in 20msec
}
else {stop();}
}

function scrollerDown(){

   if (parseInt(imgObj.style.top) < 0){
   imgObj.style.top = parseInt(imgObj.style.top) + 4 + 'px';
   animate = setTimeout(scrollerDown,30); // call moveRight in 20msec
}
else {stop();}
}

function stop(){
   clearTimeout(animate);
   imgObj.style.left = parseInt(imgObj.style.left); 
}

//window.onload =init;