	var mediaTag5864 = mediaTag5864 || {};
			
			mediaTag5864 = {
				major : 1,
				minor : 0,
			
				// ------------------------------------------------------------
				// Propriétés internes
				// ------------------------------------------------------------
			
				window  	: null,
				index   	: 0,
				border 		: 2,
				borderColor : '#12517f',
				toolsheight	: 14,
                path       :  'http://mediatag.gestionpub.com/interstitiel/',
			
				// ------------------------------------------------------------
				// Définie les différentes propriétés
				// ------------------------------------------------------------
			
				utc         : '',
				width       : 0,
				height      : 0,
				alignH      : 1,
				alignV      : 2,
				top 		: 0,
				left		: 0,
				bg			: 1,
				delivery	: 0,
				interval	: 10000,
                close_afterloading : 0,
                cappingIllimite : 0, 
			 
				init : function(utc, width, height, alignH, alignV, top, left, bg, delivery, interval,close_afterloading,cappingIllimite) {
					this.utc        = utc;
					this.width      = width;
					this.height     = height;
					this.alignH     = alignH;
					this.alignV     = alignV;
					this.top		= top;
					this.left		= left;
					this.bg    		= bg;
					this.delivery	= 1;//delivery;
                    this.close_afterloading = close_afterloading;
                    this.cappingIllimite = cappingIllimite;

                    if (interval <=300) 
                    {
                        this.interval = 300;
                    }
                    else
                    {
                        this.interval   = interval;
                    }
					
					// Force la position si aucune largeur / hauteur
					if (this.width==0) this.alignH = 0;
					if (this.height==0) this.alignV = 0;
					
					switch(this.delivery) {
						case 0: this.render(); break;
						case 1: this.delayRender(); break;
					}
				},
				
				// ------------------------------------------------------------
				// Fonction principale de rendu de la campagne
				// ------------------------------------------------------------

				render : function() {
                    if (this.readCookie('isOpen_mediaTag5864')==null || this.cappingIllimite == 1)
                    {   
					    var _tools = document.createElement('DIV');
						    _tools.id = 'mediaTag5864_Tools';

					    var _media = document.createElement('DIV');
						    _media.id = 'mediaTag5864_Media';

					    // On créé le div du cadre
					    var _frame = document.createElement('DIV');
						    _frame.id = 'mediaTag5864_Frame';
						    _frame.appendChild(_tools);
						    _frame.appendChild(_media);	

					    // On créé le div du container
					    var _container = document.createElement('DIV');
						    _container.id = 'mediaTag5864_Container';
						    _container.appendChild(_frame);
    						
					    // On l'ajoute au body
					    var _body = document.getElementsByTagName('body').item(0);
						    _body.appendChild(_container);
    					
					    // Applique les styles
					    this.setStyles();
					    this.setMedia();
    					
					    // En cas de redimenssionnement de la fenêtre
					    window.onresize = this.resize;
					    this.resize();
                        this.writeCookie('isOpen_mediaTag5864','1');
                        if (this.close_afterloading)
                        {                    
                            var func = function() { mediaTag5864.close(); };

                            if (window.addEventListener) { 
                                window.addEventListener("load", func, false); 
                            } else if (document.addEventListener) { 
                                document.addEventListener("load", func, false); 
                            } else if (window.attachEvent) { 
                              window.attachEvent("onload", func); 
                            } else if (typeof window.onload != "function") { 
                             window.onload = func; 
                            } else { 
                              var oldonload = window.onload; 
                              window.onload = function() { 
                                 oldonload(); 
                                  func(); 
                              }; 
                            } 

                        }
                    }
				},
				
				// ------------------------------------------------------------
				// Callback du redimensionement du navigateur
				// ------------------------------------------------------------

				resize : function(el) {
					// On recréé la référence
					var _fw = mediaTag5864;
					var _sWidth  = _fw.getSize().width;
					var _sHeight = _fw.getSize().height;
					var _fWidth  = ((_fw.width!=0) ? _fw.width : _sWidth - _fw.border * 2);
					var _fHeight = ((_fw.height!=0) ? _fw.height : _sHeight - _fw.toolsheight - _fw.border * 2);
					
					var _el = _fw.$('mediaTag5864_Frame').style;
						_el.top     = _fw.getPosition(_sWidth, _sHeight).top;
						_el.left    = _fw.getPosition(_sWidth, _sHeight).left;
						_el.width   = _fWidth + (_fw.border * 2) + 'px';
						_el.height  = _fHeight + _fw.toolsheight + 'px';
					
						_el = _fw.$('mediaTag5864_Media').style;
						_el.width   = _fWidth + 'px';
						_el.height  = _fHeight + 'px';

						_el = _fw.$('mediaTag5864_Container').style;
                        _el.onclick = mediaTag5864.close;
						_el.display = 'block'
						_el.width 	= _sWidth + 'px';
						_el.height 	= _sHeight + 'px';
				},
				
				// ------------------------------------------------------------
				// Callback fermeture du média
				// ------------------------------------------------------------
				
				close : function() {
					var _fw = mediaTag5864;
					var _el = _fw.$('mediaTag5864_Container').style;
						_el.display = "none";
                        _el.visibility = "hidden";
				},
				
				// ------------------------------------------------------------
				// Détermine la position du cadre dans l'écran
				// 0 : Top/Left, 1 : Middle/Center, 2 : Bottom/Right, 
				// 3 : personnalisé (top/left en paramètre)
				// ------------------------------------------------------------

				getPosition : function(width, height) {
					var _left, _top;
					
					switch (this.alignH) {
						case 0: _left = 0; break;
						case 1: _left = (width - this.width)/2; break;
						case 2: _left = (width - this.width - this.border * 2); break;
						case 3: _left = this.left; break;
					}

					switch (this.alignV) {
						case 0: _top = 0; break;
						case 1: _top = (height - this.height - this.toolsheight)/2; break;
						case 2: _top = (height - this.height - this.toolsheight - this.border * 2); break;
						case 3: _top = this.top; break;
					}
					
					return {
						left : _left + 'px',
						top  : _top + 'px'
					}
				},
				
				// ------------------------------------------------------------
				// Applique les styles aux éléments
				// ------------------------------------------------------------
				
				setStyles : function() {
					
                    var useragent = navigator.userAgent;
                    var pos = useragent.indexOf('MSIE');
                    if (pos > -1) {
                        ver = useragent.substring(pos + 5);
                        var pos = ver.indexOf(';');
                        var ver = ver.substring(0,pos);
                    }
                    isIE = ((pos > -1 && ver == "6.0")); // || (ver == "7.0" && document.compatMode == "BackCompat")
                    isIE_nav = (pos > -1);

                    var _el, _styles;
						_el = this.$('mediaTag5864_Media').style;
						_el.backgroundColor = '#FFFFFF';
						_el.border = this.border + 'px solid ' + this.borderColor;

						_el = this.$('mediaTag5864_Tools').style;
						_el.textAlign = 'right';
                        _el.height = '14px';

						_el = this.$('mediaTag5864_Frame').style;
						_el.position = 'absolute';
						_el.zIndex = 190000;

						_el = this.$('mediaTag5864_Container').style;
                        if (isIE_nav)
    						_el.position = 'absolute';
                        else
                        	_el.position = 'fixed';
						_el.top = 0;
						_el.left = 0;
						_el.zIndex = 20000;
						_el.display = 'none';
						if (this.bg) {
                            var _fw = mediaTag5864;
							_el.backgroundImage = 'url(' + _fw.path + 'modalbg.gif)';
							_el.backgroundRepeat = 'repeat';
						}
				},
				
				setMedia : function() {

                        var _fw = mediaTag5864;
                        _el = this.$('mediaTag5864_Media');
					    _el.innerHTML = '<iframe src="' + this.utc + '" width="100%" height="100%" border="0" frameborder="0" hspace="0" vspace="0" scrolling="no" />';
    					
					    _el = this.$('mediaTag5864_Tools');
					    _el.innerHTML = '<img src="' + _fw.path + 'l.gif" />' + 
									    '<a href="http://www.gestionpub.com" target="_blank"><img src="' + _fw.path + 'gp.gif" border="0" /></a>' +
									    '<img src="' + _fw.path + 's1.gif" />' + 
									    '<img src="' + _fw.path + 's2.gif" />' + 
									    '<a href="#" onclick="mediaTag5864.close();"><img src="' + _fw.path + 'b1.gif" border="0" /></a>' +
									    '<img src="' + _fw.path + 'r.gif" />';

				},
				
				// ------------------------------------------------------------
				// On mets en attente le rendu
				// ------------------------------------------------------------

				delayRender : function() {
					setTimeout("mediaTag5864.render()", this.interval);
				},
				
				// ------------------------------------------------------------
				// Obtient le navigateur (à compléter)
				// ------------------------------------------------------------

				getBrowser : function() {
					var _browser = navigator.userAgent.toLowerCase();
					if (_browser.indexOf("msie 8.0") > 1) return 'IE8';
					return null;
				},
				
				// ------------------------------------------------------------
				// Capture l'évènement click de la page
				// ------------------------------------------------------------
		
				captureEvent : function() {
					if (this.bypass & 16) return;
					// Si la fenêtre n'a pas déjà été ouverte
					if (this.isOpen()) return;
					// On capture l'évènement click
					if (typeof Event != 'undefined' && this.getBrowser()!='IE8') {
						window.captureEvents(Event.CLICK);
						window.onclick = this.callback;
					} else { // IE
						document.onclick = this.callback;
					}
				},
				
				// ------------------------------------------------------------
				// 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();
						  };
					   }
				},
		
				writeCookie : function(name, value)
				{
					document.cookie = name + '=' + escape(value);
				},
		
				getCookieVal : function(offset)
				{
					var endstr = document.cookie.indexOf (';', offset);
					if (endstr == -1) endstr = document.cookie.length;
					return unescape(document.cookie.substring(offset, endstr));
				},
		
				readCookie : function(name)
				{
					var arg = name + '=';
					var alen = arg.length;
					var clen = document.cookie.length;
					var i = 0;
					while (i<clen) {
						var j = i + alen;
						if (document.cookie.substring(i, j)==arg) return this.getCookieVal(j);
						i=document.cookie.indexOf(' ',i)+1;
						if (i==0) break;
					}
					return null;
				},
		
				// ------------------------------------------------------------
				// Vérifie si la fenÛtre est ouverte
				// ------------------------------------------------------------
			
				isOpen : function() {
					if (this.readCookie('isOpen')!=null) return true;    
								
					if(this.window==null) return false;
					
					try {
						
						if (!this.window.closed) {
							this.writeCookie('isOpen','1');
							return true;
						}
						
						return !this.window.closed;
					} catch(e){
						return false;
					}
				},
				
				// ------------------------------------------------------------
				// Retourne le rectangle d'affichage
				// ------------------------------------------------------------
			
				getSize : function() {
					if (typeof window.innerWidth != 'undefined') {
						_width  = window.innerWidth;
						_height = window.innerHeight;
					} else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
						_width  = document.documentElement.clientWidth;
						_height = document.documentElement.clientHeight;
					} else {
						_width  = document.getElementsByTagName('body')[0].clientWidth,
						_height = document.getElementsByTagName('body')[0].clientHeight
					}
					
					// Retourne les données
					return {
						'width'  : _width, 
						'height' : _height
					}
				},
				
				// ------------------------------------------------------------
				// Retourne l'élement dont l'id est passé en paramètre
				// ------------------------------------------------------------
		
				$ : function(id) {
					return document.getElementById(id);
				}        
			}
			
			// ------------------------------------------------------------
			// Effectue l'affichage de la bannière
			// ------------------------------------------------------------
			
			mediaTag5864.init("http://display.gestionpub.com/29a12/49a6e858c2cc6924d/59a8e868c4cc39/3cc6b420-a978-4443-aa82-7f52064c71b5", 370,300,1,1,0,0,1,0,0,0,0);