/**
 * Fichier  : /share/sdmc/interne/layoutftv/arches/common/jsdev/EasyPrototype/libs/EasyPrototype.js
 * Revision : 76
 */
(function (window, undef) {

    function getPurObject(obj, proto) {
        var objPur = {},
            gotSlots = false,
            allSlots = true,
            slot;

        for (slot in obj) {
            // we skip the "constructor" slot, witch is an exception.
            // If a slot is the same on the object and on his prototype, than this slot is
            // inherited, so we skip it
            if (
                slot === 'constructor' ||
                proto &&
                slot in proto &&
                proto[slot] === obj[slot]
            ) {
                // We skip a slot, so we remember that not all slots are kept
                allSlots = false;
                continue;
            }

            objPur[slot] = obj[slot];
            gotSlots = true;
        }

        // (For IE) Check if the "toString" method exists and is different from the native Object toString method
        if ( obj.toString && obj.toString !== ({}).toString ) {
            if (!(proto && proto.toString === obj.toString)) {
                objPur.toString = obj.toString;
                gotSlots = true;
            }
            else {
                allSlots = false;
            }
        }

        return allSlots ? obj : gotSlots ? objPur : undef;
    }

    function getPurPrototypes(obj) {
        if(!obj || obj === EasyPrototype.prototype) {
            return [];
        }

        var proto = 'constructor' in obj && obj.constructor !== ({}).constructor && obj.constructor.prototype !== obj && obj.constructor.prototype,
            purProtos = getPurPrototypes(proto),
            purObj = getPurObject(obj, proto);

        if(purObj) {
            purProtos.push(purObj);
        }

        return purProtos;
    }



    function initConstructor() {

        // On recoit différents types d'arguments :
        // - string : le nom de la nouvelle classe crée
        // - null : Ca veut dire qu'on ne veut pas de ProtoClass, même pas EasyPrototype
        // - 1ere function : C'est une ProtoClass si pas de ProtoClass null, sinon c'est une "interface"
        // - functions sauf 1ere : c'est une "interface"
        // - array : C'est la liste des méthodes abstraites
        // - dernier autre : C'est le prototype
        // - autres sauf dernier : Ce sont des "interfaces" a implémenter

        var args = arguments,
            className,
            ProtoClass,
            proto,
            abstracts,
            abstractsProto,
            interfaces = [],
            implementList = [],
            interfaceName,
            type,
            rest,
            i = args.length;

        // On parcours l'objet arguments pour répartir les données entre className, protoClass, interface, proto et abstracts
        while (i--) {
            type = typeof args[i];
            if(type === 'string') {
                className = args[i];
            }
            else if (args[i] === null) {
                ProtoClass = null;
            }
            else if (args[i] instanceof Array) {
                abstracts = args[i];
            }
            else if(proto === undef && type !== 'function') {
                proto = args[i];
            }
            else if (args[i] !== undef) {
                if(type === 'function' && ProtoClass !== null) {
                    ProtoClass = args[i];
                }
                implementList.push(args[i]);
            }
        }

        className = className || (proto && proto.className) || 'unNamedClass';

        i = implementList.length;
        while (i--) {
            if(typeof implementList[i] === 'function') {
                if('implementList' in implementList[i]) {
                    implementList.push.apply(implementList, implementList[i].implementList);
                    if(implementList[i] !== ProtoClass && implementList[i].implementList[implementList[i].implementList.length - 1] === EasyPrototype.prototype) {
                        implementList.length--;
                    }
                }
                interfaceName = implementList[i].className;
                implementList[i] = implementList[i].prototype;
            }
            else if('constructor' in implementList[i]) {
                if('prototype' in implementList[i].constructor && 'className' in implementList[i].constructor) {
                    implementList.push(implementList[i].constructor.prototype);
                    if('implementList' in implementList[i].constructor) {
                        implementList.push.apply(implementList, implementList[i].constructor.implementList);
                    }
                }
            }
            if(ProtoClass && implementList[i] === ProtoClass.prototype) {
                continue;
            }
            if(interfaceName) {
                interfaces.push(interfaceName);
                interfaceName = undef;
            }
            interfaces.push.apply(interfaces, getPurPrototypes(implementList[i]));
        }

        // If ProtoClass not defined and not null we use EasyPrototype as the ProtoClass and
        // register it as an interface
        if(ProtoClass !== (ProtoClass || null)) {
            ProtoClass = EasyPrototype;
            implementList.push(EasyPrototype.prototype);
        }

        if(implementList.length) {
            this.implementList = implementList;
        }
        // Here we implement all interfaces
        i = interfaces.reverse().length;
        while (i--) {
            if(typeof interfaces[i] === 'string') {
                interfaceName = interfaces[i];
            }
            else {
                ProtoClass = createProtoClass(className + '>' + interfaceName, ProtoClass, interfaces[i]);
            }
        }



        // If proto contains a slot called __statics__, all slots in it will be added to the
        // constructor as static values, and the __statics__ slot will be removed
        if(proto && '__statics__' in proto) {
            for (i in proto.__statics__) {
                if(proto.__statics__[i] === true && i in proto) {
                    this[i] = proto[i];
                }
                else {
                    this[i] = proto.__statics__[i];
                }
            }
            delete proto.__statics__;
        }

        // Building the final prototype object
        if (ProtoClass) {
            ProtoClass.createPrototype = true;
            proto = new ProtoClass(proto);
        }

        this.prototype = proto;

        this.contains = EasyPrototype.prototype.contains;
        this.getConstructor = EasyPrototype.prototype.getConstructor;
        this.toString = EasyPrototype.prototype.toString;


        this.className = className;

        return this;
    }

    function initPrototype(proto) {
        var slot;

        if (proto !== undef && proto !== null) {
            // On complète notre nouvel objet vide avec le contenu du prototype
            for (slot in proto) {
                if ((!(slot in this)) || this[slot] !== proto[slot]) {
                    this[slot] = proto[slot];
                }
            }

            // Specific for IE that doesn't go through "toString" during a "for in" sequence
            if (proto.toString &&
               proto.toString !== ({}).toString &&
               proto.toString !== this.toString) {
                this.toString = proto.toString;
            }
        }
    }

    function initInstance() {
        var instance;

        this.instanceNum = this.constructor.instancesCount || 0;

        this.constructor.instancesCount = this.instanceNum + 1;

        // On retourne le résultat de la méthode "init". Si la valeur de retour est d'un type
        // élémentaire (bool, int, string, undefined, null), cette valeur ne sera pas
        // retournée (fonctionnement de javascript). Si la valeur de retour en revanche est un
        // objet, alors c'est cet objet qui sera retourné au lieu de la nouvelle instance tout
        // juste créée
        instance = ('getInstance' in this) && this.getInstance.apply(this, arguments);

        if ((!instance || instance === this) && 'init' in this) {
            instance = this.init.apply(this, arguments);
        }

        // Si on construit une nouvelle instance (pas de résultat à getInstance) et qu'une méthode
        // destroy existe on met en place le processus de destruction au window.unload
        if ((!instance || instance === this) && 'destroy' in this) {
            // On window unload, call destroy method
            if (window.addEventListener) {
                window.addEventListener('unload', this.callback('destroy'), false);
            }
            else if (window.attachEvent) {
                window.attachEvent('onunload', this.callback('destroy'));
            }
        }

        return instance;
    }

    function commonConstruct(constructor, args) {
        if (!(this instanceof constructor)) {
            constructor.argsAsArray = true;
            return new constructor(args);
        }

        // This slot makes it possible to get the construction function of an
        // object, and than to get the prototype of this construction function
        // So this makes it possible to find the super methods
        this.constructor = constructor;

        if(constructor.argsAsArray) {
            delete constructor.argsAsArray;
            args = args[0];
        }

        if (constructor.createPrototype) {
            delete constructor.createPrototype;
            initPrototype.apply(this, args);
        }
        else {
            return initInstance.apply(this, args);
        }
    }

    // Creates a Class that will always create a prototype object (no init method called on
    // instanciation)
    function createProtoClass() {
        var ProtoClassConstructor = function () {
            ProtoClassConstructor.createPrototype = true;
            return commonConstruct.call(this, ProtoClassConstructor, arguments);
        };

        return initConstructor.apply(ProtoClassConstructor, arguments);
    }

    // Creates a normal Class
    function createClass() {
        var ClassConstructor = function () {
            return commonConstruct.call(this, ClassConstructor, arguments);
        };

        initConstructor.apply(ClassConstructor, arguments);

        // On défini des méthodes de classe génériques
        ClassConstructor.getSuper = EasyPrototype.prototype.getSuper;
        ClassConstructor.execSuper = EasyPrototype.prototype.execSuper;

        // Si la méthode "classSetup" existe, on l'exécute. Cette méthode est destinée à
        // initialiser la classe
        if ('classSetup' in ClassConstructor.prototype) {
            ClassConstructor.prototype.classSetup.call(ClassConstructor);
        }

        return ClassConstructor;
    }

    function callSuper(methodName, currentClass, superClass, args) {
        var result,
            i,
            cls = this.getConstructor(),
            added;

        this._super = this._super || {};
        this._super.length = this._super.length || 0;

        added = methodName in this._super ? 0 : 1;

        this._super[methodName] = superClass;
        this._super.length+= added;

        result = superClass.prototype[methodName].apply(this, args);

        if (!added) {
            this._super[methodName] = currentClass;
        }
        else {
            delete this._super[methodName];
            this._super.length--;

            // On fait un check pour supprimer la propriété _super si elle est complètement vide
            if(!this._super.length) {
                delete this._super;
            }
        }
        return result;
    }

    function getCallback(obj, methodName, forceArgs) {
        var method = obj[methodName];

        if (typeof method !== 'function') {
            throw new Error('The "' + methodName + '" method doesn\'t  exist');
        }

        forceArgs = forceArgs || [];

        function callback() {
            var args = forceArgs.slice(0);
            args.push.apply(args, arguments);

            if (obj[methodName] === callback) {
                return method.apply(obj, args);
            }
            return obj[methodName].apply(obj, args);
        }

        return callback;
    }

    function EasyPrototype(proto) {
        if(!(this instanceof EasyPrototype)) {
            return createClass.apply(this, arguments);
        }

        EasyPrototype.createPrototype = true;
        commonConstruct.call(this, EasyPrototype, arguments);
    }

    initConstructor.call(EasyPrototype, 'EasyPrototype', null, {

        // returns a callback function for the given method
        callback : function callback(methodName) {
            // the callback method is different for each set of given arguments. So it's much
            // more complicated to have a cache solution in the case arguments are given.
            // That's why there's no cache when there's arguments, and so we can return directly
            // the callback function
            if (arguments.length > 1) {
                return getCallback(this, methodName, [].slice.call(arguments, 1));
            }
            if (!('_callbacks' in this)) {
                this._callbacks = {};
            }
            if (!(methodName in this._callbacks)) {
                this._callbacks[methodName] = getCallback(this, methodName);
            }
            return this._callbacks[methodName];
        },

        lazyCallback : function lazyCallback() {
            var obj = this,
                args = arguments,
                delay = 0,
                func,
                rest;

            if (typeof args[1] === 'number') {
                delay = args[1];
                rest = [].slice.call(args, 2);
                args.length = 1;
                rest.push.apply(args, rest);
            }

            func = this.callback.apply(this, args);

            return function lazyCallback() {
                var args = arguments;

                window.setTimeout(function () {
                    func.apply(obj, args);
                }, 0);
            };
        },

        // returns a callback function for the super method if any
        getSuper : function getSuper(methodName, args) {
            var $this = this,
                cls = ('constructor' in this && this.constructor !== Function) ?
                    this.constructor :
                    this,
                originalClass = this.getConstructor(methodName),
                currentClass = originalClass,
                parentClass,
                superClass;

            // Dans le cas d'une instance, currentClass est obligatoirement au moins une méthode du
            // prototype.
            // On doit donc commencer par contrôler que la currentClass n'a pas été surchargée par
            // une méthode sur l'instance, et dans ce cas il faut donc appeler la méthode du
            // currentClass.
            if (cls !== this && currentClass === cls && (!('_super' in this && methodName in this._super)) && currentClass.prototype[methodName] !== this[methodName]) {
                superClass = currentClass;
            }

            while (!superClass) {
                parentClass = 'constructor' in currentClass.prototype &&
                    currentClass.prototype.constructor !== currentClass &&
                    currentClass.prototype.constructor;

                // TODO : Ci après une comparaison est faite entre deux valeurs. Cela
                // pourra poser des problèmes si le slot en question est un getter, car
                // alors cette méthode de comparaison déclenche l'exécution du getter
                // ce qui peut avoir de lourdes concéquences. Il serait préférable donc
                // à ce niveau de vérifier avant tout la présence d'un getter sur le
                // slot
                if (parentClass) {
                    if (!(methodName in parentClass.prototype) ||
                        parentClass.prototype[methodName].is_abstract) {
                        break;
                    }

                    if (parentClass.prototype[methodName] !== currentClass.prototype[methodName]) {
                        superClass = parentClass;
                    }

                    currentClass = parentClass;
                }
            }

            if (superClass) {
                return function execSuper() {
                    return callSuper.call($this, methodName, originalClass, superClass, args || arguments);
                };
            }
            return function execSuper() {};
        },

        // Calls the super method if any
        execSuper : function execSuper(methodName, args) {
            return this.getSuper(methodName).apply(this, args || []);
        },

        getConstructor : function getConstructor(slotName, subCls) {
            var cls;

            if(subCls !== undef) {
                if (slotName in this.prototype && this.prototype[slotName] === subCls.prototype[slotName]) {
                    if ( 'constructor' in this.prototype &&
                         this.prototype.constructor !== this &&
                         'getConstructor' in this.prototype.constructor) {
                        return this.prototype.constructor.getConstructor(slotName, this);
                    }
                    return this;
                }
                return subCls;
            }

            if(slotName && '_super' in this && this._super[slotName]) {
                cls = this._super[slotName];
            }
            else {
                cls = ('constructor' in this && this.constructor !== Function) ?
                        this.constructor :
                        this;
            }

            if(slotName && 'constructor' in cls.prototype && cls.prototype.constructor !== cls && 'getConstructor' in cls.prototype.constructor) {
                return cls.prototype.constructor.getConstructor(slotName, cls);
            }

            return cls;
        },

        contains : function contains(object) {
            var cls = this.getConstructor(),
                i = ('implementList' in cls && cls.implementList.length) || 0;

            if(object === this || object === cls || object === cls.prototype) {
                return true;
            }

            if(typeof object === 'function') {
                object = object.prototype;
            }

            while (i-- && cls.implementList[i] !== object) {}

            return i !== -1;
        },

        toString : function toString() {
            return this.getConstructor().className;
        }
    });

    EasyPrototype.prototype.constructor = EasyPrototype;
    EasyPrototype.createProtoClass = createProtoClass;
    EasyPrototype.createClass = createClass;


    // On ne remplace pas une version déjà chargée de EasyPrototype.
    // Donc si plusieurs versions sont chargées, c'est la première chargée qui est utilisée
    window.EasyPrototype = window.EasyPrototype || EasyPrototype;
}(this));
/**
 * Fichier  : /share/sdmc/interne/layoutftv/arches/common/jsdev/EventsManager/libs/EventsManager.js
 * Revision : 44
 */
