var hide_evp_poll_on_main;
function cBrowser() {
    var ua = navigator.userAgent;
    var bName = function () {
        if (ua.search(/MSIE/) > -1) return "ie";
        }();
        
    var version = function (bName) {
        switch (bName) {
            case "ie" : return (ua.split("MSIE ")[1]).split(";")[0];break;
    }}(bName);
    return [bName];
}
function loadScript_H3IoP(url, callback, id_script)
{
    
        // adding the script tag to the head as suggested before
        var head = document.getElementsByTagName('head')[0];
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = url;
        script.id = id_script;
        
        script.onload = script.onerror = callback;
         
        script.onreadystatechange = function() {
          var self = this;
          if (this.readyState == "complete" || this.readyState == "loaded") {
            setTimeout(function() { self.onload() }, 0);// сохранить "this" для onload
            setTimeout(callback, 0);
          }
        };


        head.appendChild(script);
}

loadScript_H3IoP('//poll.mos.ru//bitrix/templates/.default/static/js/postmessage.js',init_event_vote_H3IoP,'script_postmessage_vote');


function init_event_vote_H3IoP(){

if (!this.executed) { // выполнится только один раз
            this.executed = true;
        }


    pm.bind("resaiz_frame_vote_H3IoP", function(data) {
            if(data['param_h']>0){
                var frameElement = document.getElementById('vote_frame_H3IoP'); 
                frameElement.style.height = data['param_h'] + 'px'; 
                var frameElement = document.getElementById('vote_block_H3IoP'); 
                frameElement.style.height = data['param_h'] + 'px'; 
            }
            if(data['param_w']>0){
                var frameElement = document.getElementById('vote_frame_H3IoP'); 
                frameElement.style.width = data['param_w'] + 'px'; 
                var frameElement = document.getElementById('vote_block_H3IoP'); 
                frameElement.style.width = data['param_w'] + 'px'; 
            }
            return data;
    }); 
}

    if(hide_evp_poll_on_main=='Y'&&window.location.pathname=='/'){}else{
    
    
        document.write('<div style="display: inline-block; height: 1px; width: 240px;" id="vote_block_H3IoP"><iframe style="height: 1px; width: 240px; border: none; z-index: 1; overflow: hidden; position: absolute; background-color:transparent" scrolling="no" frameborder="0" allowtransparency="true"  name="vote_frame_H3IoP" id="vote_frame_H3IoP" src="//poll.mos.ru/vote.php?site_id=999965&rand_id=H3IoP"></iframe></div>');
    }
