var slideShowWindow = '';

function backward(){
if (which>0){
which--
/* applyeffect() */
document.images.photoslider.src=photos[which]
document.getElementById('largeImageCaption').innerHTML = descriptions[which];
document.getElementById('largeImageCaption').style.display='block';

/* playeffect() */
keeptrack()
}
}

function forward(){
if (which<photos.length-1){
which++
/* applyeffect() */
document.images.photoslider.src=photos[which]
document.getElementById('largeImageCaption').innerHTML = descriptions[which];
document.getElementById('largeImageCaption').style.display='block';
/* playeffect() */
keeptrack()
}
}

function gohome(){
which = 0
/* applyeffect() */
document.images.photoslider.src=photos[which]
document.getElementById('largeImageCaption').innerHTML = descriptions[which];
document.getElementById('largeImageCaption').style.display='block';
/* playeffect() */
keeptrack()
}


function popImage(thisImage, imageToShow){
if (slideShowWindow != '')
  slideShowWindow.close();

/*
windowWidth=900;
windowHeight=700;
*/

windowWidth=thisImage.width + 20;
windowHeight=thisImage.height + 20;

if (screen.width > 0 && windowWidth > screen.width)
  windowWidth = screen.width;
if (screen.height > 0 && windowHeight > screen.height)
  windowHeight = screen.height;

myleft=(screen.width)?(screen.width-windowWidth)/2:100;
mytop=(screen.height)?(screen.height-windowHeight)/2:100;

properties = "width="+windowWidth+",height="+windowHeight+",scrollbars=yes, top="+mytop+",left="+myleft+"resizable=1, status=0";
slideShowWindow = window.open(imageToShow, "slideShowWindow", properties);
slideShowWindow.focus();

/* window.location=photoslink[which] */
}

function transport(){
if (slideShowWindow != '')
  slideShowWindow.close();

/*
windowWidth=900;
windowHeight=700;
*/

thisImage = new Image;
thisImage.src = photoslink[which];
thisImage.onload = function()
  {
    popImage(thisImage, photoslink[which]);
  }


/* window.location=photoslink[which] */
}

/*
var preloadedimages=new Array()
for (i=0;i<photos.length;i++){
preloadedimages[i]=new Image()
preloadedimages[i].src=photos[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 "+photos.length
}

