!function(t,e,n){function r(e){var r=t[e];return t[e]=n,r}function o(t,e){return r("yandex_"+(e?e+"_":"")+t)}function a(t,e,n){for(var r=0;r<e.length;r++)t[e[r]]=o(e[r],n)}var c=t.Ya=t.Ya||{};if(!c.loaderVer&&(c.loaderVer=1071),!c.codeVer){var i=Math.random();c.codeVer=.05>=i?1071:.1>=i?1070:.15>=i?1069:1065}if(c.confirmVer=1071,!c.Context){c.Context={_callbacks:[],_asyncIdCounter:0,_asyncModeOn:!1},c.Direct={insertInto:function(t,e,n,r){c.Context._asyncModeOn||(c.Context._asyncModeOn=!0),c.Context.AdvManager?c.Context.AdvManager.renderDirect(t,e,n,r):c.Context._callbacks.push(function(){c.Context.AdvManager.renderDirect(t,e,n,r)})}}}for(var l=["yandex_context_callbacks","yandexContextAsyncCallbacks"],_=0;_<l.length;_++){var s=r(l[_]);if(s){c.Context._asyncModeOn||(c.Context._asyncModeOn=!0);for(var d=0;d<s.length;d++)c.Context._callbacks.push(s[d])}}if(t.yandexContextSyncCallbacks)for(var s=r("yandexContextSyncCallbacks"),_=0;_<s.length;_++)c.Context._callbacks.push(s[_]);var x=["ad_format","site_bg_color","font_size","font_family","stat_id","no_sitelinks","search_text","search_page_number","lang"],f=["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","geo_lat","geo_long","width","height"];if(t.yandex_ad_format){var y={};a(y,x),a(y,f,y.ad_format);var C=y.place;C&&e.getElementById(C)||(C="Ya_sync_"+c.Context._asyncIdCounter++,e.write('<div id="'+C+'"></div>'));var v=o("partner_id");c.Context._callbacks.push(function(){c.Context.AdvManager.renderDirect(v,C,y)})}var u="http:"===t.location.protocol?"http:":"https:",g="an.yandex.ru/resource/context_static_r"+c.codeVer+".js";if(e.getElementById(g)&&c.Context._init)return void c.Context._init();var h=u+"//"+g;if(c.Context._asyncModeOn){var p=e.createElement("script"),b=e.getElementsByTagName("script")[0];p.id=g,p.src=h,b.parentNode.insertBefore(p,b)}else e.write('<script type="text/javascript" src="'+h+'" id="'+g+'"></script>')}(this,this.document);