if ( window.addEventListener ){ window.addEventListener("message", receiveSimpollMessage, false); } if ( window.attachEvent ) { window.attachEvent("onmessage", receiveSimpollMessage); } if ( document.attachEvent ) { document.attachEvent("onmessage", receiveSimpollMessage); } function receiveSimpollMessage(event){ //if (event.origin != 'https://simpoll.ru') { return false; } var cmd = event.data.substring(0,4); var url_key = event.data.substring(5,13); var value = event.data.substring(14); if (cmd == 'size'){ document.getElementById('simpoll_frame_'+url_key).style.height = value+'px'; } if (cmd == 'call'){ eval('var data_obj = '+value); simpollCallback(data_obj); } } if (document.getElementById('simpoll_params')){ var params_str = '?' + document.getElementById('simpoll_params').value; } else { var params_str = ''; } document.writeln('');