
/*

POKDynScroll is a slideshow object to be embedded in a HTML page.

author: mAd (Damien Terrier, dterrier@hfp.fr)

date: 14/01/2001 14:21

bugs: 

Not known bug so far



comments: 

- the image to be replaced is the only parameter to give when creating an new object (or otherwise, change this behaviour by yourself)
to be completed, to be documented

*/ 

var HtmlArray  = new Array(2);

HtmlArray[0] = "<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\" color=\"#333333\">"

HtmlArray[1] = "</font>"



function POKDynSlideshow (name) {

	this.name = name;

	this.lowerbound = 1;

	this.upperbound = 7;

	this.current = 1;

	this.has_text = false;

	this.updating = false;

	this.text = new Array(this.upperbound);

	for (i = 0; i <= (this.upperbound); i++)

		this.text[i] = "";

}

POKDynSlideshow.prototype.go = function(myimage) {

	if (this.current != myimage) {

	this.current = myimage;

	this.update();

	}

}

POKDynSlideshow.prototype.next = function() {

	if ((this.current + 1) > this.upperbound)

		this.current = this.lowerbound;

	else

		this.current += 1;

	this.update();

}

POKDynSlideshow.prototype.previous = function() {

	if ((this.current - 1) < this.lowerbound)

		this.current = this.upperbound;

	else

		this.current -= 1;

	this.update();

}

POKDynSlideshow.prototype.update = function () {

	this.update_image(this.current);

	
	if (this.has_text)

		this.update_text(this.current);

}



POKDynSlideshow.prototype.update_image = function(image) {

//	document.images[this.name].src = "images/medium/" + this.current + ".jpg";
	var cImage = mPicArr[this.current]
//	document.images[this.name].src = "images/medium/" + cImage + ".jpg";
	document.images[this.name].src = cImage;
}



POKDynSlideshow.prototype.update_text = function(image)  { // image is an int

  var Content = new String();

  Content = HtmlArray[0]+ this.text[image] + HtmlArray[1];

  if (document.layers)

  {

    with (document[this.name + "_text"].document) 

    {

      open();

      write(Content);

      close();

    }  

  } 

  else

    document.all[this.name + "_text2"].innerHTML = Content;   

} // End function update

