
    function Wfp2Marquee(id_marqueeContent, scrollSpeed, numContentRepeats) {
        this.id_marqueeContent  = id_marqueeContent;
        this.scrollSpeed        = scrollSpeed;
        this.numContentRepeats  = numContentRepeats;

        this.marqueeContentElem = null;
        this.contentWidth       = null;
        this.singleContentWidth = null;
        this.currentX           = null;
    };

    Wfp2Marquee.prototype = {
        onLoadInit: function () {
            this.marqueeContentElem = document.getElementById(this.id_marqueeContent);
            this.contentWidth       = this.marqueeContentElem.clientWidth;
            this.singleContentWidth = this.contentWidth / this.numContentRepeats;
            this.currentX = parseInt(this.marqueeContentElem.offsetLeft, 10);
        },

        updateAnimation: function (timePassed) {
            this.currentX += timePassed * this.scrollSpeed;
            if (Math.abs(this.currentX) > this.singleContentWidth) {
                if (this.currentX < 0) {
                    this.currentX += this.singleContentWidth;
                } else if ( this.currentX > 0 ) {
                    this.currentX -= this.singleContentWidth;
                }
            }
            this.marqueeContentElem.style.left = "" + this.currentX + "px";
        }
    };

    function Wfp2AnimationManager(interval) {
        //this.that = this;
        this.interval = interval;
        this.lastTickDate = null;
        this.listeners = [];
    };

    Wfp2AnimationManager.prototype = {
        addListener: function(listener) {
            this.listeners.push(listener);
        },

        start: function() {
            var currentInstance = this;
            window.setInterval(
                function(){
                    currentInstance.updateAnimations();
                },
                this.interval
            );
        },

        updateAnimations: function() {
            // figure out how much time has been spend since last call

            var timePassed = 0;
            var newDate;

            if (!this.lastTickDate) {
                // first call, nothing happend / no time spent yet
                // only save current date
                this.lastTickDate = new Date();
                return;
            } else {
                // get number of ms since last call
                var newDate = new Date();
                timePassed = newDate.getTime() - this.lastTickDate.getTime();
                // new last call date is current time
                this.lastTickDate = newDate;
            }

            // call animated objects

            for (var z0 = 0, len = this.listeners.length; z0 < len; z0++) {
                this.listeners[z0].updateAnimation(timePassed);
            }
        }
    };