﻿// JavaScript Document
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 8000;

// Duration of crossfade (seconds)
var crossFadeDuration = 2;

// Specify the image files Array(str(imageURL), str(thumbURL), str(description))
var Pic = new Array(); // don't touch this
Pic[0] = new Array('images/facility/Aaronfeb08-014.jpg', 'images/facility/thumbs/Aaronfeb08-014.jpg', 'Future Men Lodge - Kitchen');
Pic[1] = new Array('images/facility/Aaronfeb08-015.jpg', 'images/facility/thumbs/Aaronfeb08-015.jpg', 'Future Men Lodge - Living Room');
Pic[2] = new Array('images/facility/Aaronfeb08-016.jpg', 'images/facility/thumbs/Aaronfeb08-016.jpg', 'Future Men Lodge - Study Hall');
Pic[3] = new Array('images/facility/Aaronfeb08-021.jpg', 'images/facility/thumbs/Aaronfeb08-021.jpg', 'Future Men Lodge - Showers');
Pic[4] = new Array('images/facility/Aaronfeb08-025.jpg', 'images/facility/thumbs/Aaronfeb08-025.jpg', 'Welcome to Future Men');
Pic[5] = new Array('images/facility/Aaronfeb08-033.jpg', 'images/facility/thumbs/Aaronfeb08-033.jpg', 'Future Men Rec. Room');
Pic[6] = new Array('images/facility/Aaronfeb08-034.jpg', 'images/facility/thumbs/Aaronfeb08-034.jpg', 'Future Men Lodge - Outside View');
Pic[7] = new Array('images/facility/Aaronfeb08-037.jpg', 'images/facility/thumbs/Aaronfeb08-037.jpg', 'Future Men - Lakeside Lawn');
Pic[8] = new Array('images/facility/basketball.jpg', 'images/facility/thumbs/basketball.jpg', 'Future Men - Basketball Courts');
Pic[9] = new Array('images/facility/horses.jpg', 'images/facility/thumbs/horses.jpg', 'Future Men - Horse Stables');
Pic[10] = new Array('images/facility/officehangout.jpg', 'images/facility/thumbs/officehangout.jpg', 'Office and Hangout Area');

var t; var j = 0; var p = Pic.length;

var preLoad = new Array();
for (i = 0; i < p; i++){
   preLoad[i] = new Image();
   preLoad[i].src = Pic[i][0];
}

function runSlideShow(){
   if (document.all){
      document.images.slideshow.style.filter="blendTrans(duration=2)";
      document.images.slideshow.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.slideshow.filters.blendTrans.Apply();      
   }
   document.images.slideshow.src = preLoad[j].src;
   document.getElementById('slidetext').innerHTML = Pic[j][2];
   document.getElementById('thumb'+j).className = "thumbnailActive";
   document.getElementById('thumb'+(j+p-1)%p).className = "thumbnailInactive";
   if (document.all){
      document.images.slideshow.filters.blendTrans.Play();
   }
   j=(j+1)%p;
   t = setTimeout('runSlideShow()', slideShowSpeed);
}

function playSlide(a){ 
   j=a;
   for (var i=0; i<p; ++i) {
      document.getElementById('thumb'+i).className = "thumbnailInactive";
   }
   clearTimeout(t);
   runSlideShow();
}
function nextSlide() {
   clearTimeout(t);
   runSlideShow();
}
function backSlide() { 
   document.getElementById('thumb'+(j+p-1)%p).className = "thumbnailInactive";
   j=(j+p-2)%p;
   clearTimeout(t);
   runSlideShow();
}
