<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">var ObsTopVote3142 = {
    code:    "222A2B218126252C212A242B03142",
    id:      "3142",
    error:   "",
    info:    "",
    url:     "https://www.observatoiredelafranchise.fr/",
    type:    "H",
    theme:   "blanc",
    width:   null,
    widhtV: 170,
    widthM: 300,
    widthH: 400,

    init: function () {
        if (this.error != '')
            console.error(this.error);
        else
        {
            if (this.info != '')
                console.info(this.info);

            this.loadMarquer();
        }

        window.obsTopVote = this;
    },
    
    loadMarquer : function (width, height, theme) {
        var div     = document.getElementById('_obsTop' + this.id);
        var img     = document.getElementById('_obsImgTop' + this.id);
        var iframe  = document.getElementById('_obsFrame' + this.id);
        var dim     = this.getDim(width, height, theme);

        if (this.width == null)
            this.width = div.offsetWidth || 100;

        if (img)
        {
            iframe.setAttribute('src', this.url + 'top-votes-compter/' + this.code + '-' + this.width + '-' + (new Date().getTime()));
            iframe.setAttribute('width', dim.width);
            iframe.setAttribute('height', dim.height);
            img.setAttribute('style', 'display:block');
            div.style.display = 'inline-block';

            if (this.theme == 'B')
                div.style.backgroundColor="#ffffff";
            else
                div.style.backgroundColor="";

            if (dim.width == this.widhtV)
            {
                img.style.padding = "0";
                img.style.display = "block";
                img.style.margin = '0 auto 5px';
            }
            else
            {
                img.style.padding = '0 0 5px 5px';
                img.style.display = "block";
                img.style.margin = '0';
            }

            img.style.width = 'auto';
        }
    },

    getDim: function (width, height, theme) {
        if (width == undefined &amp;&amp; height == undefined)
        {
            switch (this.type)
            {
                case 'V'    :   return {'width': this.widhtV, 'height': 320};
                                break;

                case 'M'    :   return {'width': this.widthM, 'height': 100};
                                break;

                case 'H'    :
                default     :   return {'width': this.widthH, 'height': 130};
                                break;
            }
        }

        if (theme != undefined)
            this.theme = theme;

        return {'width': width, 'height': height};
    }
}

window.addEventListener("DOMContentLoaded", function()  {
    ObsTopVote3142.init();
});</pre></body></html>