function slideshow(name,max,slideheight){
  this.name = name;
  this.maximum = max;
  this.slideheight = slideheight;
  for (var i = 0; i <= max; i++) {
	  this.currentslide = i;
	  this.hidecurrentslide();
  }
  this.currentslide = 1;
}

slideshow.prototype.next = function (){
  this.hidecurrentslide();
  this.currentslide ++;
  if (this.currentslide > this.maximum) {
    this.currentslide = 1;
  }
  this.displaycurrentslide(); 
}

slideshow.prototype.shownum = function (slidenum){
  this.hidecurrentslide();
  this.currentslide = slidenum;
  this.displaycurrentslide(); 
}


slideshow.prototype.prev = function (){
  this.hidecurrentslide();
  this.currentslide --;
  if (this.currentslide < 1){
    this.currentslide = this.maximum;
  } 
  this.displaycurrentslide(); 
}

slideshow.prototype.hidecurrentslide = function (){
  var b = document.getElementById(this.name+this.currentslide);
  if (b != null){
    b.style.visibility = "hidden";
    b.style.height = 0;
    b.style.display="none";
  }  
}

slideshow.prototype.displaycurrentslide = function (){
  var b = document.getElementById(this.name+this.currentslide);
  if (b != null){
	b.style.display = "";
    b.style.visibility = "visible";
    b.style.height = this.slideheight;
  }  
}

function open_credit_win()
{
window.open("PhotoCredits.htm","_blank","toolbar=no, location=yes, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=500, height=300");
}

function open_termdates_win()
{
window.open("TermDates2010.htm","_blank","toolbar=no, location=yes, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=700, height=250");
}

function open_jobs_win()
{
window.open("WorkAtAmbleside.htm","_blank","toolbar=no, location=yes, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=660, height=325");
}
