/**
 * object for slideshows logo
 *
 * MB mode - login page
 */
var SlideshowsLogo = {

	/**
	 * numer of last image
	 */
	maxLogo: 4,

    /**
     * numer of current image
     */
	currentLogo: 1,

	/**
	 * time of delay (milisec)
	 */
	delayTime: 6000,

    /**
     * show first image
     */
	init: function()
    {
		if (!Ext.get('logo' + this.currentLogo)) {
			return;
		}
        Ext.get('logo' + this.currentLogo).setDisplayed(true);
        window.setInterval('SlideshowsLogo.showNexLogo()', this.delayTime);
    },

    /**
     * function show next image of slideshows
     */
    showNexLogo: function() {
        this.currentLogo++;
        if (this.currentLogo > this.maxLogo) {
            this.currentLogo = 1;
        }
        this.hideAllLogo();
        Ext.get('logo' + this.currentLogo).setDisplayed(true);
    },

    /**
     * hide all images
     */
    hideAllLogo: function() {
        for (i=1; i<=this.maxLogo; i++) {
        	Ext.get('logo' + i).setDisplayed(false);
        }
    }
};

Ext.onReady(function(){SlideshowsLogo.init()});
