// JavaScript Document

fadeStep=5; // Size of the fade "step". Must be a multiple of 100.
fadeInterval=10; // Amount of time in-between the increments of fading

readingTime=4; // Amount of time the user has to see the image (seconds)

images=new Array("images_headers/preaching.jpg : : ","scrapbook/MLK-2008/seniors-discussions.jpg : : ","scrapbook/blueberryfair09/joan.jpg : : ","images_headers/jasondarciewedding-web.jpg : : ","scrapbook/blueberryfair09/fpuuyouth.jpg : : ","scrapbook/blueberryfair09/artist-rlown.jpg : : ","scrapbook/valentine-2009/happykids-web.jpg : : ","scrapbook/blueberryfair09/Cynthia-baloon.jpg : : ","scrapbook/wcannouncement/featureStory-060605_clip_image004.jpg : : ","scrapbook/wcparade/folks-singing.jpg : : ","images_headers/re-sunday5-18.jpg : : ");



/* Do not edit the following variables */
var currTransp=100;
var currDir=0;
var currNum=0;
var img = []; // preloading array

function imageloader(){
      for(i=0; i<images.length; i++){
         img[i] = new Image();
         img[i].src = images[i].split(" : ")[0];
      }
}

function nextSlide()
{
currNum++;
if(currNum == images.length)
{
currNum=0;
}
document.getElementById("disp-slide").src=images[currNum].split(" : ")[0];


}

function prevSlide()
{
currNum--;
if(currNum == -1)
{
currNum=images.length-1;
}
document.getElementById("disp-slide").src=images[currNum].split(" : ")[0];

}

function fadeSlide()
{

john=window.setTimeout("fadeSlide()", fadeInterval);

if(currTransp == 100 - fadeStep && currDir == 1)
{
window.clearTimeout(john);
}

if(currTransp < 0)
{
currTransp=0;
}

if(currTransp > 100)
{
currTransp=100;
}

if(currDir==0 && currTransp > 0)
{
currTransp=currTransp-fadeStep;

if(navigator.appName=="Netscape")
{
document.getElementById("disp-slide").style.MozOpacity=currTransp/100;

}

if(navigator.appName=="Microsoft Internet Explorer")
{
document.getElementById("disp-slide").style.filter="alpha(opacity="+currTransp+")";

}

}

else if(currDir==1 && currTransp < 100)
{
currTransp=currTransp+fadeStep;

if(navigator.appName=="Netscape")
{
document.getElementById("disp-slide").style.MozOpacity=currTransp/100;

}

if(navigator.appName=="Microsoft Internet Explorer")
{
document.getElementById("disp-slide").style.filter="alpha(opacity="+currTransp+")";

}

}

else if(currDir==0 && currTransp == 0)
{
currDir=1;
nextSlide();
}

if(currDir==1 && currTransp == 100)

{
window.setTimeout("commenceFade()", (readingTime * 1000));
}

}

function commenceFade()
{
currDir=0;
fadeSlide();
}

window.setTimeout("commenceFade()", readingTime * 1000 );