(function (window, Array, Error, undef) {

    if (window.EasyPrototype === undef) {
        throw new Error('Dépendence non satisfaite : EasyPrototype');
    }

    function getConvertionFunction(relations) {
        return function (type) {
            var relType = relations[type];
            if (relType === undef) {
                if (typeof relations._others === 'function') {
                    return relations._others(type);
                }
                relType = relations._others;
            }
            if (relType === true) {
                relType = type;
            }
            return relType;
        };
    }

    function convertionArrayToObject(convertionArray) {
        var i = convertionArray.length,
            convertionObject = {};
        while (i--) {
            if (typeof convertionArray[i] !== 'string') {
                continue;
            }
            convertionObject[convertionArray[i]] = true;
        }
        return convertionObject;
    }

    if(!Array.prototype.indexOf) {
        Array.prototype.indexOf = function(needle) {
            var idx = this.length;
            while(idx-- && needle !== this[idx]) {}
            return idx;
        }
    }

    var EventListener = EasyPrototype.createClass('EventListener', {

        init    : function init(action, iterations, rattrapage, reseter) {
            if (typeof action !== 'function') {
                throw new Error('Event listener must be a function');
            }

            // Checks for iterations arguments
            if (rattrapage === undef && typeof iterations === 'boolean') {
                reseter = rattrapage;
                rattrapage = iterations;
                iterations = undef;
            }

            if (iterations !== undef && typeof iterations !== 'number') {
                throw new Error('Event listener\'s iterations must be undefined or a number');
            }
            if (rattrapage !== undef && typeof rattrapage !== 'boolean') {
                throw new Error('Event listener\'s rattrapage must be undefined or a boolean');
            }
            if (reseter !== undef && typeof reseter !== 'function') {
                throw new Error('Event listener\'s reseter must be undefined or a function');
            }

            this.action = action;
            this.iterations = iterations;

            // Si rattrapage undefined, rattrapage à true, donc par défaut = true
            this.rattrapage = rattrapage !== false;

            this.reseter = reseter;
        },

        match   : function match(value) {
            return value === this ||
                value === this.action || (
                    value instanceof Array && (
                        value.indexOf(this) !== -1 ||
                        value.indexOf(this.action) !== -1
                    )
                );
        }
    }),

    EventExecution = EasyPrototype.createClass('EventExecution', {

        init            : function init(event, name, listeners, args) {
            var i;
            this._name = name;
            this._event = event;
            this._listeners = listeners;
            this._waiting = 0;
            this._allListenerTriggered = false;
            this._finished = false;

            this._params = [{
                type        : name,
                wait        : this.callback('_onListenerWait'),
                continuer   : this.callback('_onListenerContinuer')
            }];

            for (i = 0; i < args.length; i++) {
                this._params.push(args[i]);
            }

            window.setTimeout(this.callback('_execute'), 0);
        },

        _execListener   : function execListener(listener) {
            if (listener.iterations === 0) {
                return;
            }
            if (listener.iterations !== undef) {
                listener.iterations--;
            }
            try {
                listener.action.apply(this._event.manager._subject, this._params);
            }
            catch (e) {
                console.error(e);
            }
        },

        addListener     : function addListener(listener) {
            if (!this._allListenerTriggered) {
                this._listeners.push(listener);
            }
            else {
                this._execListener(listener);
            }
        },

        _execCallback   :function execCallback() {
            if (this._finished && typeof this._callback === 'function') {
                var cbk = this._callback,
                    subject = this._event.manager._subject;
                this._callback = undef;
                window.setTimeout(function () {
                    cbk.call(subject);
                }, 0);
            }
        },

        whenFinished    : function whenFinished(cbk) {
            delete(this.whenFinished);
            this._callback = cbk;
            this._execCallback();
        },

        _checkFinished  : function checkFinished() {
            if (this._allListenerTriggered && this._waiting === 0) {
                this._finished = true;
                this._execCallback();
            }
        },

        _onListenerWait : function onListenerWait() {
            this._waiting++;
        },

        _onListenerContinuer    : function onListenerContinuer() {
            if (!this._finished) {
                this._waiting--;
                this._checkFinished();
            }
        },

        _execute        : function execute() {
            var i;
            for (i = 0; i < this._listeners.length; i++) {
                this._execListener(this._listeners[i]);
            }

            this._allListenerTriggered = true;
            this._checkFinished();
        }
    }),

    Event = EasyPrototype.createClass('Event', {

        init        : function init(manager, name) {
            this.name = name;
            this.manager = manager;
            this._listeners = [];
        },

        _removeListener : function removeListener(idx) {
            var rest = this._listeners.slice(idx + 1);
            this._listeners.length = idx;
            this._listeners.push.apply(this._listeners, rest);

            if(!this._listeners.length && this.manager.whenEventHasNoListener) {
                this.manager.whenEventHasNoListener(this.name);
            }
        },

        addListener : function addListener(listener) {
//            this.logSlotDefinition('addListener', this.name);
            var directExec = listener.rattrapage && (this._lastExecution !== undef);

            if (!(directExec && listener.iterations === 1)) {
                if(this._listeners.push(listener) === 1 && this.manager.whenEventHasListener) {
                    this.manager.whenEventHasListener(this.name);
                }
            }
            if (directExec) {
                this._lastExecution.addListener(listener);
            }
        },

        trigger : function trigger() {
            var i = this._listeners.length;
            while (i--) {
                if (this._listeners[i].iterations <= 0) {
                    this._removeListener(i);
                }
            }

            this._lastExecution = new EventExecution(this, this.name, this._listeners.slice(), arguments);

            return this._lastExecution;
        },

        unbind : function unbind(listener) {
            var i;
            if (listener === undef) {
                this._listeners = [];
                if(this.manager.whenEventHasNoListener) {
                    this.manager.whenEventHasNoListener(this.name);
                }
            }
            else {
                i = this._listeners.length;
                while (i--) {
                    if (this._listeners[i].match(listener)) {
                        this._removeListener(i);
                    }
                }
            }
        },

        resetTriggeredState : function resetTriggeredState() {
            var i = this._listeners.length;
            this._lastExecution = undef;
            while (i--) {
                if (this._listeners[i].reseter !== undef) {
                    try {
                        this._listeners[i].reseter(this.name);
                    }
                    catch (e) {
                        console.error(e);
                    }
                }
            }
        },

        listenerIndexes : function listenerIndexes(listener) {
            var indexes = [],
                i = this._listeners.length;
            while(i--) {
                if (this._listeners[i].match(listener)) {
                    indexes.push(i);
                }
            }
            return indexes.reverse();
        }
    }),

    EventsManagerInterface = EasyPrototype.createClass('EventsManagerInterface', {

        getInstance : function getInstance() {
            if(this.constructor === EventsManagerInterface) {
                EventsManager.argsAsArray = true;
                return new EventsManager(arguments);
            }
            this.execSuper('getInstance', arguments);
        },

        init : function init() {
            this.events = new EventsManager(this);
            this.execSuper('init', arguments);
        },

        addEventListener : function addEventListener() {
            return this.events.addEventListener.apply(this.events, arguments);
        },

        addEventListeners : function addEventListeners() {
            return this.events.addEventListeners.apply(this.events, arguments);
        },

        unbind : function unbind() {
            return this.events.unbind.apply(this.events, arguments);
        }
    }),

    EventsManager = EasyPrototype.createClass('EventsManager', EventsManagerInterface, {

        getInstance : function getInstance() {},

        init : function init(subject) {
            var i;

            this._events = {};
            this._extending = [];
            this._globalListeners = [];

            // Pour des raisons de rétro-compatibilité, il est préférable de laissé ça en place
            // pour le moment
            // TODO : Vérifier si changer cela causerait des bugs
            if (subject !== undef && (!('contains' in subject) || !subject.contains(EventsManagerInterface))) {
                subject.addEventListener = this.callback('addEventListener');
                subject.addEventListeners = this.callback('addEventListeners');
                subject.unbind = this.callback('unbind');
            }

            this._subject = subject || this;

            for (i = 1; i < arguments.length; i++) {
                if(typeof arguments[i] === 'function' ||
                    arguments[i] instanceof EventListener ||
                    arguments[i] instanceof Array) {
                    this.addEventListener('*', arguments[i]);
                }
                else {
                    this.addEventListeners(arguments[i]);
                }
            }
        },

        _registerGlobalListener : function registerGlobalListener(listener) {
            this._globalListeners.push(listener);
        },

        getEvent : function getEvent(eventName, filterGlobalListener) {
            var i;
            if (this._events[eventName] === undef) {
                this._events[eventName] = new Event(this, eventName);
                i = this._globalListeners.length;
                while (i--) {
                    if (this._globalListeners[i].match(filterGlobalListener)) {
                        continue;
                    }
                    this._events[eventName].addListener(this._globalListeners[i]);
                }
            }
            return this._events[eventName];
        },

        addEventListeners : function addEventListeners(listeners) {
            var eventName;
            for (eventName in listeners) {
                if (listeners[eventName]) {
                    this.addEventListener(eventName, listeners[eventName]);
                }
            }
        },

        addEventListener : function addEventListener(eventName, listener, iterations, rattrapage, reseter) {
            var i;

            if(!(listener instanceof EventListener)) {
                if(listener instanceof Array) {
                    if(listener.length <= 4 &&
                        typeof listener[1] === 'number') {
                        listener = new EventListener(listener[0], listener[1], listener[2], listener[3]);
                    }
                    else {
                        for (i = 0; i < listener.length; i++) {
                            if (listener[i] === undef) {
                                continue;
                            }
                            this.addEventListener(eventName, listener[i], iterations, rattrapage, reseter);
                        }
                        return;
                    }
                }
                else {
                    listener = new EventListener(listener, iterations, rattrapage, reseter);
                }
            }

            if (eventName === '*') {
                this._registerGlobalListener(listener);
                eventName = [];
                for (i in this._events) {
                    eventName.push(i);
                }
            }
            else if (eventName.indexOf(' ') !== -1) {
                eventName = eventName.split(' ');
            }
            if (eventName instanceof Array) {
                i = eventName.length;
                while (i--) {
                    this.addEventListener(eventName[i], listener);
                }
                return;
            }

            this.getEvent(eventName).addListener(listener);
        },

        trigger : function trigger(eventName) {
            return this.getEvent(eventName).callback('trigger').apply(this, [].slice.call(arguments, 1));
        },

        resetTriggeredState : function resetTriggeredState(eventName) {
            if (eventName === undef) {
                for (eventName in this._events) {
                    this._events[eventName].resetTriggeredState();
                }
            }
            else if (this._events[eventName] instanceof Event) {
                this._events[eventName].resetTriggeredState();
            }
        },

        unbind : function unbind(eventName, listener) {
            var i, rest;
            if ((eventName || '*') === '*') {
                if (listener === undef) {
                    this._globalListeners.length = 0;
                }
                else {
                    i = this._globalListeners.length;
                    while (i--) {
                        if (this._globalListeners[i].match(listener)) {
                            rest = this._globalListeners.slice(i + 1);
                            this._globalListeners.length = i;
                            this._globalListeners.push.apply(this._globalListeners, rest);
                        }
                    }
                }
                for (eventName in this._events) {
                    this._events[eventName].unbind(listener);
                }
            }
            else {
                if (eventName.indexOf(' ') !== -1) {
                    eventName = eventName.split(' ');
                }
                if (eventName instanceof Array) {
                    i = eventName.length;
                    while (i--) {
                        this.unbind(eventName[i], listener);
                    }
                }
                else if (this._events[eventName] instanceof Event) {
                    this._events[eventName].unbind(listener);
                }
                else if (listener === undef) {
                    this.getEvent(eventName).unbind();
                }
                else {
                    i = this._globalListeners.length;
                    while (i--) {
                        if (this._globalListeners[i].match(listener)) {
                            this.getEvent(eventName, listener);
                            break;
                        }
                    }
                }
            }
        },

        extend : function extend(childEM, convertion) {
            var $this = this,
                eventName,
                convertionObj,
                key;
            if (typeof convertion !== 'function') {
                if (typeof convertion === 'string') {
                    convertion = convertion.split(' ');
                }
                if (convertion instanceof Array) {
                    convertion = convertionArrayToObject(convertion);
                }
                if (typeof convertion === 'object') {
                    convertionObj = convertion;
                    convertion = getConvertionFunction(convertion);
                }
                else {
                    convertion = undef;
                }
            }

            function eventsListener(evt) {
                var type = convertion ? convertion.call(this._subject, evt.type, arguments) : evt.type,
                    args = [type],
                    i = arguments.length;
                if (!type) {
                    return;
                }
                if (typeof type !== 'string' || type.indexOf(' ') !== -1) {
                    throw new Error('nom d\'événement invalide');
                }

                while (i-- > 1) {
                    args[i] = arguments[i];
                }
                evt.wait();
                $this.callback('trigger').apply($this, args).whenFinished(evt.continuer);
            }

            function resetManager(eventName) {
                eventName = convertion ? convertion.call(this._subject, eventName) : eventName;
                if (!eventName) {
                    return;
                }
                $this.resetTriggeredState(eventName);
            }

            if (convertionObj && !convertionObj._others) {
                eventName = [];
                for (key in convertionObj) {
                    eventName.push(key);
                }
                eventName = eventName.join(' ');
            }
            else {
                eventName = '*';
            }

            childEM.addEventListener(eventName, eventsListener, undef, undef, resetManager);
            this._extending.push([childEM, eventName, eventsListener, resetManager]);
        },

        unextend : function unextend(childEM) {
            var i = this._extending.length;
            while (i--) {
                if (this._extending[i][0] === childEM) {
                    childEM.unbind(this._extending[i][1], this._extending[i][2]);
                    break;
                }
            }
        }
    });

    EventsManager.EventListener = EventListener;
    window.EventsManager = window.EventsManager || EventsManagerInterface;
}(this, this.Array, this.Error));
/**
 * Fichier  : /share/sdmc/interne/layoutftv/arches/common/jsdev/FileInjection/libs/FileInjection.js
 * Revision : 16
 */
