/**** mps ************/
var gallery=new Array()
var gallerylink=new Array()
var caption = new Array()
var norightbtn=new Array()
var noleftbtn=new Array()
var which=0
var imagelinks=0

gallery[0]="pGallery/plan1/Plan1_FrontExterior.gif";
gallery[1]="pGallery/plan1/Plan-1-Living-Room.gif";
gallery[2]="pGallery/plan1/Plan-1-Dining.gif";
gallery[3]="pGallery/plan1/Plan-1-Family-Room.gif";
gallery[4]="pGallery/plan1/Plan-1-Kitchen.gif";
gallery[5]="pGallery/plan1/Plan-1-Entry.gif";
gallery[6]="pGallery/plan1/Plan-1-Master-Bedroom.gif";
gallery[7]="pGallery/plan1/Plan-1-Master-Bathroom.gif";



gallerylink[0]=""
gallerylink[1]=""
gallerylink[2]=""
gallerylink[3]=""
gallerylink[4]=""
gallerylink[5]=""
gallerylink[6]=""
gallerylink[7]=""

norightbtn [0]="images/no-button.gif"
norightbtn [1]="images/right-button.gif"
norightbtn [2]="images/right-button.gif"
norightbtn [3]="images/right-button.gif"
norightbtn [4]="images/right-button.gif"
norightbtn [5]="images/right-button.gif"
norightbtn [6]="images/right-button.gif"
norightbtn [7]="images/right-button.gif"


noleftbtn [0]="images/left-button.gif"
noleftbtn [1]="images/left-button.gif"
noleftbtn [2]="images/left-button.gif"
noleftbtn [3]="images/left-button.gif"
noleftbtn [4]="images/left-button.gif"
noleftbtn [5]="images/left-button.gif"
noleftbtn [6]="images/left-button.gif"
noleftbtn [7]="images/no-button.gif"

caption[0] = "The Capistrano - Residence One";
caption[1] = "The Capistrano - Living Room";
caption[2] = "The Capistrano - Dining Room";
caption[3] = "The Capistrano - Family Room";
caption[4] = "The Capistrano - Kitchen";
caption[5] = "The Capistrano - Entry";
caption[6] = "The Capistrano - Main Bedroom";
caption[7] = "The Capistrano - Main Bath";


var preloadedimages=new Array()
for (i=0;i<gallery.length;i++){
preloadedimages[i]=new Image()
preloadedimages[i].src=gallery[i]

}

function applyeffect(){
if (document.all && photoslider.filters){
photoslider.filters.revealTrans.Transition=Math.floor(Math.random()*23)
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}

function playeffect(){
if (document.all && photoslider.filters)
photoslider.filters.revealTrans.play()
}

function keeptrack(){
window.status="Image "+(which+1)+" of "+gallery.length
window.status="Image "+(which+1)+" of "+noleftbtn.length
window.status="Image "+(which+1)+" of "+norightbtn.length
}

function backward(){
if (which>0){
which--
applyeffect()
document.images.photoslider.src=gallery[which]
document.images.noleftbtn.src = noleftbtn[which]
document.images.norightbtn.src = norightbtn[which]
document.getElementById('imageCaption').innerHTML = caption[which];
playeffect()
keeptrack()
}
}

function forward(){
if (which<gallery.length-1){
which++
applyeffect()
document.images.photoslider.src=gallery[which]
document.images.noleftbtn.src = noleftbtn[which]
document.images.norightbtn.src = norightbtn[which]
document.getElementById('imageCaption').innerHTML = caption[which];
playeffect()
keeptrack()
}
}

function transport(){
window.location=gallerylink[which]
}
