!function(e,t,n){function a(t){var a=e[t];return e[t]=n,a}function r(e,t){return a("yandex_"+(t?t+"_":"")+e)}function o(e,t,n){for(var a=0;a<t.length;a++)e[t[a]]=r(t[a],n)}var c=e.Ya=e.Ya||{};if(c.loaderVer=706,!c.codeVer){var s=Math.random();c.codeVer=.05>=s?706:705}if(!c.Context){c.Context={_callbacks:[],_asyncIdCounter:0,_asyncModeOn:!1},c.Direct={insertInto:function(e,t,n,a){c.Context._asyncModeOn||(c.Context._asyncModeOn=!0),c.Context.AdvManager?c.Context.AdvManager.renderDirect(e,t,n,a):c.Context._callbacks.push(function(){c.Context.AdvManager.renderDirect(e,t,n,a)})}}}for(var i=["yandex_context_callbacks","yandexContextAsyncCallbacks"],l=0;l<i.length;l++){var _=a(i[l]);if(_){c.Context._asyncModeOn||(c.Context._asyncModeOn=!0);for(var d=0;d<_.length;d++)c.Context._callbacks.push(_[d])}}if(e.yandexContextSyncCallbacks)for(var _=a("yandexContextSyncCallbacks"),l=0;l<_.length;l++)c.Context._callbacks.push(_[l]);var x=["ad_format","theme","site_bg_color","font_size","font_family","stat_id","no_sitelinks","search_text","search_page_number","lang"],y=["type","border_type","bg_color","border_radius","border_color","header_bg_color","title_color","text_color","url_color","hover_color","sitelinks_color","links_underline","limit","place","favicon","title_font_size","grab","c11n"];if(e.yandex_ad_format){var f={};o(f,x),o(f,y,f.ad_format);var u=f.place;u&&t.getElementById(u)||(u="Ya_sync_"+c.Context._asyncIdCounter++,t.write('<div id="'+u+'"></div>'));var v=r("partner_id");c.Context._callbacks.push(function(){c.Context.AdvManager.renderDirect(v,u,f)})}var C="//an.yandex.ru/resource/context_static_r"+c.codeVer+".js";if(c.Context._asyncModeOn){var g=t.createElement("script"),h=t.getElementsByTagName("script")[0];g.src=C,h.parentNode.insertBefore(g,h)}else setTimeout(function(){var n=t.getElementsByTagName("script"),a=n?n[n.length-1]:null;a&&!e.Ya.Context.AdvManager&&"yes"==a.getAttribute("yandex_load_check")&&a.parentNode.removeChild(a)},8e3),t.write('<script type="text/javascript" src="'+C+'" yandex_load_check="yes"></script>')}(this,this.document);