<!-- Hide script from old browsers
// ==============================
// Do not edit
// ==============================

//--------------------------------------------------
  
function slide(src,link,text,counter) {
  // This is called automatically when you create a new slide object.

  // Image URL
  this.src = src;

  // Link URL
  this.link = link;

  // Text to display
  this.text = text;

  // Counter to display
  this.counter = counter;  
  
  // Create an image object for the slide
  if (document.images) {
    this.image = new Image();
  }

  // Flag to tell when load() has already been called
  this.loaded = false;

  //--------------------------------------------------
  
  this.load = function() {
    // This method loads the image for the slide

    if (!document.images) { return; }

    if (!this.loaded) {
      this.image.src = this.src;
      this.loaded = true;
    }
  }

  //--------------------------------------------------
  
  this.hotlink = function() {
    // This method jumps to the slide's link.

    var mywindow;

    // If this slide does not have a link, do nothing
    if (!this.link) return;

 {
      // Open the link in the current window
      location.href = this.link;
    }
  }
}

  //--------------------------------------------------
  
function slideshow( slideshowname ) {
  // This is called automatically when you create a new object.

  // Name of this object
  this.name = slideshowname;

  // loop around to start the slideshow again?
  this.repeat = true;

  // Number of images to pre-fetch.
  this.prefetch = -1;

  // IMAGE element on your HTML page.
  this.image;

  // ID of a DIV element on the HTML page that will contain the text.
  this.textid;

  // textarea element on the HTML page.
  this.textarea;
  
  // ID of a DIV element on the HTML page that will contain the counter.
  this.counterid;

  // counterarea element on the HTML page.
  this.counterarea;

  // Milliseconds to pause between slides.
  this.timeout = 3000;

  // Private variables
  this.slides = new Array();
  this.current = 0;
  this.timeoutid = 0;

  //--------------------------------------------------

  this.add_slide = function(slide) {
    // Add a slide to the slideshow. 
    var i = this.slides.length;
  
    // Prefetch the slide image if necessary
    if (this.prefetch == -1) {
      slide.load();
    }

    this.slides[i] = slide;
  }
  
  //--------------------------------------------------
	
  this.update = function() {
    // Updates the slideshow image on the page

    // To make sure the slideshow has been initialized correctly
    if (! this.valid_image()) { return; }
  
    // Convenience variable for the current slide
    var slide = this.slides[ this.current ];

    // Determine if the browser supports filters
    var dofilter = false;
    if (this.image &&
        typeof this.image.filters != 'undefined' &&
        typeof this.image.filters[0] != 'undefined') {
		
      dofilter = true;
    }

    // Load the slide image if necessary
    slide.load();
  
    // Apply the filters for the image transition
    if (dofilter) {

      // If the user has specified a custom filter for this slide, then set it now
      if (slide.filter &&
          this.image.style &&
          this.image.style.filter) {

        this.image.style.filter = slide.filter;

      }
      this.image.filters[0].Apply();
    }

    // Update the image.
    this.image.src = slide.image.src;

    // Play the image transition filters
    if (dofilter) {
      this.image.filters[0].Play();
    }

    // Update the text
    this.display_text();
	
    // Update the counter
    this.display_counter();	

    // Do we need to pre-fetch images?
    if (this.prefetch > 0) {

      var next, prev, count;

      // Pre-fetch the next slide image(s)
      next = this.current;
      prev = this.current;
      count = 0;
      do {

        // Get the next and previous slide number, if necessary Loop past the ends of the slideshow
        if (++next >= this.slides.length) next = 0;
        if (--prev < 0) prev = this.slides.length - 1;

        // Preload the slide image
        this.slides[next].load();
        this.slides[prev].load();

      } while (++count < this.prefetch);
    }
  }

  //--------------------------------------------------
  
  this.goto_slide = function(n) {
    // This method jumpts to the slide number specified.
  
    if (n == -1) {
      n = this.slides.length - 1;
    }
  
    if (n < this.slides.length && n >= 0) {
      this.current = n;
    }
  
    this.update();
  }
  
    //--------------------------------------------------
	
  this.forward = function() {
    // Advances to the next slide.
	
    if (this.current < this.slides.length - 1) {
      this.current++;
    }

    this.update();
  }

  //--------------------------------------------------
  
  this.back = function() {
    // Goes to the previous slide.
  
    if (this.current > 0) {
      this.current--;
    }
  
    this.update();
  }
    //--------------------------------------------------
	
  this.get_text = function() {
    // Returns the text of the current slide
  
    return(this.slides[ this.current ].text);
  }

  //--------------------------------------------------
  
  this.display_text = function(text) {
    // Display the text for the current slide

    if (!text) {
      text = this.slides[ this.current ].text;
    }
  
    // If a textarea has been specified, change the text displayed
    if (this.textarea && typeof this.textarea.value != 'undefined') {
      this.textarea.value = text;
    }

    // If a text id has been specified, change the contents of the HTML element
    if (this.textid) {

      r = this.getElementById(this.textid);
      if (!r) { return false; }
      if (typeof r.innerHTML == 'undefined') { return false; }

      // Update the text
      r.innerHTML = text;
    }
  }
    //--------------------------------------------------
	
  this.get_counter = function() {
    // Returns the counter of the current slide
  
    return(this.slides[ this.current ].counter);
  }
  //--------------------------------------------------
  
  this.display_counter = function(counter) {
    // Display the counter for the current slide

    if (!counter) {
      counter = this.slides[ this.current ].counter;
    }
  
    // If a counterarea has been specified, change the counter displayed
    if (this.counterarea && typeof this.counterarea.value != 'undefined') {
      this.counterarea.value = counter;
    }

    // If a counter id has been specified, change the contents of the HTML element
    if (this.counterid) {

      r = this.getElementById(this.counterid);
      if (!r) { return false; }
      if (typeof r.innerHTML == 'undefined') { return false; }

      // Update the counter
      r.innerHTML = counter;
    }
  }
  
  //--------------------------------------------------
  
  this.hotlink = function() {
    // This method calls the hotlink() method for the current slide.
  
    this.slides[ this.current ].hotlink();
  }

  //--------------------------------------------------
  
  this.save_position = function(cookiename) {
    // Saves the position of the slideshow in a cookie.
  
    if (!cookiename) {
      cookiename = this.name + '_slideshow';
    }
  
    document.cookie = cookiename + '=' + this.current;
  }

  //--------------------------------------------------
  
  this.restore_position = function(cookiename) {
  // If you previously called slideshow_save_position(),
  // returns the slideshow to the previous state.
  
    if (!cookiename) {
      cookiename = this.name + '_slideshow';
    }
	
    var search = cookiename + "=";
  
    if (document.cookie.length > 0) {
      offset = document.cookie.indexOf(search);
      // if cookie exists
      if (offset != -1) { 
        offset += search.length;
        // set index of beginning of value
        end = document.cookie.indexOf(";", offset);
        // set index of end of cookie value
        if (end == -1) end = document.cookie.length;
        this.current = parseInt(unescape(document.cookie.substring(offset, end)));
        }
     }
  }

  //--------------------------------------------------
  
  this.noscript = function() {
   
    $html = "\n";
  
    // Loop through all the slides in the slideshow
    for (i=0; i < this.slides.length; i++) {
  
      slide = this.slides[i];
  
      $html += '<P>';
  
      if (slide.link) {
        $html += '<a href="' + slide.link + '">';
      }
  
      $html += '<img src="' + slide.src + '" ALT="slideshow image">';
  
      if (slide.link) {
        $html += "<\/a>";
      }
  
      if (slide.text) {
        $html += "<BR>\n" + slide.text;
      }
  
      $html += "<\/P>" + "\n\n";
    }
  
    // Make the HTML browser-safe
    $html = $html.replace(/\&/g, "&amp;" );
    $html = $html.replace(/</g, "&lt;" );
    $html = $html.replace(/>/g, "&gt;" );
  
    return('<pre>' + $html + '</pre>');
  }

  //--------------------------------------------------
  
  this.loop = function() {
    // This method is for internal use.

    if (this.current < this.slides.length - 1) {
      next_slide = this.slides[this.current + 1];
      if (next_slide.image.complete == null || next_slide.image.complete) {
        this.next();
      }
    } else { 
      this.next();
    }    
    this.play( );
  }

  //--------------------------------------------------
  
  this.valid_image = function() {
  
    if (!this.image)
    {
      return false;
    }
    else {
      return true;
    }
  }

  //--------------------------------------------------
  
  this.getElementById = function(element_id) {

    if (document.getElementById) {
      return document.getElementById(element_id);
    }
    else if (document.all) {
      return document.all[element_id];
    }
    else if (document.layers) {
      return document.layers[element_id];
    } else {
      return undefined;
    }
  }  
}

// End hiding script from old browsers -->