/* Bannerwechsel by Andreas Zierhut */

    /* Registry for all banners. */
    function BannerRegistry(){
        this.m_Initial = true;
        this.m_BannerIndex = 0;
        this.m_Banner = new Array();

        this.addBanner = BannerRegistry_addBanner;
        this.showNextBanner = BannerRegistry_showNextBanner;
        this.showCurrent = BannerRegistry_showCurrent;
        this.applyCurrent = BannerRegistry_applyCurrent;
    }

    /* Add the banner to the registry.
     * @param banner the banner */
    function BannerRegistry_addBanner( banner ){
        this.m_Banner[this.m_Banner.length] = banner;
    }

    /* Display the next banner image and remember the current banner position in the registry. */
    function BannerRegistry_showNextBanner(){
        /** show the first banner for display time milli seconds */
        if ( this.m_Initial ){
            this.m_Initial = false;
            window.setTimeout( 'bannerRegistry.showNextBanner()', this.m_Banner[this.m_BannerIndex].getDisplayTime() );
            return;
        }

        if ( ++this.m_BannerIndex == this.m_Banner.length ){
            this.m_BannerIndex = 0;
        }

        var currentBanner = this.m_Banner[this.m_BannerIndex];
        document.images['banner'].src = currentBanner.getImage();

        window.setTimeout( 'bannerRegistry.showNextBanner()', currentBanner.getDisplayTime() );
    }

    /* Returns the url of the current banner.
     * @return the url of the current banner */
    function BannerRegistry_showCurrent(){
        window.location.href = this.m_Banner[this.m_BannerIndex].getUrl();
    }

    /* Apply the url and target of the current banner to the given link. */
    function BannerRegistry_applyCurrent( link ){
        link.href = this.m_Banner[this.m_BannerIndex].getUrl();
        link.target = this.m_Banner[this.m_BannerIndex].getTarget();
    }

    /* One banner with image, url, tooltip and display time. */
    function Banner(){
        this.m_Image = '';
        this.m_Url = '';
        this.m_Target = '';
        this.m_DisplayTime = 6000;

        this.setImage = Banner_setImage;
        this.getImage = Banner_getImage;
        this.setUrl = Banner_setUrl;
        this.getUrl = Banner_getUrl;
        this.setTarget = Banner_setTarget;
        this.getTarget = Banner_getTarget;
        this.setDisplayTime = Banner_setDisplayTime;
        this.getDisplayTime = Banner_getDisplayTime;
    }

    /* Set the path to the image of the banner.
     * @param image the path to the image */
    function Banner_setImage( image ){ this.m_Image = image; }

    /* Returns the path to the image of the banner.
     * @return the path to the image */
    function Banner_getImage(){ return this.m_Image; }

    /* Sets the url.
     * @param url the url */
    function Banner_setUrl( url ){ this.m_Url = url; }

    /* Returns the url.
     * @return the url */
    function Banner_getUrl(){ return this.m_Url; }

    /* Sets the target.
     * @param target the target */
    function Banner_setTarget( target ){ this.m_Target = target; }

    /* Returns the target.
     * @return the target */
    function Banner_getTarget(){ return this.m_Target; }

    /* Sets the display time in milli seconds.
     * @param displayTime the display time */
    function Banner_setDisplayTime( displayTime ){ this.m_DisplayTime = displayTime; }

    /* Returns the display time in milli seconds.
     * @return the display time */
    function Banner_getDisplayTime(){ return this.m_DisplayTime; }