// (C) 2002 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header.

// ==============================
// Set the following variables...
// ==============================


// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 8000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
var aUrl = new Array();
var aTitle = new Array();
var aTarget = new Array();
var aHtml = new Array();

// Specify the image files...
// To add more images, just continue
// the pattern, adding to the array below.
// To use fewer images, remove lines
// starting at the end of the Picture array.
// Caution: The number of Pictures *must*
// equal the number of Captions!

Picture[1]  = "Home/what-is-group-life.jpg";
Picture[2]  = "Home/straight-to-the-point.jpg";
Picture[3]  = "Home/customize-your-conference.jpg";
Picture[4]  = "Home/regroup.jpg";
//Picture[5]  = '';

// Specify the URL's...
aUrl[1] = "what-is-group-life.asp";
aUrl[2] = "straight-to-the-point.asp";
aUrl[3] = "customize-your-conference.asp";
aUrl[4] = "regroup.asp";
//aUrl[5] = "";

// Specify the Titles...
aTitle[1] = "Image 1";
aTitle[2] = "Image 2";
aTitle[3] = "Image 3";
aTitle[4] = "Image 4";
//aTitle[5] = "";

aTarget[1] = "";
aTarget[2] = "";
aTarget[3] = "";
aTarget[4] = "";
//aTarget[5] = "";

aHtml[1] = "<h2>What is the Group Life Conference?</h2><p>More than 3,000 leaders come together to learn the principles and practices that sustain healthy communal life... <a href=\""+ aUrl[1] +"\">read more.</a></p>";
aHtml[2] = "<h2>Straight to the Point</h2><p>Point Leaders &mdash; those who are responsible for leading the ministries of your church &mdash; have unique needs when it comes to a conference... <a href=\""+ aUrl[2] +"\">read more.</a></p>";
aHtml[3] = "<h2>Customize Your Conference</h2><p>This year you have an unprecedented opportunity to create your own conference experience! In the General Conference alone there are four different... <a href=\""+ aUrl[3] +"\">read more.</a></p>";
aHtml[4] = "<h2>Introducing ReGroup&trade;</h2><p>Step into the next evolution of group life with this exciting new product. Be among the very first to experience this paradigm-shifting resource... <a href=\""+ aUrl[4] +"\">read more.</a></p>";


// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 1;
var pss = 4; //Picture.length-1;
var paused = false;
var init = false;
var max = 4;

var preLoad = new Array();

function initSlideShow(){
  try{
    for (iss = 1; iss <= max; iss++){
      preLoad[iss] = new Image();
      preLoad[iss].src = Picture[iss];
    }
    runSlideShow();
  }
  catch(err){
  }
}

function runSlideShow(){
    if (!(init)){
      for (i=1;i<=max;i++){
        document.getElementById('SlideLink'+i).href = aUrl[i];
        document.getElementById('SlideLink'+i).title = aTitle[i];
        if (aTarget[i]=="_blank"){document.getElementById('SlideLink'+i).target = aTarget[i];}
      }
      init=true;
    }
    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;
    document.images.PictureBox.alt = aTitle[jss];
    document.images.PictureBox.title = aTitle[jss];
    if (aTarget[jss]=="_blank"){
      document.getElementById('PictureBox').onclick = new Function("window.open('"+aUrl[jss]+"')");
    }else{
      document.getElementById('PictureBox').onclick = new Function("location.href='"+aUrl[jss]+"'");
    }

    for (i=0;i<max;i++){
      document.getElementById("SlideLink"+(i+1)).className = "";
    }

    document.getElementById("SlideLink"+jss).className = "selected";
    document.getElementById("slideshow-html").innerHTML = aHtml[jss];

    if (document.all) document.images.PictureBox.filters.blendTrans.Play();
    jss = jss + 1;
    if (jss > (max)) jss=1;
    if (!(paused)) tss = setTimeout('runSlideShow()', SlideShowSpeed);
}



function pauseit(i,bool){
    try{
        clearTimeout(tss);
        paused = bool;
        jss = i;
        runSlideShow();
    }catch(err){
    }
}

