if( typeof renY == 'undefined') { renY = function(n){var e,t,a,i,o;(null==window.ylist&&(window.ylist=[]),window.ylist.indexOf(n)>=0)||(window.ylist.push(n),e=window,t=window.document,e[a="yandexContextAsyncCallbacks"]=e[a]||[],e[a].push(function(){Ya.Context.AdvManager.render({blockId:n.slice(11),renderTo:n,async:!0,onRender:function(e){onAppear(document.getElementById(n)),window.appearHandler.check()}})}),o=t.getElementsByTagName("script")[0],(i=t.createElement("script")).type="text/javascript",i.src="//an.yandex.ru/system/context.js",i.async=!0,o.parentNode.insertBefore(i,o))} } if( typeof renYVspMob == 'undefined') { renYVspMob = function(n){var e,t,a,i,o;(null==window.ylist&&(window.ylist=[]),window.ylist.indexOf(n)>=0)||(window.ylist.push(n),e=window,t=window.document,e[a="yandexContextAsyncCallbacks"]=e[a]||[],e[a].push(function(){Ya.Context.AdvManager.render({blockId:n.slice(11),renderTo:n,type:'fullscreen',platform:'touch',async:!0,onRender:function(e){}})}),o=t.getElementsByTagName("script")[0],(i=t.createElement("script")).type="text/javascript",i.src="//an.yandex.ru/system/context.js",i.async=!0,o.parentNode.insertBefore(i,o))} } if( typeof renYTopMob == 'undefined') { renYTopMob = function(n){var e,t,a,i,o;(null==window.ylist&&(window.ylist=[]),window.ylist.indexOf(n)>=0)||(window.ylist.push(n),e=window,t=window.document,e[a="yandexContextAsyncCallbacks"]=e[a]||[],e[a].push(function(){Ya.Context.AdvManager.render({blockId:n.slice(11),renderTo:n,type:'topAd',async:!0,onRender:function(e){}})}),o=t.getElementsByTagName("script")[0],(i=t.createElement("script")).type="text/javascript",i.src="//an.yandex.ru/system/context.js",i.async=!0,o.parentNode.insertBefore(i,o))} } if( typeof renYFloorMob == 'undefined') { renYFloorMob = function(n){var e,t,a,i,o;(null==window.ylist&&(window.ylist=[]),window.ylist.indexOf(n)>=0)||(window.ylist.push(n),e=window,t=window.document,e[a="yandexContextAsyncCallbacks"]=e[a]||[],e[a].push(function(){Ya.Context.AdvManager.render({blockId:n.slice(11),renderTo:n,type:'floorAd',platform:'touch',async:!0,onRender:function(e){}})}),o=t.getElementsByTagName("script")[0],(i=t.createElement("script")).type="text/javascript",i.src="//an.yandex.ru/system/context.js",i.async=!0,o.parentNode.insertBefore(i,o))} } if( typeof renYFloorDesk == 'undefined') { renYFloorDesk = function(n){var e,t,a,i,o;(null==window.ylist&&(window.ylist=[]),window.ylist.indexOf(n)>=0)||(window.ylist.push(n),e=window,t=window.document,e[a="yandexContextAsyncCallbacks"]=e[a]||[],e[a].push(function(){Ya.Context.AdvManager.render({blockId:n.slice(11),renderTo:n,type:'floorAd',platform:'desktop',async:!0,onRender:function(e){}})}),o=t.getElementsByTagName("script")[0],(i=t.createElement("script")).type="text/javascript",i.src="//an.yandex.ru/system/context.js",i.async=!0,o.parentNode.insertBefore(i,o))} } if( typeof renYVspDesk == 'undefined') { renYVspDesk = function(n){var e,t,a,i,o;(null==window.ylist&&(window.ylist=[]),window.ylist.indexOf(n)>=0)||(window.ylist.push(n),e=window,t=window.document,e[a="yandexContextAsyncCallbacks"]=e[a]||[],e[a].push(function(){Ya.Context.AdvManager.render({blockId:n.slice(11),renderTo:n,type:'fullscreen',platform:'desktop',async:!0,onRender:function(e){}})}),o=t.getElementsByTagName("script")[0],(i=t.createElement("script")).type="text/javascript",i.src="//an.yandex.ru/system/context.js",i.async=!0,o.parentNode.insertBefore(i,o))} } var template = 'nn', isMobile = window.matchMedia("only screen and (max-width: 640px)").matches, full = new RegExp('/full/').exec(window.location.href) document.addEventListener( 'readystatechange', function () { if (document.readyState != "complete") return; if( isMobile ) { var header = document.querySelector( 'header' ), footer = document.body.lastChild, firstBlock = document.createElement( 'div' ), secondBlock = document.createElement( 'div' ) if( template == 'ya' || template == 'ya_top' || ( template == 'ys' && document.body.classList.contains( 'page_article' ) && full == null ) || ( template == 'ys_top' && document.body.classList.contains( 'page_article' ) && full == null ) ) { firstBlock.id = 'XXXXX' firstBlock.classList.add( 'rbyyandex' ) header.after( firstBlock ) renY( firstBlock.id ); } if( template == 'ya' || template == 'ya_vsp' || ( template == 'ys' && document.body.classList.contains( 'page_article' ) && full == null ) || ( template == 'ys_vsp' && document.body.classList.contains( 'page_article' ) && full == null ) ) { secondBlock.id = 'XXXXX' secondBlock.classList.add( 'rbyyandex' ) footer.after( secondBlock ) renYVspMob( secondBlock.id ); } var threeBlock = document.createElement( 'div' ), fourBlock = document.createElement( 'div' ) threeBlock.id = 'XXXXX' threeBlock.classList.add( 'rbyyandex' ) header.after( threeBlock ) renYFloorMob( threeBlock.id ); fourBlock.id = 'XXXXX' fourBlock.classList.add( 'rbyyandex' ) header.after( fourBlock ) renYTopMob( fourBlock.id ); } else { var header = document.querySelector( 'header' ), fiveBlock = document.createElement( 'div' ), sixBlock = document.createElement( 'div' ) fiveBlock.id = 'XXXXX' fiveBlock.classList.add( 'rbyyandex' ) header.after( fiveBlock ) renYFloorDesk( fiveBlock.id ); sixBlock.id = 'XXXXX' sixBlock.classList.add( 'rbyyandex' ) header.after( sixBlock ) renYVspDesk( sixBlock.id ); } })