// (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

//  NOTE: THIS CODE HAS BEEN MODIFIED FROM THE ORIGINAL SCRIPT
//  For the original script, please visit the link above.
//  Added (and modified) code from http://webdevel.blogspot.com/2006/01/anchorwrap-javascript.html

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

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 3000

// Duration of crossfade (seconds)
var crossFadeDuration = 1

// 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
var linker = new Array()
var first = 0;


Pic[0] = 'slideshowImages/LEGACY CHURCH 2.jpg'
linker[0] = 'projects/index.htm';
Pic[1] = 'slideshowImages/FIGURE 10 _ARENA EXTERIOR SKETCH.JPG'
linker[1] = 'projects/index.htm';
Pic[2] = 'slideshowImages/FIGURE 11 _LEGACY CHURCH EXT. PHOTO.jpg'
linker[2] = 'projects/index.htm';
Pic[3] = 'slideshowImages/FIGURE 12 _EXT. RENDERING.JPG'
linker[3] = 'projects/index.htm';
Pic[4]='slideshowImages/LLANOS ESTACADO.jpg'
linker[4] = 'projects/index.htm';
Pic[5] = 'slideshowImages/CHILDRENS SAFARI.jpg'
linker[5] = 'projects/index.htm';
Pic[6] = 'slideshowImages/FAC 09.20-pic of domes.jpg'
linker[6] = 'projects/index.htm';
Pic[7] = 'slideshowImages/FIGURE 9A _CONCERT SEATING.JPG'
linker[7] = 'projects/index.htm';
Pic[8] = 'slideshowImages/N. Elev 3_08Sep06-Church on the Move.jpg'
linker[8] = 'projects/index.htm';
Pic[9] = 'slideshowImages/Faith Chapel.jpg'
linker[9] = 'projects/index.htm';
Pic[10] = 'slideshowImages/dome pontiac williams.jpg'
linker[10] = 'projects/index.htm';
Pic[11] = 'slideshowImages/17 SEPTEMBER CRC0 copy.jpg'
linker[11] = 'projects/index.htm';



// =======================================
// do not edit anything below this line
// =======================================

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

// variables for wrapping the element with an anchor (Code added to ImageFade)
var newanchor, parent, sibling;

var preLoad = new Array()

newanchor = document.createElement("a");

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

// Visit forum at http://webdevel.blogspot.com/2006/01/anchorwrap-javascript.html for original anchorWrap code
function anchorWrap(node,anchor,target)
{

 if(typeof(node) == "string") 
 {
  node = document.getElementById(node);
 }
 //if(!node || !node.parentNode) {return};
 if(typeof(anchor) == "string")
 {
 
  newanchor.href = anchor;
 }
 else
 {
  newanchor = anchor;
 }
 if(!newanchor) {return};
 // if href is not set (which may be the case when it performs a javascript action), set it to #, so the link is seen
 if(!newanchor.href) newanchor.href = "#";
 // if target is defined, set it
 if(typeof(target) == "string")
 {
  newanchor.target = target;
 }
 newanchor.style.border=0;
 if (first==0)
 {
 // get the sibling and the parent node (so we can insert in the right place)
 sibling = node.nextSibling;
 parent = node.parentNode;
 // add the node to the new anchor
 newanchor.appendChild(node);
 // insert new anchor before sibling, or at the end if there is no sibling
 if(sibling)
 {
  parent.insertBefore(newanchor,sibling);
 }
 else
 {
  parent.appendChild(newanchor);
 }
 }
 first++;
}


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
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }

  // Wrap the element with an anchor (Code added to ImageFade)
 
   //alert(j+":"+links[j]);
   ////////////////////////////
 anchorWrap(document.images.SlideShow, linker[j]);
 document.images.SlideShow.style.borderStyle="none";
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
    
}








