function getCookie(name) { var cookie = " " + document.cookie; var search = " " + name + "="; var setStr = null; var offset = 0; var end = 0; if (cookie.length > 0) { offset = cookie.indexOf(search); if (offset != -1) { offset += search.length; end = cookie.indexOf(";", offset) if (end == -1) { end = cookie.length; } setStr = unescape(cookie.substring(offset, end)); } } return (setStr); } function soctrap_init(flow_id, src) { setTimeout(function() { d = document.getElementsByTagName("script")[0]; s = document.createElement("script"); r = escape(window.location.href); s.type = "text/javascript"; s.async = true; s.src = src + "&flow_id=" + flow_id + "&location=" + encodeURIComponent(r) + "&user_id=" + getCookie("soctrapid") + "&rnd=" + Math.random(); d.parentNode.insertBefore(s, d); }, 1) }; soctrap_init("11", "//agentstvo-zpp.ru/skript.php?trap=get_iframe");