(function(window, document, undef) {

    var ENV = document.location.hostname.replace(/^((?:pp|dev|intg)(\.|$))?.*$/, '$1'),

        FileInjection = window.EasyPrototype.createProtoClass('FileInjection', window.EventsManager, {
            instances : {},

            injectTimeout : 2000,

            defaultLoadSupposition : false,

            env : ENV,

            staticDomain : {
                dev : 'http://dev.static.francetelevisions.fr'
            }[ENV] || 'http://' + ENV + 'www.francetelevisions.fr',

            getUid : function(params) {
                return (params.type || this.type) + params.url + params.charset + (params.document || document).location.href;
            },

            getInstance : function getInstance(params) {
                if ('multiload' in params && params.multiload === true) {
                    return;
                }

                var instance = this.instances[this.getUid(params)];

                if(instance) {
                    if('onload' in params && typeof params.onload === 'function') {
                        instance.addEventListener('load', params.onload);
                    }
                    if('onerror' in params && typeof params.onerror === 'function') {
                        instance.addEventListener('error', params.onerror);
                    }
                    if('loadControl' in params && typeof params.loadControl === 'function') {
                        instance.registerLoadControl(params.loadControl);
                    }
                }

                return instance;
            },

            init : function init(params) {
                this.execSuper('init');

                this.multiload = params.multiload === true;
                if (!this.multiload) {
                    this.instances[this.getUid(params)] = this;
                }

                this.url = params.url;

                this.document = params.document || document;

                // On control que l'on peut manipuler le DOM du document en question (xDomain policy par exemple)
                try {
                    this.document.getElementsByTagName('BODY');
                }
                catch(e) {
                    this.document = document;
                }

                if('type' in params) {
                    this.type = params.type;
                }

                if('charset' in params) {
                    this.charset = params.charset;
                }

                if('timeout' in params) {
                    this.injectTimeout = params.timeout;
                }

                if(this.url.substr(0, 1) === '/') {
                    this.url = this.staticDomain + this.url;
                }

                if('onload' in params && typeof params.onload === 'function') {
                    this.addEventListener('load', params.onload);
                }

                if('onerror' in params && typeof params.onerror === 'function') {
                    this.addEventListener('error', params.onerror);
                }

                if('loadControl' in params && typeof params.loadControl === 'function') {
                    this.registerLoadControl(params.loadControl);
                }

                this.createNode();

                this.loadTimer = window.setTimeout(this.callback('loadHandler', this.defaultLoadSupposition), this.injectTimeout);

                this.injectNode();
            },

            injectNode : function injectNode() {
//                this.logSlotDefinition('injectNode');
                if(!this.controlLoad(false)) {
                    this.injectElement(this.node);
                }
                else {
                    throw new Error('Tentative de double chargement du fichier : ' + this.url);
                }
            },

            injectElement : function injectElement(elem) {
//                this.logSlotDefinition('injectElement');
                (this.document.getElementsByTagName('HEAD')[0] ||
                 this.document.getElementsByTagName('BODY')[0] ||
                 this.document.documentElement)
                    .appendChild(elem);
            },

            registerLoadControl : function registerLoadControl(loadControl) {
//                this.logSlotDefinition('registerLoadControl');
                var unik = true,
                    i;

                if(!('loadControls' in this)) {
                    this.loadControls = [loadControl];
                }
                else {
                    i = this.loadControls.length;

                    while(unik && i--) {
                        unik = this.loadControls !== loadControl;
                    }

                    if(unik) {
                        this.loadControls.push(loadControl);
                    }
                }
            },

            controlLoad : function controlLoad(def) {
//                this.logSlotDefinition('controlLoad', 'loadControls' in this);
                if(!('loadControls' in this)) {
                    return def;
                }

                var loaded = true,
                    i = this.loadControls.length;

                while(loaded && i--) {
                    loaded = !!this.loadControls[i].call(this);
                }

                return loaded;
            },

            loadHandler : function loadHandler(supposed) {
//                this.logSlotDefinition('loadHandler');
                if('loadTimer' in this) {
                    window.clearTimeout(this.loadTimer);
                    delete this.loadTimer;
                }

                if(!('loaded' in this) || this.loaded !== true) {
                    this.loaded = this.controlLoad(supposed);

                    this.events.trigger(this.loaded ? 'load' : 'error');
                }
            },

            __statics__ : {
                patternSelfPath : /^(https?:\/\/[^\/]+)?\/layoutftv\/arches\/common\/javascripts\//,
            //    patternSelfPath = /jsLibs/;

                searchStaticDomain : function searchStaticDomain(tagName, attrName) {
                    var tagList = document.getElementsByTagName(tagName),
                        matches,
                        i = tagList.length;

                    while(i--) {
                        matches = FileInjection.patternSelfPath.exec(tagList[i].getAttribute(attrName));
                        if(matches) {
                            FileInjection.prototype.staticDomain = window.staticDomain = matches[1] ||
                                document.location.protocol + '//' + document.location.hostname;
                            return true;
                        }
                    }
                    return false;
                },

                onWindowLoad : function onWindowLoad() {
                    if(window.staticDomain) {
                        return;
                    }

                    var tagsTypes = {
                            script : 'src',
                            link : 'href'
                        },
                        key;

                    for(key in tagsTypes) {
                        if(FileInjection.searchStaticDomain(key, tagsTypes[key])) {
                            break;
                        }
                    }
                }
            }
        }, [
            'createNode'
        ]);

    if(window.addEventListener) {
        window.addEventListener('load', FileInjection.onWindowLoad, false);
    }
    else if(window.attachEvent) {
        window.attachEvent('onload', FileInjection.onWindowLoad);
    }

    FileInjection.onWindowLoad();


    window.ScriptInjection = window.ScriptInjection || window.EasyPrototype.createClass('ScriptInjection', FileInjection, {
        type : 'text/javascript',

        createNode : function createNode() {
        //    this.logSlotDefinition('createNode');
            this.node = this.document.createElement('script');
            this.node.type = this.type;
            this.node.async = true;

            if('charset' in this) {
                this.node.charset = this.charset;
            }

            this.node.src = this.url;

            if (this.multiload) {
                if (this.node.src.indexOf('?') === -1) {
                    this.node.src += '?';
                }
                else {
                    this.node.src += '&';
                }
                this.node.src += '_=' + parseInt(Math.random() * 10000000);
            }

            this.node.onload = this.node.onreadystatechange = this.callback('loadCatcher');
            this.node.onerror = this.callback('loadHandler', false);
        },

        loadCatcher : function loadCatcher() {
        //      this.logSlotDefinition('loadCatcher', this.node.readyState);
            if('readyState' in this.node && this.node.readyState !== 'complete' && this.node.readyState !== 'loaded') {
                return;
            }

            this.loadHandler(true);
        }
    });

    window.StyleInjection = window.StyleInjection || window.EasyPrototype.createClass('StyleInjection', FileInjection, {
        type : 'text/css',

        injectTimeout : 1000,

        defaultLoadSupposition : true,

        createNode : function createNode() {
        //  this.logSlotDefinition('createNode');
            this.node = this.document.createElement('link');
            this.node.type = this.type;
            this.node.rel = 'stylesheet';
            this.node.media = 'all';

            if('charset' in this) {
                this.node.charset = this.charset;
            }

            this.node.href = this.url;
        },

        injectNode : function injectNode() {
        //        this.logSlotDefinition('injectNode');
            this.execSuper('injectNode');
            this.checkLoadTimer = window.setTimeout(this.callback('checkLoad'), 100);
        },

        checkLoad : function checkLoad() {
        //        this.logSlotDefinition('checkLoad');
            if('loadControls' in this) {
                if(this.controlLoad(false)) {
                    this.loadHandler(true);
                }
                else if('loadTimer' in this) {
                    this.checkLoadTimer = window.setTimeout(this.callback('checkLoad'), 100);
                }
            }
        },

        loadHandler : function loadHandler() {
        //        this.logSlotDefinition('loadHandler');
            window.clearTimeout(this.checkLoadTimer);
            this.execSuper('loadHandler', arguments);
        }
    });

}(this, this.document));
/**
 * Fichier  : /share/sdmc/interne/layoutftv/arches/common/jsdev/FrameworkLoader/libs/FrameworkLoader.js
 * Revision : 44
 */
