
function clsSlideShow(p)
{
   // change of pictures in milliseconds
   this.refresh = 5000;
   // Duration of crossfade (seconds)
   this.crossFadeDuration = 2;
   // Array of pictures
   this.arrPics = new Array();
   this.index = 0;
   this.timeout;
   this.url = "";
   this.timer;
   
   //image id so we can have multiple images - default is SlideShow so it doesnt break old stuff
   this.imageID = "SlideShow"; 
   
   //image id so we can have multiple images - default is SlideShow so it doesnt break old stuff
   this.instanceName = "slideShow"; 
   
   
   this.getImgObj = function()
   {
      return eval("document.images." + this.imageID); 
   };
   
   
   this.initialize = function()
   {
      clearInterval(this.timer);
      for(a=0;a<p.length;a++)
      {
         this.arrPics[a] = new Image();
         this.arrPics[a].src = p[a];
      }
      this.run();
      
      if(this.url.length == 0)
      {
         oParent = this.getImgObj().parentNode;
         oParent.setAttribute("onClick", "");
         oParent.setAttribute("onMouseOver", "");
      }
   };
   
   this.run = function()
   {
      if (document.all)
      {
         this.getImgObj().style.filter="blendTrans(duration=1)";
         this.getImgObj().filters.blendTrans.Apply();
      }
      this.getImgObj().src = this.arrPics[this.index].src;
  
      if (document.all)
      {
         this.getImgObj().filters.blendTrans.Play();
      }
      this.index = (((this.index+1)>=p.length)?0:this.index+1);
      var sMyString = this.instanceName  + '.run()'
      this.timeout = setTimeout(sMyString, this.refresh);
   };
   
   this.openPicture = function()
   {
      if(this.url.length > 0)
      {
         fileName = this.getImgObj().src;
         fileName = fileName.substr(fileName.lastIndexOf("/")+1);
         window.open("showPic.asp?pic=" + this.url + fileName, "pic", "menu=no height=1 width=1");
      }
   };
   
   //var sMyString = this.instanceName  + '.initialize()'
   //this.timer = setInterval(sMyString, 2000);   
}//end class
