// Photo Gallery
 var typeEffect  = 2;
 var effect = [null,4,5,6,7,17,19,18,20,13];  //start[counter=1] - only if I want different type of effect - <= totalPhotos

 var timer      = null;
 var counter    = 0;

 var pic = new Array();

 function loadPictures()
 {
    window.onerror = handleError;
    for (var i=1; i <= totalPhotos; i++)
    {
       pic[i]         = new Image();
       pic[i].src     = pathPhotos + i + ".jpg";
    }
    slideshow();
 }


function slideshow()
{

 timer=setTimeout("slideshow()", 3500);

 counter++;
 if (counter > totalPhotos)
     counter = 1;

 if (document.all) // IE
 {
      typeEffect = effect[counter];
	  document.picture.style.filter = "blendTrans(duration=1.5) revealTrans(duration=1,transition=" + typeEffect + ")";

      document.picture.filters(0).apply(); //select-apply effect
      document.picture.filters(1).apply(); //select-apply effect

	  document.picture.src = pic[counter].src;
   // document.getElementById("photoText").innerHTML = textPhotos[counter];

      document.picture.filters(0).play(); //show-play effect
	  document.picture.filters(1).play(); //show-play effect

	 }
	 else  // NN
	 {
	  document.picture.src = pic[counter].src;
   // document.getElementById("photoText").innerHTML = textPhotos[counter];

     }

      document.btnPlay.style.display = "none";
      document.btnPause.style.display = "block";
 }


// show picture in the slice show and pause the slide show
   function changePicture(i)
   {
      counter = i;
      var photo = pic[i].src;
	  document.picture.src = photo;
	  clearTimeout(timer);
      document.btnPlay.style.display = "block";
      document.btnPause.style.display = "none";
   }


// Pause slide show
function pauseSlideShow() {
   clearTimeout(timer);
   document.btnPlay.style.display = "block";
   document.btnPause.style.display = "none";
}

//Suppresses the normal JavaScript error dialogs if a problem arises
//when trying to load the specified image
function handleError() {
  window.status="";
  return true;
}