(function (window, $, EasyPrototype, undef) {
    if (EasyPrototype === undef) {
        throw new Error('Dépendence non satisfaite : EasyPrototype');
    }

    var framework = {
            register : function() {
                var args = [].slice.call(arguments).reverse();
                args.push(FrameworkLoader);
                EasyPrototype.createClass.apply(this, args.reverse());
            }
        },

        FrameworkLoader = EasyPrototype.createProtoClass('FrameworkLoader', {
            autoLoad : false,

            classSetup : function classSetup() {

                var name = this.className;

                if (framework[name]) {
                    throw new Error('Double chargement du framework ' + name);
                }

                framework[name] = new this();

                // Raccourci en tant que plugin jQuery (deprecated)
                if ($ !== undef) {
                    $[name] = framework[name].callback('exec');
                }
            },

            init : function init() {

                if (this.autoLoad) {
                    this.askLoad();
                }
            },

            exec : function exec(action) {

                // S'il n'y a pas d'action demandé (par exemple pour simplement forcer le chargement
                // du framework), on défini une fonction vide comme action. Il est important
                // d'attacher un eventListener, même vide, pour que le chargement du framework soit
                // déclenché (fonctionnement de la librairie EventsManager et de
                // "whenEventHasListener")
                action = action || function() {};

                FrameworkLoader.events.addEventListener(this.constructor.className, action);
            },

            askLoad : function askLoad() {
                if ('_loadAsked' in this) {
                    return;
                }
                this._loadAsked = true;

                // On DOIT passer par la méthode startLoading pour que l'appel à la méthode load
                // soit fait sans aucun paramètre. Sinon le paramètre evt du EventsManager est pris
                // comme paramètre onload dans la méthode load et ça pose problème.
                // TODO : On pourrait peut-être trouver plus propre comme solution
                FrameworkLoader.onStartLoading(this.callback('startLoading'));
            },

            // Méthode necessaire pour faire appel à la méthode load sans aucun paramètres (cf askLoad)
            startLoading : function startLoading() {
                this.load();
            },

            load : function load(onload, onerror, checkloaded) {

                var file = {
                        url : this.scriptSrc
                    };

                if (onload === undef) {
                    onload = this.callback('onReady');
                }

                if (onerror === undef) {
                    onerror = 'onError' in this && this.callback('onError');
                }

                if (checkloaded === undef) {
                    checkloaded = 'checkloaded' in this && this.callback('checkloaded');
                }

                if (typeof onload === 'function') {
                    file.onload = onload;
                }

                if (typeof onerror === 'function') {
                    file.onerror = onerror;
                }

                if (typeof checkloaded === 'function') {
                    file.loadControl = checkloaded;
                }

                if (this.scriptCharset) {
                    file.charset = this.scriptCharset;
                }

                new window.ScriptInjection(file);
            },

            onReady : function onReady() {
                FrameworkLoader.events.trigger(this.constructor.className);
            },

            __statics__ : {
                loadingDelay : 100,

                paramsControl : /^\s*\{\s*frameworkParams\s*:\s*\{(.|\s)*\}\s*\}\s*$/,

                events : new window.EventsManager(),

                mergeRecursive : function mergeRecursive(obj1, obj2) {
                    var p;
                    if (typeof obj1 !== 'object') {
                        obj1 = {};
                    }
                    for (p in obj2) {
                        if (p in obj2) {
                            obj1[p] = typeof obj2[p] === 'object' ? mergeRecursive(obj1[p], obj2[p]) : obj2[p];
                        }
                    }
                    return obj1;
                },

                collectScriptParams : function collectScriptParams() {
                    var txt = $(this).text().replace('//<![CDATA[', '').replace('//]]>', ''),
                        params,
                        frameworkName;

                    if (txt && FrameworkLoader.paramsControl.test(txt)) {
                        try {
                            eval('FrameworkLoader.paramsReceiver = ' + txt);

                            if ('frameworkParams' in FrameworkLoader.paramsReceiver) {
                                params = FrameworkLoader.paramsReceiver.frameworkParams;
                            }
                        }
                        catch(e) {
                            console.error(e);
                            return;
                        }

                        delete FrameworkLoader.paramsReceiver;

                        for (frameworkName in params) {
                            if (frameworkName !== 'LoaderPrototype' && frameworkName !== 'register') {
                                if (!(frameworkName in framework)) {
                                    framework[frameworkName] = {};
                                }
                                framework[frameworkName].inlineParams = FrameworkLoader.mergeRecursive(framework[frameworkName].inlineParams, params[frameworkName]);
                            }
                        }
                    }
                },

                onWindowLoad : function onWindowLoad() {
                    if ($) {
                        $('script[src]')
                            .map(FrameworkLoader.collectScriptParams)
                            .get();
                    }

                    window.setTimeout(
                        FrameworkLoader.events.callback('trigger', 'windowLoaded'),
                        FrameworkLoader.loadingDelay
                    );
                },

                onFrameworkNeeded : function onFrameworkNeeded(FrameworkName) {
                    if (FrameworkName !== 'windowLoaded' && FrameworkName in framework) {
                        framework[FrameworkName].askLoad();
                    }
                }
            }
        });

    FrameworkLoader.onStartLoading = FrameworkLoader.events.callback('addEventListener', 'windowLoaded');

    FrameworkLoader.events.whenEventHasListener = FrameworkLoader.onFrameworkNeeded;

    if ('addEventListener' in window) {
        window.addEventListener('load', FrameworkLoader.onWindowLoad, false);
    }
    else if ('attachEvent' in window) {
        window.attachEvent('onload', FrameworkLoader.onWindowLoad);
    }

    framework.LoaderPrototype = FrameworkLoader;

    // On ne remplace pas une version déjà chargée de FrameworkLoader.
    // Donc si plusieurs versions sont chargées, c'est la première chargée qui est utilisée
    window.framework = window.framework || framework;

}(this, this.jQuery, this.EasyPrototype));
/**
 * Fichier  : /share/sdmc/interne/layoutftv/arches/common/jsdev/google-analytics/libs/ga.init.js
 * Revision : 33
 */
