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;
    }


function BannerRegistry_addBanner( banner )
    {
        this.m_Banner[this.m_Banner.length] = banner;
    }

function BannerRegistry_showNextBanner()
    {
       
        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() );
    }

    function BannerRegistry_showCurrent()
    {
        window.location.href = this.m_Banner[this.m_BannerIndex].getUrl();
    }

    function BannerRegistry_applyCurrent( link )
    {
        link.href = this.m_Banner[this.m_BannerIndex].getUrl();
        link.target = this.m_Banner[this.m_BannerIndex].getTarget();
    }

function Banner()
    {
        this.m_Image = '';
        this.m_Url = '';
        this.m_DisplayTime = 10000;

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

    function Banner_setImage( image )
    {
        this.m_Image = bannerPath + '/' + image;
    }

    function Banner_getImage()
    {
        return this.m_Image;
    }

    function Banner_setUrl( url )
    {
        this.m_Url = url;
    }

    function Banner_getUrl()
    {
        return this.m_Url;
    }

    function Banner_setDisplayTime( displayTime )
    {
        this.m_DisplayTime = displayTime;
    }

    function Banner_getDisplayTime()
    {
        return this.m_DisplayTime;
    }


window.bannerRegistry = new BannerRegistry();

    var b_sport = new Banner();
    b_sport.setImage( 'sportministerium.jpg' );
    b_sport.setUrl( 'http://www.sport.austria.gv.at' );
    b_sport.setDisplayTime( 10000 );
    bannerRegistry.addBanner( b_sport );

    var b_adidas = new Banner();
    b_adidas.setImage( 'adidas.gif' );
    b_adidas.setUrl( 'http://www.adidas.at' );
    b_adidas.setDisplayTime( 10000 );
    bannerRegistry.addBanner( b_adidas );

    var b_skoda = new Banner();
    b_skoda.setImage( 'skoda.jpg' );
    b_skoda.setUrl( 'http://www.skoda.at' );
    b_skoda.setDisplayTime( 10000 );
    bannerRegistry.addBanner( b_skoda );

if ( document.images )
{
	bannerRegistry.showNextBanner();
}
