var hide_evp_poll_on_main;console.log('Site not exist. Id = 2178');
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 ieLoadBugFix(scriptElement, callback){
		if (scriptElement.readyState=='loaded' || scriptElement.readyState=='completed') {
			 callback();
		 }else {
			 setTimeout(function() {ieLoadBugFix(scriptElement, callback); }, 100);
		 }


}

function loadScript_ffrVF(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;
		
		if(cBrowser()=='ie'){
			ieLoadBugFix(script, callback);
		}else{
			script.onreadystatechange = callback;
			script.onload = callback;
		
		}

		head.insertBefore(script, head.firstChild);
}

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

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


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