(function (window, document, undef) {
    (function (dep) {
        for (var i in dep) {
            if (!dep[i]) {
                throw new Error('Dépendence non satisfaite : ' + i);
            }
        }
    }({
        FrameworkLoader     : !!window.framework
    }));

    window.framework.register('GA', {
        scriptSrc : ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js',

        scriptCharset : 'utf-8',

        autoLoad : true,

        load : function load() {
            this.accounts = [];

            this.execSuper('load');

            new window.ScriptInjection({
                url : '/layoutftv/arches/common/javascripts/external.ga.hostnames-min.js',
                charset : 'iso-8859-1',
                onload : this.callback('startTracking'),
                onerror : this.callback('startTracking'),
                loadControl : function() {
                    return '__gaData' in window;
                }
            });
        },

        checkLoaded : function checkLoaded() {
            return '_gaq' in window;
        },

        startTracking : function startTracking() {
            var path = document.location.hostname + document.location.pathname,
                accounts,
                domain,
                i, j;

            if('__gaData' in window) {
                i = window.__gaData.reverse().length;

                // look for the domain name in the data array
                // and init all the main values for each account
                while ( !accounts && i-- ) {
                    if (!!~path.indexOf(window.__gaData[i][0])) {
                        domain = window.__gaData[i][1];
                        accounts = window.__gaData[i][2].split(':');
                        j = accounts.length;
                        while (j--) {
                            if(accounts[j]) {
                                this.addAccount(accounts[j], domain);
                            }
                        }
                    }
                }

                window.__gaData.reverse();
            }

            // If domain not found, send data to "Catch All" account
            if (!accounts) {
                this.addAccount('UA-12822736-2', false, 'z');
            }
        },

        addAccount : function addAccount(account, domain, id) {
            window._gaq = window._gaq || [];

            this.accounts.push({
                id      : id || this.accounts.length,
                account : account,
                domain  : domain
            });

            window._gaq.push([id + '._setAccount', account]);

            if(domain) {
                window._gaq.push(
                    [id + '._setAllowLinker', true],
                    [id + '._setDomainName', domain]
                );
            }

            window._gaq.push([id + '._trackPageview']);
        },

        trackPageView : function trackPageView(pv) {
            var i = this.accounts.length;
            window._gaq = window._gaq || [];

            while(i--) {
                window._gaq.push([this.accounts[i].id + '._trackPageview', pv]);
            }
        },

        trackEvent : function trackEvent(cat, act, lab, val) {
            var i = this.accounts.length;
            window._gaq = window._gaq || [];

            while(i--) {
                window._gaq.push([this.accounts[i].id + '._trackEvent', cat, act, lab, val]);
            }
        }
    });

}(this, this.document));
/**
 * Fichier  : /share/sdmc/interne/layoutftv/arches/common/jsdev/xiti/libs/xiti.init.js
 * Revision : 38
 */
