// JavaScript Document

/***********************************************
  * DHTML slideshow script-  © Dynamic Drive DHTML code library (www.dynamicdrive.com)
  * This notice must stay intact for legal use
  * Visit http://www.dynamicdrive.com/ for full source code
  ***********************************************/


  //Specify whether images should be linked or not (1=linked)
  var linkornot=1

  //do NOT edit pass this line

  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
  }

  function backward() {
    if (which>0){
      which--
      applyeffect()
      document.images.photoslider.src=photos[which]
	  document.getElementById('slideshowlink').href = photoslink[which]
	  document.getElementById('slideshowlink').title = photosdesc[which]
	  var thisdesc;
	  if (photosdesc[which].length > 125) {
	    thisdesc = photosdesc[which].substring(0, 125) + '...';
	  }
	  else {
	    thisdesc = photosdesc[which];
	  }
	  document.getElementById('photoDescInTableCell').innerHTML = '<p style="margin: 0; padding: 0; font-size: 11px;">' 
	                                                              +thisdesc + '</p>';
      playeffect()
      keeptrack()
    }
  }

  function forward() {
    if (which<photos.length-1) {
      which++
      applyeffect()
      document.images.photoslider.src=photos[which]
	  document.getElementById('slideshowlink').href = photoslink[which]
	  document.getElementById('slideshowlink').title = photosdesc[which]
	  var thisdesc;
	  if (photosdesc[which].length > 125) {
	    thisdesc = photosdesc[which].substring(0, 125) + '...';
	  }
	  else {
	    thisdesc = photosdesc[which];
	  }
	  document.getElementById('photoDescInTableCell').innerHTML = '<p style="margin: 0; padding: 0; font-size: 11px;">' 
	                                                              +thisdesc + '</p>';
      playeffect()
      keeptrack()
    }
  }

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