function FlipBook( myDiv )
{
  this.images = new Array();
  this.add = FlipBook__Add;
  this.n = 0;
  this.target = myDiv;
  this.next = FlipBook__Next;
  this.previous = FlipBook__Previous;
}

function FlipBook__Add( imageref )
{
  var j = this.images.length;
  this.images[j] = new Image(227,147);
  this.images[j].src = imageref;
}

function FlipBook__Next()
{
  this.n++;
  if (this.n >= this.images.length)
  {
    this.n = 0;
  }

  document[this.target].src = this.images[this.n].src;
  return false;
}

function FlipBook__Previous()
{
  this.n--;
  if (this.n < 0)
  {
    this.n = this.images.length - 1;
  }

  document[this.target].src = this.images[this.n].src;
  return false;
}