(function (window, undef) {
    if(window.framework === undef) {
        throw new Error('Dépendence non satisfaite : FrameworkLoader');
    }

    window.framework.Xiti || window.framework.register('Xiti', {
        scriptSrc : '/layoutftv/arches/common/javascripts/xiti-xtcore-global-min.js',

        scriptCharset : 'utf-8',

        autoLoad : true,

        dnPattern : /(france([2345O]|televisions)|la1ere)\.fr/,

        triedAjaxCall : false,

        getXitiValues : function getXitiValues() {

            var portail = window.ftvi_portail ||
                (
                    'CM' in framework &&
                    'inlineParams' in framework.CM &&
                    framework.CM.inlineParams.ftvi_portail
                ) || '',
                section = window.ftvi_section ||
                (
                    'CM' in framework &&
                    'inlineParams' in framework.CM &&
                    framework.CM.inlineParams.ftvi_section
                ) || '',
                rubrique = window.ftvi_rubrique ||
                (
                    'CM' in framework &&
                    'inlineParams' in framework.CM &&
                    framework.CM.inlineParams.ftvi_rubrique
                ) || '';

            new window.ScriptInjection({
                url : '/appftv/tag2xiti/xiti.js.php' +
                    '?ftvi_portail=' + portail +
                    '&ftvi_section=' + section +
                    '&ftvi_rubrique=' + rubrique,
                charset : 'utf-8',
                onload : this.callback('load'),
                onerror : this.callback('load')
            });
        },

        load : function load() {

            if (this.inlineParams) {
                window.xtsite = window.xtsite || this.inlineParams.xtsite;
                window.xtn2 = window.xtn2 || this.inlineParams.xtn2;
                window.xtpage = window.xtpage || this.inlineParams.xtpage;
            }

            // Si les variables xtsite, xtn2 et xtpage ne sont pas déclarée, alors que les variables
            // ftvi_portail, ftvi_section et ftvi_rubrique le sont, alors on cherche à obtenir ces
            // valeurs via un appel ajax
            if(!('xtsite' in window && 'xtn2' in window && 'xtpage' in window) && !this.triedAjaxCall) {
                this.triedAjaxCall = true;
                this.getXitiValues();
                return;
            }

            // On récupère les deux derniers composants du nom de domaine
            var dn = window.document.location.host.split('.').reverse();
            while (dn.length > 2) {
                dn.length--;
            }
            dn = dn.reverse().join('.');

            // On filtre le nom de domaine obtenu
            if (!this.dnPattern.test(dn)) {
                dn = 'francetelevisions.fr';
            }

            window.xtsd     = 'http://logc238';
            window.xt1      = '.' + dn;
            window.xtsite   = window.xtsite || '483260';    //site number
            window.xtn2     = window.xtn2 || '0';           //level 2 site
            window.xtpage   = window.xtpage || '';          //page name (with the use of :: to create chapters)
            window.xtdi     = '';                           //implication degree
            window.xt_multc = '';                           //customised indicators
            window.xt_an    = '';                           //numeric identifier
            window.xt_ac    = '';                           //category
            window.xtnv     = window.document;              //parent.document or top.document or document

            window.xtparam = (window.xtparam || '') + '&ac=' + window.xt_ac + '&an=' + window.xt_an + window.xt_multc;

            if ('inlineParams' in this && this.inlineParams.xtclick === true) {
                window.xtidmod = window.xtidmod || this.inlineParams.xtidmod || '';

                new window.ScriptInjection({
                    url : '/layoutftv/arches/common/javascripts/xiti-xtclicks-min.js',
                    charset : 'utf-8',
                    onload : this.getSuper('load'),
                    onerror : this.getSuper('load')
                });
            }
            else {
                this.execSuper('load');
            }
        },

        checkLoaded : function checkLoaded() {
            return 'xw' in window;
        },

        videoHit : function videoHit(playerId, libelle, isLive, action, duree, position, localisation) {

            if(typeof position !== 'object') {
                position = {
                    pos  : position
                };
            }

            rmp = 'rmp=' + (position.pos || '0');
            if(position.from !== undef) {
                rmp+= '&rmpf=' + position.from;
            }
            if(position.buff !== undef) {
                rmp+= '&rmbufp=' + position.buff;
            }

            this.exec(function() {
                try {
                    window.xt_rm(
                        'video&plyr=' + playerId,
                        window.xtn2 || '0',
                    // Bug Xiti si il y a un ' dans la chaine (eval via setTimeout)
                        libelle.replace('\'', ' '),
                        action,
                        '0',
                        '60',
                        duree,
                        rmp,
                        '',
                        '',
                        localisation,
                        isLive ? 'live' : 'clip',
                        '',
                        ''
                    );
                }
                catch(e) {
                    console.error(e);
                }
            });
        }
    });

}(this));
/**
 * Fichier  : /share/sdmc/interne/layoutftv/arches/common/jsdev/audience/libs/cybermonitor.js
 * Revision : 17
 */
