var mediaTag4095 = mediaTag4095 || {};

                    mediaTag4095 = {
                        major : 1,
                        minor : 0,

                        // ------------------------------------------------------------
                        // Propriétés internes
                        // ------------------------------------------------------------

                        window : null,
                        index : 0,

                        // ------------------------------------------------------------
                        // Définie les différentes propriétés
                        // ------------------------------------------------------------

                        utc         : '',
                        width       : 0,
                        height      : 0,
                        type        : 0,
                        position : 1,
                        alignH     : 1,
                        alignV     : 2,
                        forcerOuverture : 1,
                    
                        render : function(utc, type, width, height, position, alignH, alignV,forcerOuverture) {
                            this.utc         = utc;
                            this.type         = type;
                            this.width         = width;
                            this.height     = height;
                            this.position     = position;
                            this.alignH        = alignH;
                            this.alignV        = alignV;
                            this.forcerOuverture    = forcerOuverture;  
                            if (this.forcerOuverture==1)
                                this.openWindow();    // Essaye une ouverture via un window.open ;                    
                            
                            //this.openDialog();       // Essaye une ouvertue via un dialogue (IE uniquement)
                            this.overrideLinks(); // Surcharge les liens onclick en cas d'échec
                        },
                        
                        // ------------------------------------------------------------
                        // Tente l'ouverture d'une fenêtre via un window.open classique
                        // ------------------------------------------------------------

                        openWindow : function() {
                            // Si la fenêtre n'a pas déjà été ouverte
                            if (!this.isOpen()) {
                            
                                // Obtient les coordonnées d'affichage
                                var _bound = this.getBound();

                                // On ouvre la fenêtre
                                var _window = window.open(((this.type==0) ? this.utc : 'about:blank'),'',
                                            'top=' + _bound[0] + ',' +
                                            'left=' + _bound[1] + ',' +
                                            'width=' + _bound[2] + ',' +
                                            'height=' + _bound[3] +
                                            ((this.type==0) ? ',scrollbars=1, resizable=1, toolbar=1, location=1, menubar=1, status=1, directories=0' : ',resizable=0')
                                        );

                                // Si la fenêtre est ouverte
                                if (_window!=null) {
                                    // On déplace la fenêtre
                                    if (this.type==1) _window.document.write(this.utc);
                                    // On mets derrière la fenêtre
                                    if (this.position==1) { _window.blur(); window.focus(); }
                                    // On indique qu'on a réussi à l'ouvrir
                                    this.window = _window;
                                }        
                            }
                        },
                        
                        // ------------------------------------------------------------
                        // Tente l'ouverture d'une fenêtre de dialogue
                        // ------------------------------------------------------------

                        openDialog : function() {
                            if (typeof window.showModelessDialog !='undefined' && this.type==0) {
                                // Obtient les coordonnées d'affichage
                                var _bound = this.getBound();

                                // On ouvre la fenêtre modale
                                var _window = window.showModelessDialog(this.utc,'',
                                    'dialogTop:' + _bound[0] + 'px;' +
                                    'dialogLeft:' + _bound[1] + 'px;' +
                                    'dialogWidth:' + _bound[2] + 'px;' +
                                    'dialogHeight:' + _bound[3] + 'px'
                                );
                            }
                        },
                        
                        // ------------------------------------------------------------
                        // Sur charge les liens d'une fonction onclick
                        // ------------------------------------------------------------

                        overrideLinks : function() {
                            // Si la fenêtre n'a pas déjà été ouverte
                            if (!this.isOpen()) {
                                // Attends le chargement de la page
                                this.addLoadEvent(
                                    function() {
                                        // On récupère l'ensemble des tags A de la page
                                          var _tags = document.getElementsByTagName('a');
                                        // Pour chaque lien 
                                            for (var _i=0; _i<_tags.length; _i++)
                                            // Si l'élément onclick n'est pas déjà défini, et qu'il n'y a pas d'attribut target
                                               if ((typeof _tags[_i].onclick == 'undefined' || _tags[_i].onclick == null) && _tags[_i].target == '')
                                                // On surchage les liens avec notre fonction d'ouverture de fenêtre
                                                _tags[_i].onclick = function(e) {mediaTag4095.render(mediaTag4095.utc,mediaTag4095.type,mediaTag4095.width,mediaTag4095.height,mediaTag4095.position,mediaTag4095.alignH,mediaTag4095.alignV,1); }
                                    }
                                );
                            }
                        },

                        // ------------------------------------------------------------
                        // Attends le chargement de la page est appel la fonction func
                        // ------------------------------------------------------------
                    
                        addLoadEvent : function(func) {
                               var oldonload = window.onload;
                            if (typeof func == 'undefined') return false;
                               if (typeof window.onload != "function") {
                                  window.onload = func;
                               } else {
                                  window.onload = function() {
                                     if (oldonload) oldonload();
                                     func();
                                  };
                               }
                        },
                        
                        // ------------------------------------------------------------
                        // Vérifie si la fenêtre est ouverte
                        // ------------------------------------------------------------

                        isOpen : function() {
                            if(this.window==null) return false;
                            try {
                                return !this.window.closed;
                            } catch(e){
                                return false;
                            }
                        },
                        
                        // ------------------------------------------------------------
                        // Retourne le rectangle d'affichage
                        // ------------------------------------------------------------

                        getBound : function() {
                            // On gère le positionnement de la fenêtre
                            var _clientWidth  = screen.availWidth;
                            var _clientHeight = screen.availHeight;
                                
                            var _top = 0;
                            var _height = this.height;
                            
                            //Si height vaut zéro, on affiche en pleine hauteur
                            if (this.height==0) {
                                _height = _clientHeight;
                            } else {
                                if (this.alignV == 1) _top = (_clientHeight - this.height)/2;    
                                if (this.alignV == 2) _top = _clientHeight - this.height - 46;
                            }

                            var _left = 0;
                            var _width = this.width;
                                
                            //Si width vaut zéro, on affiche en pleine largeur
                            if (this.width==0) {
                                _width = _clientWidth;
                            } else {
                                if (this.alignH == 1) _left = (_clientWidth - this.width)/2;
                                if (this.alignH == 2) _left = _clientWidth - this.width - 10;
                            }
                            
                            // Retourne les données
                            return [_top, _left, _width, _height];
                        }        
                    }

                    // ------------------------------------------------------------
                    // Effectue l'affichage de la bannière
                    // ------------------------------------------------------------
                    
                    mediaTag4095.render("http://display.gestionpub.com/3c918/3c99743333ad0d849/4c90749335ad2e/f786be18-53eb-4213-8b2b-9c377b930020", 0 , 0,0,1,1,1,1);

                 
                