// set up the random rotation of images on the home page ----------------------------------------------------

var rand1 = 0;
var useRand = 0;

images = new Array;
images[1] = new Image();
images[1].src = "images/mainbanner41_Rotate5.jpg";
images[2] = new Image();
images[2].src = "images/mainbanner41_Rotate1.jpg";
images[3] = new Image();
images[3].src = "images/mainbanner41_Rotate2.jpg";
images[4] = new Image();
images[4].src = "images/mainbanner41_Rotate3.jpg";
images[5] = new Image();
images[5].src = "images/mainbanner41_Rotate4.jpg";
images[6] = new Image();
images[6].src = "images/mainbanner41_Rotate2.jpg";
images[7] = new Image();
images[7].src = "images/mainbanner41_Rotate5.jpg";
images[8] = new Image();
images[8].src = "images/mainbanner41_Rotate1.jpg";
images[9] = new Image();
images[9].src = "images/mainbanner41_Rotate4.jpg";
images[10] = new Image();
images[10].src = "images/mainbanner41_Rotate3.jpg";


function swapPic() {
var imgnum = images.length - 1;
do {
var randnum = Math.random();
rand1 = Math.round((imgnum - 1) * randnum) + 1;
} while (rand1 == useRand);
useRand = rand1;
document.randimg.src = images[useRand].src;
}

// set up the random rotation of images on the inner pages banner ----------------------------------------------------

var rand2 = 0;
var useRand2 = 0;

img = new Array;
img[1] = new Image();
img[1].src = "http://www.oaklandlibrary.org/images/SubBanner_Rotate2a.jpg";
img[2] = new Image();
img[2].src = "http://www.oaklandlibrary.org/images/SubBanner_Rotate2b.jpg";
img[3] = new Image();
img[3].src = "http://www.oaklandlibrary.org/images/SubBanner_Rotate2c.jpg";
img[4] = new Image();
img[4].src = "http://www.oaklandlibrary.org/images/SubBanner_Rotate2e.jpg";
img[5] = new Image();
img[5].src = "http://www.oaklandlibrary.org/images/SubBanner_Rotate2d.jpg";
img[6] = new Image();
img[6].src = "http://www.oaklandlibrary.org/images/SubBanner_Rotate2b.jpg";
img[7] = new Image();
img[7].src = "http://www.oaklandlibrary.org/images/SubBanner_Rotate2a.jpg";
img[8] = new Image();
img[8].src = "http://www.oaklandlibrary.org/images/SubBanner_Rotate2d.jpg";
img[9] = new Image();
img[9].src = "http://www.oaklandlibrary.org/images/SubBanner_Rotate2e.jpg";
img[10] = new Image();
img[10].src = "http://www.oaklandlibrary.org/images/SubBanner_Rotate2c.jpg";

function swapPic2() {
var imgnum2 = img.length - 1;
do {
var randnum2 = Math.random();
rand2 = Math.round((imgnum2 - 1) * randnum2) + 1;
} while (rand2 == useRand2);
useRand2 = rand2;
document.randimg2.src = img[useRand2].src;
}

// set up the sequential rotation of images on the About Oakland Page -------------------------------------------

// (C) 2003 by CodeLifter.com
// Free for all users, but leave in this header.

// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 3000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

var Oakland_img = new Array(); // don't change this

// Caution: The number of Pictures *must*
// equal the number of Captions!

Oakland_img[1]  = 'images/aboutoakland1.gif';
Oakland_img[2]  = 'images/aboutoakland2.gif';
Oakland_img[3]  = 'images/aboutoakland3.gif';
Oakland_img[4]  = 'images/aboutoakland4.jpg';
Oakland_img[5]  = 'images/aboutoakland3.gif';
Oakland_img[6]  = 'images/aboutoakland4.jpg';
Oakland_img[7]  = 'images/aboutoakland1.gif';
Oakland_img[8]  = 'images/aboutoakland2.gif';


// =====================================
// Do not edit anything below this line!
// =====================================



var tss;
var iss;
var jss = 1;
var pss = Oakland_img.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Oakland_img[iss];}

function runSlideShow(){
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.all) document.images.PictureBox.filters.blendTrans.Play();

//do {
//        jss = Math.floor(Math.random()*this.Oakland_img.length);
//} while (jss == 0);

jss = jss + 1;
if (jss > (pss)) jss=1;

tss = setTimeout('runSlideShow()', SlideShowSpeed);

}
