// (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 = 6000;

// Duration of crossfade (seconds)
var crossFadeDuration = 5;

// Specify the image files
//var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

// Pic[0] = '1.jpg';
// Pic[1] = '2.jpg';
// Pic[2] = '3.jpg';
// Pic[3] = '4.jpg';
// Pic[4] = '5.jpg';
// Pic[5] = '6.jpg';
// Pic[6] = '7.jpg';
// Pic[7] = '8.jpg';

// =======================================
// do not edit anything below this line
// =======================================

var timer;
var currentpictureindex = 0;
var numberofpictures = Pic.length;

var preLoad = new Array();
for (i = 0; i < numberofpictures; i++){
  preLoad[i] = new Image();
  preLoad[i].src = Pic[i];
}

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[currentpictureindex].src;
  if (document.all) {
    document.images.SlideShow.filters.blendTrans.Play();
  }
  currentpictureindex = ++currentpictureindex % numberofpictures;
  timer = setTimeout('runSlideShow()', slideShowSpeed);
}

// This bundle is revised by Dr_Xem@cs
//
// First I changed names on some variables to make code easier to read.
// Second I changed some implementation in the main function.
// Third I removed the remarks in home.php, since noone is going
// to change the produced page...
//
// Lines 18 and 22-29 are commented and moved to php code constructed 
// caller page home.php. This bundle is partly included in home.php
//
// Also the img tag is php constructed.
//
// ==================================================================
//
// To run this script bundle uncomment those lines, include using a 
// script tag in head of html document:
//
//    <script language="javascript" 
//	    type="text/javascript"
//	    src="slideshow.js"></script>
//
// add a named image tag with Your first picture:
//
//	<img src="1.jpg" 
//	     name='SlideShow' 
//           width="300"
//	     height="200"
//	     border="0">
//
// changing dimensions to your content. Finally modify the body tag:
//
//     <body onload="runSlideShow()">
//
// and you should be up and running!
//
// It would be advisable to try keeping the images in same dimensions
// otherwise the picture is jumping if image is centerred
//
// Dr_Xem@cs 2008-12-03
