function slideshow(padivElement)
{


	this.init=function(){
		this.previousElement=document.createElement("input");
		this.previousElement.type="button";
		this.previousElement.value="";
		this.previousElement.className="up";
		this.previousElement.slideshow=this;
		this.previousElement.onclick=this.previous;
		this.previousElement.classNameOver="upover";
		this.previousElement.classNameOut=this.previousElement.className;
		this.previousElement.onmouseover=this.over;
		this.previousElement.onmouseout=this.out;
		this.divElement.appendChild(this.previousElement);

		this.imgElement=document.createElement("img");
		this.divElement.appendChild(this.imgElement);

		this.nextElement=document.createElement("input");
		this.nextElement.type="button";
		this.nextElement.value="";
		this.nextElement.className="down";
		this.nextElement.slideshow=this;
		this.nextElement.onclick=this.next;
		this.nextElement.classNameOver="downover";
		this.nextElement.classNameOut=this.nextElement.className;
		this.nextElement.onmouseover=this.over;
		this.nextElement.onmouseout=this.out;
		this.divElement.appendChild(this.nextElement);
		

	}

	this.add_images=function(paimages){
		this.myimages=paimages;
		this.imgElement.src=this.myimages[0];
		this.current=0;
	}


	this.next=function(){
		this.slideshow.current++;
		if (this.slideshow.current==this.slideshow.myimages.length) this.slideshow.current=0;
		if (!this.slideshow.myimageso[this.slideshow.current]) {
			this.slideshow.myimageso[this.slideshow.current]=new Image();
			this.slideshow.myimageso[this.slideshow.current].src=this.slideshow.myimages[this.slideshow.current];
			}
		this.slideshow.imgElement.src=this.slideshow.myimageso[this.slideshow.current].src;
	}
	this.previous=function(){
		this.slideshow.current--;
		if (this.slideshow.current==-1) this.slideshow.current=this.slideshow.myimages.length-1;
		if (!this.slideshow.myimageso[this.slideshow.current]) {
			this.slideshow.myimageso[this.slideshow.current]=new Image();
			this.slideshow.myimageso[this.slideshow.current].src=this.slideshow.myimages[this.slideshow.current];
			}
		this.slideshow.imgElement.src=this.slideshow.myimageso[this.slideshow.current].src;
	}
	this.over=function(){
		this.className=this.classNameOver;
	}

	this.out=function(){
	this.className=this.classNameOut;
		
	}



this.divElement=padivElement;
padivElement.slideshow=this;
this.myimages=new Array();
this.myimageso=new Array();

if (!this.imgElement) this.init();

//this.divElement.onclick=this.next;
slideshow.prototype.item[slideshow.prototype.count]=this;
slideshow.prototype.count++;
}

slideshow.prototype.count=0;
slideshow.prototype.item=new Array();
