﻿
var slideShowSpeed = 2500
var crossFadeDuration = 3

var v_image = new Array()
v_image[0] = "../../images/residence/img_2.jpg"
v_image[1] = "../../images/residence/img_2B.jpg"
v_image[2] = "../../images/residence/img_2C.jpg"
v_image[3] = "../../images/residence/img_6.jpg"
v_image[4] = "../../images/residence/img_6B.jpg"
v_image[5] = "../../images/residence/img_6C.jpg"
v_image[6] = "../../images/residence/img_6D.jpg"

var v_image2 = new Array()
v_image2[0] = "../../images/residence/img_3.jpg"
v_image2[1] = "../../images/residence/img_3B.jpg"

var t
var j = 0
var w = 3

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

var pp = v_image2.length
var preLoad2 = new Array()
for (i = 0; i < pp; i++){
   preLoad2[i] = new Image()
   preLoad2[i].src = v_image2[i]
}

var y = 0

function ch_image(){

//img1
   if (document.all){
      document.images.img1.style.filter="blendTrans(duration=2)"
      document.images.img1.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.img1.filters.blendTrans.Apply()      
   }
   document.images.img1.src = preLoad[j].src
  if (document.all){
      document.images.img1.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-5)) j=0

//img2
   if (document.all){
      document.images.img2.style.filter="blendTrans(duration=2)"
      document.images.img2.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.img2.filters.blendTrans.Apply()      
   }
   document.images.img2.src = preLoad2[y].src
  if (document.all){
      document.images.img2.filters.blendTrans.Play()
   }
   y = y + 1
   if (y > (pp-1)) y=0

//img3
   if (document.all){  
      document.images.img3.style.filter="blendTrans(duration=2)"
      document.images.img3.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.img3.filters.blendTrans.Apply()      
   }
   	document.images.img3.src = preLoad[w].src
   if (document.all){
    	document.images.img3.filters.blendTrans.Play()
   }
   w = w + 1
   if (w > (p-1)) w=3


   t = setTimeout('ch_image()', slideShowSpeed)
}