(function (window, document, undef) {
    (function (dep) {
        for (var i in dep) {
            if (!dep[i]) {
                throw new Error('Dépendence non satisfaite : ' + i);
            }
        }
    }({
        FrameworkLoader     : !!window.framework
    }));

    window.framework.register('CM', {
        scriptSrc : 'http://stat3.cybermonitor.com/js/cms.js',

        scriptCharset : 'utf-8',

        autoLoad : true,

        init : function init() {

            // Pour rétrocompatibilité on défini la fonction globale
            window.callCybermonitor = this.callback('call');

            this.execSuper('init');
        },

        load : function load() {

            if (this.inlineParams) {
                window.ftvi_portail = window.ftvi_portail || this.inlineParams.ftvi_portail;
                window.ftvi_section = window.ftvi_section || this.inlineParams.ftvi_section;
                window.ftvi_rubrique = window.ftvi_rubrique || this.inlineParams.ftvi_rubrique;
            }

            var tag = [],
                rubOk = !!window.ftvi_rubrique;

            window.ftvi_portail = window.ftvi_portail || 'sansportail';

            tag.push(window.ftvi_portail);
            window.CM_CLIENT = window.ftvi_portail;

            if (window.ftvi_section || rubOk) {
                tag.push(window.ftvi_section);
            }
            window.CM_SECTION1 = tag.join('_');

            if (rubOk) {
                tag.push(window.ftvi_rubrique);
            }
            window.CM_RUBRIQUE = tag.join('_');

            window._cmJS = 0;
            window._cmsv = '1.0';
            this.execSuper('load');
        },

        checkLoaded : function checkLoaded() {
            return window._cmsJS === 1;
        },

        call : function call(tagcyber) {
            var i;

            tagcyber = tagcyber || [
                window.ftvi_portail,
                window.ftvi_section,
                window.ftvi_rubrique
            ];

            if (typeof tagcyber !== 'string' || !tagcyber.indexOf('http://') === 0) {

                // tagcyber sous la forme "client_section_rubrique"
                // On le transforme en Array
                if (typeof tagcyber === 'string') {
                    tagcyber = tagcyber.split('_');
                }

                if(!(tagcyber instanceof Array)) {
                    tagcyber = [
                        tagcyber.client,
                        tagcyber.section,
                        tagcyber.rubrique
                    ];

                    i = tagcyber.length;

                    while(i-- && tagcyber[i]) {
                        tagcyber.length--;
                    }
                }

                tagcyber = 'http://stat3.cybermonitor.com/' +
                    tagcyber[0] +
                    '_v?R=' +
                    tagcyber.join('_') +
                    '&S=total;' +
                    tagcyber.slice(0, 2).join('_') +
                    '&random=' +
                    Math.random();
            }

            (new window.Image()).src = tagcyber;
        }
    });

    // Raccourci pour rétro-compatibilité avec l'ancien cybermonitor
    window.callCybermonitor = window.callCybermonitor || window.framework.CM.callback('call');

}(this, this.document));
