// JavaScript Document 

var slideShowSpeed = 5000

var crossFadeDuration = 3

var Pic = new Array()

Pic[0] = 'http://stoneadoption.org/images/ss0.jpg'

Pic[1] = 'http://stoneadoption.org/images/Andrew-3.jpg'

Pic[2] = 'http://stoneadoption.org/images/ss1.jpg'

Pic[3] = 'http://stoneadoption.org/images/ss2.jpg'

Pic[4] = 'http://stoneadoption.org/images/ss3.jpg'

Pic[5] = 'http://stoneadoption.org/images/ss4.jpg'

Pic[6] = 'http://stoneadoption.org/images/ss5.jpg'

Pic[7] = 'http://stoneadoption.org/images/ss6.jpg'

Pic[8] = 'http://stoneadoption.org/images/ss7.jpg'

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]
}

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()

   }

   j = j + 1

   if (j > (p-1)) j=0

   t = setTimeout('runSlideShow()', slideShowSpeed)

}

// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array. Rememeber
// to increment the theImages[x] index!

theImages[0] = 'http://stoneadoption.org/images/img1.jpg'
theImages[1] = 'http://stoneadoption.org/images/img2.jpg'
theImages[2] = 'http://stoneadoption.org/images/img3.jpg'
theImages[3] = 'http://stoneadoption.org/images/img4.jpg'
theImages[4] = 'http://stoneadoption.org/images/img5.jpg'
theImages[5] = 'http://stoneadoption.org/images/img6.jpg'
theImages[6] = 'http://stoneadoption.org/images/img7.jpg'
theImages[7] = 'http://stoneadoption.org/images/img8.jpg'

// ======================================
// do not change anything below this line
// ======================================

var j = 0
var p = theImages.length;

var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}

var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }