// JavaScript Document
function evFlicker(dirArray,picArray,scoutArray,thumbcount,thumbTotalWidth){
this.scoutArray = scoutArray;
this.dirArray = dirArray;
this.flicker = 'flicker';
this.allpics = picArray; //contains full path to pic
this.currentIndex = 0;
this.shiftDistance = 2 // how many pixels per second
this.totalIndex = thumbcount;
this.startIndex = thumbcount;
this.maxIndex = this.allpics.length;
this.shiftedPixels = 0;
this.photoholder = "photoholder";
this.thumbTotalWidth = thumbTotalWidth;
//this will be dynamic - count of showing plus one past, one b4
this.thumbcount = thumbcount;
}
evFlicker.prototype.buildFlickDivs = function(){
var totalWidth = this.thumbTotalWidth;
var startLeft = 0;
for(var i=0;i< this.totalIndex;i++){
var obj = document.getElementById('flickThumb_' + i);
this.allStartLeft = startLeft + "px"; //this is here so it's the second to last
obj.style.left = startLeft + "px";
startLeft = startLeft + totalWidth;
picsplit = this.allpics[this.currentIndex].split("_");
var mouseOverIt = " onMouseOver=\"" + this.flicker + ".pauseMove();\" onMouseOut=\"" + this.flicker + ".startMove();\" ";
obj.innerHTML = "
";
this.currentIndex++;
}
}
function preloadImages() {
var pics = new Array;
for(var i=0;$i";
}
evFlicker.prototype.swapThumbDivs = function(direction){
if(direction=='left'){
if(this.currentIndex == this.totalIndex){
var newFlick = document.createElement('div');
if(this.currentIndex>=this.maxIndex){
var myID = this.currentIndex - this.maxIndex;
}else{
var myID = this.currentIndex;
}
newFlick.id = 'flickThumb_' + this.totalIndex;
picsplit = this.allpics[myID].split("_");
var mouseOverIt = " onMouseOver=\"" + this.flicker + ".pauseMove();\" onMouseOut=\"" + this.flicker + ".startMove();\" ";
newFlick.innerHTML = "
";
newFlick.className = "flickthumb";
newFlick.style.left = this.allStartLeft;
document.getElementById(this.photoholder).appendChild(newFlick);
this.totalIndex++;
this.currentIndex++;
this.divmade = 1;
}else{
this.currentIndex++;
}
if(this.currentIndex > this.startIndex){
document.getElementById('flickRightButton').style.display = 'block';
}
if(this.currentIndex == this.allpics.length){
//document.getElementById('flickLeftButton').style.display = 'none';
}
}else{
this.currentIndex--;
if(this.currentIndex == this.startIndex){
document.getElementById('flickRightButton').style.display = 'none';
}
if(this.currentIndex <= this.allpics.length){
document.getElementById('flickLeftButton').style.display = 'block';
}
}
return;
}
evFlicker.prototype.photoShift = function(direction){
if(this.shiftedPixels == this.thumbTotalWidth){ //we have gotten to the edge of a photo
this.shiftedPixels = 0;
//this.currentdirection = "a";
this.swapThumbDivs(direction);
this.t = setTimeout(this.flicker + ".photoShift('" + direction + "');",10);
return;
}
this.shiftedPixels += this.shiftDistance;
for(var i=0;i