﻿function slideshowContainer()
{
    this.slideShows = new Array();
    this.addSlideShow = function(slideshow)
    {
        var i=this.slideShows.length;
        this.slideShows[i]=slideshow;
    }
}

function slideshow(slideshowname)
{
    var imageContainer;

    this.setImageContainer = function(ic)
    {
        imageContainer = ic;
        document.images[imageContainer].src = this.slides[0].src;
    }

    this.slides=new Array(); 
    this.current=0; 

    this.addSlide=function(slide)
    { 
        var i=this.slides.length;
        this.slides[i]=slide;
    }

    this.next = function(link)
    {
        this.current++;
        if(this.current > this.slides.length-1)
            this.current = 0;
        document.images[imageContainer].src = this.slides[this.current].src;
    }

    this.prev = function()
    {
        this.current++;
        if(this.current < 0)
            this.current = 0;
        document.images[imageContainer].src = this.slides[this.current].src;
    }
}

