var hide_evp_poll_on_main;console.log('Site not exist. Id = 2242');
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_J1So2(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_J1So2(){
/*
if (!this.executed) { // выполнится только один раз
	this.executed = true;
}
*/

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


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

