Created
February 24, 2020 16:01
-
-
Save ivanscm/e3e5b56edeade88016d6a8d577cd2919 to your computer and use it in GitHub Desktop.
rostelec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ins class="mrg-tag" data-ad-client="ad-595530" data-ad-slot="595530" style="position: fixed; z-index: 9999; top: 0px; left: 466.5px; width: 970px; transform: translateY(-250px);" id="mailru_ad_595530_1582559955420" data-ad-status="ready"> | |
<style> | |
#trg-b-29284408-180507781 { | |
font-size: 14px !important; | |
line-height: 20px!important; | |
font-family: Arial, Verdana, sans-serif !important; | |
font-weight: 300; | |
position: relative!important; | |
box-sizing: border-box !important; | |
text-align: left!important; | |
} | |
#trg-b-29284408-180507781 [data-custclickarea]:hover, | |
#trg-b-29284408-180507781 [data-clickwrap]:hover { | |
cursor: pointer; | |
} | |
</style> | |
<!-- format970x250,1 --> | |
<style> | |
#trg-b-29284408-180507781 { | |
box-sizing: border-box!important; | |
width: 970px!important; | |
height: 250px!important; | |
} | |
#trg-b-29284408-180507781.trg-b-wrap { | |
border: 1px solid #ededed!important; | |
background-color: #fff!important; | |
font-family: Arial,Verdana,sans-serif; | |
font-size: 14px; | |
} | |
#trg-b-29284408-180507781 .trg-b-item-wrap { | |
display: block; | |
color: inherit; | |
text-decoration:none; | |
height: 100%; | |
max-height: 100%; | |
} | |
#trg-b-29284408-180507781 .trg-b-promo-wrap { | |
height: 100%!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-promoimg { | |
max-height: 100%!important; | |
max-width: 100%; | |
width: auto!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-container { | |
display: flex!important; | |
height: 100%; | |
} | |
#trg-b-29284408-180507781 .trg-b-texts { | |
display: flex!important; | |
flex-direction: column!important; | |
justify-content: space-between!important; | |
width: calc(100% - 441px)!important; | |
height: 100%!important; | |
overflow: hidden!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-center-block { | |
margin: 0 30px!important; | |
display: flex!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-header { | |
font-size: 20px!important; | |
line-height: 1.15!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-header-wrapper { | |
margin-bottom: 7px!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-text { | |
font-size: 16px!important; | |
line-height: 1.5!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-contact { | |
margin: 10px 8px!important; | |
display: block !important; | |
text-decoration: none !important; | |
background: url(//r.mradx.net/img/3A/FD5B26.png) 0 0 no-repeat!important; | |
background-size: 16px 16px!important; | |
width: 16px!important; | |
height: 16px!important; | |
position: absolute!important; | |
top: 0!important; | |
right: 0!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-domen { | |
color: #999!important; | |
font-size: 14px!important; | |
margin-top: 10px!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-cta { | |
padding: 0 16px!important; | |
margin: 8px 33px!important; | |
font-size: 12px!important; | |
display: inline-block!important; | |
text-align: center!important; | |
-webkit-border-radius: 3px!important; | |
-moz-border-radius: 3px!important; | |
-ms-border-radius: 3px!important; | |
-o-border-radius: 3px!important; | |
border-radius: 3px!important; | |
text-decoration: none!important; | |
background-color: #00ABF2!important; | |
color: #fff!important; | |
box-shadow: 0 1px 4px 0px rgba(0,0,0,0.5)!important; | |
text-transform: uppercase!important; | |
white-space: nowrap!important; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
max-width: 200px; | |
line-height: 32px!important; | |
height: 32px!important; | |
cursor: pointer; | |
} | |
#trg-b-29284408-180507781 .trg-b-cta-wrap { | |
text-align: right!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-disclaimer { | |
line-height: 1 !important; | |
margin: 0 !important; | |
font-size: 12px !important; | |
color: #999!important; | |
position: relative!important; | |
text-overflow: ellipsis!important; | |
overflow: hidden!important; | |
max-width: 100%!important; | |
white-space: nowrap!important; | |
width: 100%!important; | |
cursor: pointer; | |
} | |
#trg-b-29284408-180507781 .trg-b-age-limit { | |
line-height: 1 !important; | |
font-size: 12px !important; | |
color: #999!important; | |
padding-right: 5px!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-discl-wrap { | |
margin: 7px 30px!important; | |
width: calc(100% - 60px)!important; | |
display: flex!important; | |
justify-content: flex-start!important; | |
} | |
</style> | |
<div id="trg-b-pad-276902"> | |
<div class="trg-b-wrap trg-b-pad-276902" id="trg-b-29284408-180507781"> | |
<img src="https://rs.mail.ru/pixel/AADt7AHJcoKSgmNXJtRc9tAlE8EzCKotbjkR_AHusxCvkstgSwRCio5HHkY2jMRQAT_G1krEZNFxKeOnVYkqx3_U6I-2jbJglbiktCn6FcsVqDgbAE3fIbaJrrlTcJAFVLRAOrbYZAHzbWNjRgA3YLVp4uPcSDm7LOHjeH8crfDZfXGKE6Wq51wfAQAAb1WyaYdZFfElcHvaa70de1_Rrmr6vaevhMXFna00iLI0zz8F8aP69C2zENG-dsNnyYrjaqtNpnAwW8FnXkUExEyrBCzLxl0LU4HkJaBoTbHucFFp3BP_gNMn3KsCc7BsAPXfcJb2y2TQjHS0dl8GRsDT9kyh0pHePEj834jkI0LhyRflFsvvFDai8EsTZKQFaL5FLuNeNSLvRWJmznFpCjeTGoSuJ9ohOemnIN-nLdqXhnxLZovc9G8NIjrhAxo5V658a7W1vzaAa9eKnMnB4LwsG0AgcuBUFsvnwdmhki7XDDsEQf-7yZgLIOeWJgZl43eysHbFFluXnKkXndlClqRNZ3Yy8NsqlZef4QdKqx7JZOVMl2_JMtYoVWCo27tw.gif" style="display:none!important;"> | |
<a rel="noopener" href="//t.mail.ru/redir/AADt7AHJcoKSgmNXJtRc9tAlE8EzCKotbjkR_AHusxCvkstgSwRCio5HHkY2jMRQAT_G1krEZNFxKeOnVYkqx3_U6I-2jbJglbiktCn6FcsVqDgbAE3fIbaJrrlTcJAFVLRAOrbYZAHzbWNjRgA3YLVp4uPcSDm7LOHjeH8crfDZfXGKE9kAlWSXAQAAnXzXh6C7WO_N8FmZkZXWvNVcIRFsxWG4Q_FIHK217fzSUCiy1Hd_1oItvPh-f7NE7ShZ_Q0kZQMgQHRHar_3boLey_pH6UuMc46YJN3e1no8EqviCfl6_QtO9Dc8nIsE4sx5QqS6xyYkH_HbVP7bSrJN9q6_hdgo3DjxMaXpwKY8I2K_YuiV_osyuAvivyqFtMTaLAqZPxM2EzpXNro1Rl2Scylt4pAZFPFdg-utWKBeTWgXKYAqAlJ6yOzObgOgVz0OLp5RgdYQ1pG98cwJw6pqNccmGXdW6cny0_-uYqEB8d1dfmn8OH1-B296Ex63VYmgVs07GOod8J4zdS1jCb-rDa18O6I-_oHUoYzFlqof24xCKpkm8Z-Uikz9wdv1W0X5tWapMCej0NJgyE-nbyCsnbKHmGMIDz32SzP3XJGnTYPKDnEVpIYPyXOu9FnU5UGNSLp2t9z1FNOSlNwWmvaPymFCauIQVPu0v2qvBu_Qm98OCE34--LaeadDiNki0LP1SphwoePPhHfj0rIuWq3Gq7t1FjFNzFbh7xmj0bU" target="_blank" class="trg-b-item-wrap trg-b-banner mailru-visibility-check" id="b53769067_1261741058" data-custclickarea="all" data-clickwrap="wrap" data-closewrap-container="b53769067_1261741058" data-trg-id="53769067"> | |
<span class="mailru-visibility-check-counter" data-counter="https://rs.mail.ru/pixel/AADt7AHJcoKSgmNXJtRc9tAlE8EzCKotbjkR_AHusxCvkstgSwRCio5HHkY2jMRQAT_G1krEZNFxKeOnVYkqx3_U6I-2jbJglbiktCn6FcsVqDgbAE3fIbaJrrlTcJAFVLRAOrbYZAHzbWNjRgA3YLVp4uPcSDm7LOHjeH8crfDZfXGKE-bBYSkZAQAANHtvc8foHhC0u0zFAzYcUp60hMQkppf1RbJciR9e5NwCSkOyh3dDRgJW0lEVzgku0pciCLq6gjibqsiO0POdZGmGDiFbwT-ZTQLpvdgmBrYcIyBxFqfOKyQyN57fCGMGoz0GC_iEcWpfJtO_pFri42CG56FciAw6iRvnk1e7V54E_x8OutLIdMbmQJbmI2cLa9bGEmkvWDrwWagxkwwdeY2dhxM1CUB9UMGPl9vPMFE4THKZjhQoohGOjsaQDn1kVXtVLKR05BbofR4wd6C24ep2TQVsxcdu3ZWYjdr5OEtUdJSpCXWPYHHEM8RMj8-p4TH_7NyE3hmfuX75vdVCW8BSOKolV1CFB2SiVNf1heS6gvBUaDbFwOzMOw6AU9iR.gif" style="display:none"></span> | |
<div class="trg-b-close-wrap js-close-cross-wrap" data-closewrap="b53769067_1261741058"> | |
<div class="trg-b-close-overlay js-close-overlay"><div class="trg-b-close-text js-close-overlay-text ">Спасибо за обратную связь</div></div> | |
<span class="trg-b-close-cross js-close-cross" data-closepix="https://rs.mail.ru/pixel/AADt7AHJcoKSgmNXJtRc9tAlE8EzCKotbjkR_AHusxCvkstgSwRCio5HHkY2jMRQAT_G1krEZNFxKeOnVYkqx3_U6I-2jbJglbiktCn6FcsVqDgbAE3fIbaJrrlTcJAFVLRAOrbYZAHzbWNjRgA3YLVp4uPcSDm7LOHjeH8crfDZfXGKE_bLfnHgAAAAlTFEWLYPDnmX1PM52baA7obMIdJcPy3vx6WK5waKYUj5PN6D0ltIPTv3Qk6HDkYAVD4gvJK2qrBQdtyYp0IwoT1PUEcIi_yEXypShLomCcfRX2yEwPFzz3K52B-bqSEdlbWINFH22EAqKt855VDN5IOFg0Gbb1QZ77QEfI6nsd47Xx-4ApZbugqsF3wK9qgw9Oq92e6MOPscNdolPs7YetqK6BCsC4tVA6fH6GnNhMUsG9l2LM8dDAyE9s6fvkfIa9MqNFcImQw-_OoDdjRysPIcmoRUUNKazKUMIsFDMrw.gif"></span> | |
<div class="trg-b-close-bubble _middle js-close-cross-bubble"> | |
<div class="trg-b-close-bubble__item"><span class="trg-b-close-bubble__link js-close-reason" data-reason="ni">Не интересует</span></div> | |
<div class="trg-b-close-bubble__item"><span class="trg-b-close-bubble__link js-close-reason" data-reason="ab">Уже приобретено</span></div> | |
<div class="trg-b-close-bubble__item"><span class="trg-b-close-bubble__link js-close-reason" data-reason="cv">Препятствует просмотру</span></div> | |
<div class="trg-b-close-bubble__item"><span class="trg-b-close-bubble__link js-close-reason" data-reason="sp">Недобросовестная реклама</span></div> | |
</div> | |
</div> | |
<div class="trg-b-container"> | |
<div class="trg-b-promo-wrap"> | |
<img class="trg-b-promoimg" src="https://r.mradx.net/img/B5/2319E7.jpg"> | |
</div> | |
<div class="trg-b-texts"> | |
<div> </div> | |
<div class="trg-b-center-block"> | |
<div class="trg-b-texts-wrap"> | |
<div class="trg-b-header-wrapper"> | |
<span class="trg-b-header" false="">Дальнобойный фонарь</span> | |
</div> | |
<div class="trg-b-text">Светит на расстояние 1200 метров. Скидка 60%. Легендарный нож Gerber в подарок!</div> | |
<div class="trg-b-domen">dnsshoop.ru</div></div> | |
</div> | |
<div class="trg-b-bottom-block"> | |
<div class="trg-b-cta-wrap"> | |
<div class="trg-b-cta">Перейти</div> | |
</div> | |
<div class="trg-b-discl-wrap"> | |
<div class="trg-b-disclaimer js-trg-item-disclamer _cropped _crel _cright"> | |
<span class="trg-b-disclaimer__text js-trg-item-disclamer-text " title=" ООО "Инструмент" ОГРН 1127746305500 ИНН/КПП 7723834917 503801001 МО, г.Ивантеевка, ул.Трудовая д.7"> ООО "Инструмент" ОГРН 1127746305500 ИНН/КПП 7723834917 503801001 МО, г.Ивантеевка, ул.Трудовая д.7</span> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!-- //t.mail.ru/redir/AADt7AHJcoKSgmNXJtRc9tAlE8EzCKotbjkR_AHusxCvkstgSwRCio5HHkY2jMRQAT_G1krEZNFxKeOnVYkqx3_U6I-2jbJglbiktCn6FcsVqDgbAE3fIbaJrrlTcJAFVLRAOrbYZAHzbWNjRgA3YLVp4uPcSDm7LOHjeH8crfDZfXGKE9kAlWSXAQAAnXzXh6C7WO_N8FmZkZXWvNVcIRFsxWG4Q_FIHK217fzSUCiy1Hd_1oItvPh-f7NE7ShZ_Q0kZQMgQHRHar_3boLey_pH6UuMc46YJN3e1no8EqviCfl6_QtO9Dc8nIsE4sx5QqS6xyYkH_HbVP7bSrJN9q6_hdgo3DjxMaXpwKY8I2K_YuiV_osyuAvivyqFtMTaLAqZPxM2EzpXNro1Rl2Scylt4pAZFPFdg-utWKBeTWgXKYAqAlJ6yOzObgOgVz0OLp5RgdYQ1pG98cwJw6pqNccmGXdW6cny0_-uYqEB8d1dfmn8OH1-B296Ex63VYmgVs07GOod8J4zdS1jCb-rDa18O6I-_oHUoYzFlqof24xCKpkm8Z-Uikz9wdv1W0X5tWapMCej0NJgyE-nbyCsnbKHmGMIDz32SzP3XJGnTYPKDnEVpIYPyXOu9FnU5UGNSLp2t9z1FNOSlNwWmvaPymFCauIQVPu0v2qvBu_Qm98OCE34--LaeadDiNki0LP1SphwoePPhHfj0rIuWq3Gq7t1FjFNzFbh7xmj0bU --> | |
</a> | |
<script> | |
(function(rootElemId, href, openWindowType) {function addElemEvent(E, eventName, callback) { | |
E.addEventListener ? E.addEventListener(eventName, callback, !1) : E.attachEvent && E.attachEvent("on" + eventName, callback); | |
} | |
function hasClickArea(el) { | |
return el.getAttribute('data-custclickarea'); | |
} | |
function isClickAreaEqual(el, area) { | |
return el.getAttribute('data-custclickarea') === area; | |
} | |
function openLink(newLink, clickWrap, jsOpenLink) { | |
if (window.TRGB_S | |
&& window.TRGB_S.fullscreenOpenCallBack | |
&& typeof window.TRGB_S.fullscreenOpenCallBack === "function") { | |
window.TRGB_S.fullscreenOpenCallBack(); | |
} | |
var link = !!newLink ? newLink : href; | |
if (jsOpenLink) { | |
window.open(link, !!openWindowType ? openWindowType : '_blank'); | |
} else { | |
clickWrap.href = link; | |
} | |
} | |
function hasAllowedCustomHref(el) { | |
return isClickAreaEqual(el, 'label') | |
|| isClickAreaEqual(el, 'carousel-item') | |
|| isClickAreaEqual(el, 'carousel-title') | |
|| isClickAreaEqual(el, 'carousel-text') | |
|| isClickAreaEqual(el, 'cta') | |
|| isClickAreaEqual(el, 'carousel-img') || null; | |
} | |
function openLinkUrl(el) { | |
return hasAllowedCustomHref(el) ? el.getAttribute('href') : null; | |
} | |
function closestElement(el, tagName) { | |
tagName = tagName.toLowerCase(); | |
if (el.closest) { | |
return el.closest(tagName); | |
} | |
while (el) { | |
if (el.tagName.toLowerCase() === tagName) { | |
return el; | |
} | |
el = el.parentNode; | |
} | |
return null; | |
} | |
function preventDefault(e) { | |
e.stopImmediatePropagation(); | |
e.preventDefault(); | |
e.cancelBubble = true; | |
} | |
var rootElem = document.getElementById(rootElemId); | |
var clickAreaWrapElem = rootElem.querySelectorAll('[data-clickwrap]')[0]; | |
if (!clickAreaWrapElem) { | |
clickAreaWrapElem = rootElem; | |
} | |
addElemEvent(clickAreaWrapElem, 'click', function(e) { | |
var curEl = e.currentTarget; | |
var el = e.target; | |
var needOpenClickArea = false; | |
var elementLinkWrap = closestElement(el, 'a'); | |
var jsOpenLink = !elementLinkWrap || !!openWindowType; | |
/*e.stopImmediatePropagation(); | |
e.preventDefault(); | |
e.cancelBubble = true;*/ | |
var currentClassName = el && el.className || null; | |
var isValidClassName = (currentClassName && typeof currentClassName === "string") || false; | |
if (isValidClassName) { | |
/* падает если клик на свг блоке, поэтому разделены */ | |
if (el.className.indexOf('trg-b-close-adv') !== -1 || el.className.indexOf('_after-close-text') !== -1) { | |
preventDefault(e); | |
return; | |
} | |
} | |
if (hasClickArea(el)) { | |
jsOpenLink && preventDefault(e); | |
openLink(openLinkUrl(el), elementLinkWrap, jsOpenLink); | |
return false; | |
} | |
if (el === curEl) { | |
preventDefault(e); | |
return; | |
} | |
var parentEl = el.parentNode; | |
while (parentEl !== curEl && !needOpenClickArea && !!parentEl.parentNode) { | |
if (hasClickArea(parentEl)) { | |
needOpenClickArea = true; | |
break; | |
} | |
parentEl = parentEl.parentNode; | |
} | |
if (needOpenClickArea || hasClickArea(curEl)) { | |
var _el = needOpenClickArea ? parentEl : curEl; | |
jsOpenLink && preventDefault(e); | |
openLink(openLinkUrl(_el), elementLinkWrap, jsOpenLink); | |
return false; | |
} | |
preventDefault(e); | |
}); | |
})('b53769067_1261741058', '//t.mail.ru/redir/AADt7AHJcoKSgmNXJtRc9tAlE8EzCKotbjkR_AHusxCvkstgSwRCio5HHkY2jMRQAT_G1krEZNFxKeOnVYkqx3_U6I-2jbJglbiktCn6FcsVqDgbAE3fIbaJrrlTcJAFVLRAOrbYZAHzbWNjRgA3YLVp4uPcSDm7LOHjeH8crfDZfXGKE9kAlWSXAQAAnXzXh6C7WO_N8FmZkZXWvNVcIRFsxWG4Q_FIHK217fzSUCiy1Hd_1oItvPh-f7NE7ShZ_Q0kZQMgQHRHar_3boLey_pH6UuMc46YJN3e1no8EqviCfl6_QtO9Dc8nIsE4sx5QqS6xyYkH_HbVP7bSrJN9q6_hdgo3DjxMaXpwKY8I2K_YuiV_osyuAvivyqFtMTaLAqZPxM2EzpXNro1Rl2Scylt4pAZFPFdg-utWKBeTWgXKYAqAlJ6yOzObgOgVz0OLp5RgdYQ1pG98cwJw6pqNccmGXdW6cny0_-uYqEB8d1dfmn8OH1-B296Ex63VYmgVs07GOod8J4zdS1jCb-rDa18O6I-_oHUoYzFlqof24xCKpkm8Z-Uikz9wdv1W0X5tWapMCej0NJgyE-nbyCsnbKHmGMIDz32SzP3XJGnTYPKDnEVpIYPyXOu9FnU5UGNSLp2t9z1FNOSlNwWmvaPymFCauIQVPu0v2qvBu_Qm98OCE34--LaeadDiNki0LP1SphwoePPhHfj0rIuWq3Gq7t1FjFNzFbh7xmj0bU', ''); | |
</script> | |
</div> | |
</div> | |
<style> | |
#trg-b-29284408-180507781 .js-trg-item-disclamer._cropped | |
{ | |
z-index: 0!important; | |
text-overflow: clip!important; | |
overflow: hidden!important; | |
} | |
#trg-b-29284408-180507781 .js-trg-item-disclamer._cropped._crel | |
{ | |
position: relative!important; | |
} | |
#trg-b-29284408-180507781 ._cropped .js-trg-item-disclamer-text | |
{ | |
position: relative!important; | |
display: inline!important; | |
left: 0!important; | |
} | |
#trg-b-29284408-180507781 ._cropped .js-trg-item-disclamer-star | |
{ | |
opacity: 1!important; | |
transition: opacity 0.3s ease-out!important; | |
} | |
#trg-b-29284408-180507781 ._cropped._cleft .js-trg-item-disclamer-star | |
{ | |
opacity: 0!important; | |
/* transition: opacity 0.3s ease-out!important; */ | |
} | |
#trg-b-29284408-180507781 .js-trg-item-disclamer._cropped:before | |
{ | |
content: ' '!important; | |
position: absolute!important; | |
top: 0!important; | |
left: 0!important; | |
bottom: 0!important; | |
right: 0!important; | |
z-index: 1!important; | |
} | |
/* mask styles */ | |
#trg-b-29284408-180507781 .js-trg-item-disclamer._cropped._cleft._cright | |
{ | |
background: rgba(0, 0, 0, 0)!important; | |
-webkit-mask-image: linear-gradient(-90deg,rgba(255, 255, 255, 0),#fff 15%,#fff 85%,rgba(255, 255, 255, 0))!important; | |
} | |
#trg-b-29284408-180507781 .js-trg-item-disclamer._cropped._cleft | |
{ | |
background: rgba(0, 0, 0, 0)!important; | |
-webkit-mask-image: linear-gradient(90deg,rgba(255, 255, 255, 0),#fff 25%)!important; | |
mask-image: linear-gradient(90deg,hsla(0,0%,100%,0),#fff 25%)!important; | |
} | |
#trg-b-29284408-180507781 .js-trg-item-disclamer._cropped._cright | |
{ | |
background: rgba(0, 0, 0, 0)!important; | |
-webkit-mask-image: linear-gradient(-90deg,rgba(255, 255, 255, 0),#fff 25%)!important; | |
mask-image: linear-gradient(-90deg,hsla(0,0%,100%,0),#fff 25%)!important; | |
} | |
/* end mask styles */ | |
#trg-b-29284408-180507781 .js-trg-item-disclamer._cropped:after | |
{ | |
/* content: '...'!important; */ | |
content: ' '!important; | |
position: absolute!important; | |
bottom: 2px!important; | |
right: 2px!important; | |
z-index: 1!important; | |
/*color: #d0cccc;*/ | |
color: #b5b5b5!important; | |
} | |
#trg-b-29284408-180507781 .js-trg-item-disclamer._cropped._cnodots:after | |
{ | |
display: none!important; | |
} | |
#trg-b-29284408-180507781 .js-trg-item-disclamer ._chide | |
{ | |
opacity: 0!important; | |
} | |
#trg-b-29284408-180507781 ._mask-cropped.js-trg-item-disclamer._cropped._cleft._cright { | |
background: rgba(0, 0, 0, 0)!important; | |
-webkit-mask-image: linear-gradient(-90deg,rgba(255, 255, 255, 0),#fff 15%,#fff 85%,rgba(255, 255, 255, 0))!important; | |
} | |
#trg-b-29284408-180507781 ._mask-cropped.js-trg-item-disclamer._cropped._cleft { | |
background: rgba(0, 0, 0, 0)!important; | |
-webkit-mask-image: linear-gradient(90deg,rgba(255, 255, 255, 0),#fff 25%)!important; | |
mask-image: linear-gradient(90deg,hsla(0,0%,100%,0),#fff 25%)!important; | |
} | |
#trg-b-29284408-180507781 ._mask-cropped.js-trg-item-disclamer._cropped._cright { | |
background: rgba(0, 0, 0, 0)!important; | |
-webkit-mask-image: linear-gradient(-90deg,rgba(255, 255, 255, 0),#fff 25%)!important; | |
mask-image: linear-gradient(-90deg,hsla(0,0%,100%,0),#fff 25%)!important; | |
} | |
#trg-b-29284408-180507781 ._mask-cropped.js-trg-item-disclamer:before, | |
#trg-b-29284408-180507781 ._mask-cropped.js-trg-item-disclamer:after { | |
display: none!important; | |
} | |
/* t2 */ | |
</style> | |
<script> | |
(function(rootElementId) { | |
/* getElemByClassName func for ie 8*/ | |
if (!document.getElementsByClassName) { | |
var indexOf = [].indexOf || function (prop) { | |
for (var i = 0; i < this.length; i++) { | |
if (this[i] === prop) return i; | |
} | |
return -1; | |
}; | |
getElementsByClassName = function (className, context) { | |
className = (className + '').replace(/ +/, ''); | |
var elems = document.querySelectorAll ? context.querySelectorAll("." + className) : (function () { | |
var all = context.getElementsByTagName("*"), | |
elements = [], | |
i = 0; | |
for (; i < all.length; i++) { | |
if (all[i].className && (" " + all[i].className + " ").indexOf(" " + className + " ") > -1 && indexOf.call(elements, all[i]) === -1) elements.push(all[i]); | |
} | |
return elements; | |
})(); | |
return elems; | |
}; | |
document.getElementsByClassName = function (className) { | |
return getElementsByClassName(className, document); | |
}; | |
if (Element) { | |
Element.prototype.getElementsByClassName = function (className) { | |
return getElementsByClassName(className, this); | |
}; | |
} | |
} | |
/* end getElemByClassName func for ie 8*/ | |
function getFirstArrEl(el) { | |
if (el && el.length) { | |
el = el[0]; | |
} | |
return el; | |
} | |
function getDisclaimerTextElem(rootEl) { | |
return getFirstArrEl(rootEl.getElementsByClassName('js-trg-item-disclamer-text')); | |
} | |
function getDisclaimerStarElem(rootEl) { | |
return getFirstArrEl(rootEl.getElementsByClassName('js-trg-item-disclamer-star')); | |
} | |
function getElementCurrentWidth(elem) { | |
var size = elem.getClientRects(); | |
size = getFirstArrEl(size); | |
return (!!size.width) ? size.width : size.right - size.left; | |
} | |
function getElemCurrentLeftStyle(elem) { | |
return parseInt(elem.style.left) || 0; | |
} | |
function addClass(elem, className) { | |
if (elem.className.indexOf(className) === -1) { | |
elem.className += ' ' + className; | |
} | |
} | |
function deleteClass(elem, className) { | |
if (elem.className.indexOf(className) !== -1) { | |
elem.className = elem.className.replace(' ' + className, ''); | |
} | |
} | |
function addCropLeftClass(elem) { | |
addClass(elem, '_cleft'); | |
} | |
function deleteCropLeftClass(elem) { | |
deleteClass(elem, '_cleft'); | |
} | |
function addCropRightClass(elem) { | |
addClass(elem, '_cright'); | |
} | |
function deleteCropRightClass(elem) { | |
deleteClass(elem, '_cright'); | |
} | |
function addDisclaimerScrollTimer(elem, rootElId) { | |
TIMER = setInterval(function() { | |
if (!checkRoot(rootElId)) { | |
removeDisclaimerScrollTimer(elem); | |
return; | |
} | |
var starEl = getDisclaimerStarElem(elem); | |
if (starEl.length) { | |
addClass(starEl, '_chide'); | |
} | |
var textEl = getDisclaimerTextElem(elem); | |
var leftOffset = getElemCurrentLeftStyle(textEl); | |
var discWidth = getElementCurrentWidth(elem); | |
var textElemWidth = getElementCurrentWidth(textEl); | |
if (textElemWidth + leftOffset + STAR_SIZE_OFFSET < discWidth) { | |
resetOffset = true; | |
removeDisclaimerScrollTimer(elem); | |
deleteCropRightClass(elem); | |
addClass(elem, '_cnodots'); | |
} else { | |
addCropLeftClass(elem); | |
deleteClass(elem, '_cnodots'); | |
textEl.style.cssText = 'left: ' + (getElemCurrentLeftStyle(textEl) - 1) + 'px!important;'; | |
} | |
}, 10); | |
} | |
function removeDisclaimerScrollTimer(elem) { | |
clearInterval(TIMER); | |
} | |
function setMouseOutActions(elem) { | |
if (!!resetOffset) { | |
getDisclaimerTextElem(elem).style.left = 0; | |
getDisclaimerTextElem(elem).style.cssText = ''; | |
var starEl = getDisclaimerStarElem(elem); | |
if (starEl.length) { | |
deleteClass(starEl, '_chide'); | |
} | |
deleteClass(elem, '_cnodots'); | |
deleteCropLeftClass(elem); | |
addCropRightClass(elem); | |
} | |
removeDisclaimerScrollTimer(elem); | |
resetOffset = false; | |
} | |
function checkRoot(rootElId) { | |
return !!document.getElementById(rootElId); | |
} | |
function initDisclamerScroll(scrollElem, rootElId) { | |
addClass(scrollElem, '_cropped'); | |
var elemPosStyle = null; | |
if (window.getComputedStyle && typeof window.getComputedStyle === 'function') { | |
elemPosStyle = window.getComputedStyle(scrollElem).position; | |
} else { | |
elemPosStyle = scrollElem.currentStyle['position']; | |
} | |
if (elemPosStyle !== 'absolute') { | |
addClass(scrollElem, '_crel'); | |
} | |
addCropRightClass(scrollElem); | |
if (scrollElem.className.indexOf('js-mobile') !== -1) { | |
addClass(scrollElem, '_mask-cropped'); | |
scrollElem.onclick = function (e) { | |
e.preventDefault(); | |
e.stopImmediatePropagation(); | |
if (TAP) { | |
addDisclaimerScrollTimer(scrollElem, rootElId); | |
TAP = false; | |
} else { | |
setMouseOutActions(scrollElem); | |
TAP = true; | |
} | |
}; | |
} else { | |
scrollElem.onmouseover = function (e) { | |
addDisclaimerScrollTimer(scrollElem, rootElId); | |
}; | |
scrollElem.onmouseout = function (e) { | |
setMouseOutActions(scrollElem); | |
}; | |
} | |
} | |
function globInit() { | |
var rootElem = document.getElementById(rootElementId); | |
if (!rootElem) { | |
return; | |
} | |
var elems = rootElem.getElementsByClassName('js-trg-item-disclamer'); | |
for (var i = 0; i < elems.length; i++) { | |
var discElem = elems[i]; | |
var discWidth = getElementCurrentWidth(discElem); | |
var discScrollWidth = discElem.scrollWidth; | |
if (discScrollWidth > discWidth) { | |
initDisclamerScroll(discElem, rootElementId); | |
INIT = true; | |
clearInterval(INIT_TIMER); | |
} | |
if (!isNaN(discWidth)) { | |
clearInterval(INIT_TIMER); | |
} | |
} | |
} | |
var STAR_SIZE_OFFSET = 20; | |
var TIMER = null; | |
var INIT_TIMER = null; | |
var INIT = false; | |
var TAP = true; | |
var resetOffset = false; | |
globInit(); | |
INIT_TIMER = setInterval(function() { | |
if (!INIT) { /*document.getElementById(rootElementId).getClientRects()*/ | |
globInit(); | |
} | |
}, 500); | |
/*document.addEventListener("DOMContentLoaded", function(event) { | |
globInit(); | |
});*/ | |
})('trg-b-29284408-180507781'); | |
</script> | |
<!--closeBlock--><style> | |
#trg-b-29284408-180507781 [data-closewrap-container] { | |
position: relative; | |
z-index: 0; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-cross { | |
width: 16px; | |
height: 16px; | |
display: none; | |
position: absolute; | |
top: 0px; | |
right: 0px; | |
cursor: pointer; | |
visibility: visible; | |
background: #fff url(//r.mradx.net/img/40/8B79EF.png) no-repeat center center; | |
background: rgba(255, 255, 255, 0.5) url(//r.mradx.net/img/40/8B79EF.png) no-repeat center center; | |
background-size: 8px; | |
font-size: 0px; | |
line-height: 0px; | |
text-align: center; | |
font-family: Arial, Verdana, sans-serif !important; | |
} | |
#trg-b-29284408-180507781 ._mobile .trg-b-close-cross { | |
display: block!important; | |
} | |
#trg-b-29284408-180507781 ._mobile.trg-b-close-wrap { | |
text-align: left!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-cross:hover { | |
background: #fff url(//r.mradx.net/img/40/8B79EF.png) no-repeat center center; | |
background: rgba(255, 255, 255, 0.7) url(//r.mradx.net/img/40/8B79EF.png) no-repeat center center; | |
background-size: 8px; | |
} | |
#trg-b-29284408-180507781 [data-closewrap-container]:hover .trg-b-close-cross { | |
display: block; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-bubble { | |
opacity: 0; | |
position: absolute; | |
padding: 6px; | |
top: 1px; | |
right: 15px; | |
background: #fff; | |
-webkit-border-radius: 2px; | |
-moz-border-radius: 2px; | |
-ms-border-radius: 2px; | |
-o-border-radius: 2px; | |
border-radius: 2px; | |
-webkit-box-shadow: 0 1px 3px 0px rgba(0,0,0,0.15); | |
-moz-box-shadow: 0 1px 3px 0px rgba(0,0,0,0.15); | |
-ms-box-shadow: 0 1px 3px 0px rgba(0,0,0,0.15); | |
-o-box-shadow: 0 1px 3px 0px rgba(0,0,0,0.15); | |
box-shadow: 0 1px 3px 0px rgba(0,0,0,0.15); | |
z-index: 1000000; | |
transition: opacity 0.3s ease-out; | |
white-space: normal; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-bubble._middle { | |
padding: 10px; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-bubble._nano { | |
padding: 5px; | |
width: 80px; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-bubble._nano .trg-b-close-bubble__item { | |
padding-left: 0; | |
font-size: 9px; | |
line-height: 1.3; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-bubble._nano .trg-b-close-bubble__item:before { | |
display: none; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-overlay { | |
content: ''; | |
position: absolute; | |
top: 0; | |
bottom: 0px; | |
left: 0; | |
right: 0; | |
background: #fff; | |
background: rgba(255, 255, 255, 0.95); | |
opacity: 0; | |
text-align: center; | |
transition: background 0.3s ease-out, opacity 0.3s ease-out; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-text { | |
padding: 10px 3px 0; | |
color: #333; | |
font-size: 12px; | |
line-height: 1.2; | |
visibility: hidden; | |
display: block; | |
text-align: center; | |
text-shadow: 1px 1px 0 #fff; | |
text-shadow: 1px 1px 0px rgba(255,255,255,0.8); | |
white-space: normal; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-text._middle { | |
top: 50%; | |
position: relative; | |
transform: translateY(-50%); | |
padding-top: 0; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-text._nano { | |
padding: 5px; | |
font-size: 9px; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-wrap._active .trg-b-close-cross, | |
#trg-b-29284408-180507781 .trg-b-close-wrap._active .trg-b-close-overlay, | |
#trg-b-29284408-180507781 .trg-b-close-wrap._active .trg-b-close-bubble { | |
display: block; | |
opacity: 1; | |
visibility: visible; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-wrap._hidden .trg-b-close-text { | |
visibility: visible !important; | |
display: block !important; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-wrap._hidden .trg-b-close-overlay { | |
visibility: visible !important; | |
display: block !important; | |
background: #fff !important; | |
opacity: 1; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-wrap._hidden .trg-b-close-cross, | |
#trg-b-29284408-180507781 .trg-b-close-wrap._hidden .trg-b-close-bubble { | |
display: none!important; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-bubble__item:before { | |
content: '\2014'; | |
position: absolute; | |
left: 0; | |
top: 0; | |
color: #9B9B9B; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-bubble__item { | |
position: relative; | |
padding-left: 16px; | |
font-size: 12px; | |
line-height: 1.4; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-bubble__link { | |
color: #4A90E2; | |
cursor: pointer; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-bubble__link:hover { | |
color: #333; | |
} | |
#trg-b-29284408-180507781 .trg-b-close-wrap { | |
position: absolute; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
visibility: hidden; | |
z-index: 100000; | |
} | |
</style> | |
<script> | |
(function(params) { | |
var closeEl, closeBubbleEl, closeItemsEl, closeWrapEl, closeOverEl; | |
var pixels = { | |
ni: "https://rs.mail.ru/sb36635784.gif?", | |
ab: "https://rs.mail.ru/sb36635789.gif?", | |
sp: "https://rs.mail.ru/sb36635790.gif?", | |
cv: "https://rs.mail.ru/sb36635791.gif?" | |
}; | |
function stopE(e) { | |
if (e) { e.preventDefault(); e.stopImmediatePropagation(); } | |
} | |
function addElemEvent(E, eventName, callback) { | |
E.addEventListener ? E.addEventListener(eventName, callback, !1) : E.attachEvent && E.attachEvent("on" + eventName, callback); | |
} | |
function removeElemEvent(E, eventName, callback) { | |
E.removeEventListener ? E.removeEventListener(eventName, callback, !1) : E.detachEvent && E.detachEvent("on" + eventName, callback); | |
} | |
function sendPix(pix, params) { | |
var img = document.createElement('img'); | |
img.src = pix || ''; | |
img.style.display = 'none'; | |
params.closeWrapEl.appendChild(img); | |
} | |
function getParentBannerItem(el) { | |
var retval = null; | |
var parentAttr = 'data-closewrap-container'; | |
var parentEl = el; | |
while (parentEl) { | |
if (parentEl === document.getElementsByTagName('body')[0]) { | |
retval = null; | |
break; | |
} else if (parentEl.getAttribute(parentAttr)) { | |
retval = parentEl; | |
break; | |
} | |
parentEl = parentEl.parentElement; | |
} | |
return retval; | |
} | |
function closeAll(params) { | |
params.closeWrapEl.className = params.closeWrapEl.className.replace(' _active', ' _hidden'); | |
removeElemEvent(params.closeEl, 'click', onCloseClick); | |
removeElemEvent(params.closeOverEl, 'click', hideClose); | |
for (var i = 0; i < params.closeItemsEl.length; i++) { | |
removeElemEvent(params.closeItemsEl[i], 'click', onCloseReasonClick); | |
} | |
} | |
function onCloseReasonClick(params, e) { | |
stopE(e); | |
var pix = pixels[e.currentTarget.getAttribute('data-reason')]; | |
if (pix) { sendPix(pix, params); } | |
sendPix(params.closeEl.getAttribute('data-closepix'), params); | |
closeAll(params); | |
} | |
function onCloseClick(params, e) { | |
stopE(e); | |
if (params.closeWrapEl.className.indexOf(' _active') === -1) { showClose(params); } else { hideClose(params); } | |
} | |
function hideClose(params, e) { | |
stopE(e); | |
params.closeWrapEl.className = params.closeWrapEl.className.replace(' _active', ''); | |
var parentBannerWrapItem = getParentBannerItem(params.closeWrapEl); | |
parentBannerWrapItem.className = parentBannerWrapItem.className.replace(' _close-overlay', ''); | |
} | |
function showClose(params) { | |
params.closeWrapEl.className += ' _active'; | |
var parentBannerWrapItem = getParentBannerItem(params.closeWrapEl); | |
parentBannerWrapItem.className += ' _close-overlay'; | |
} | |
function init() { | |
if (!params || !params.rootId || !document.querySelectorAll) return; | |
var rootElem = document.getElementById(params.rootId); | |
if (!rootElem) return; | |
closeWrapEl = rootElem.querySelectorAll('.js-close-cross-wrap'); | |
if (!closeWrapEl || !closeWrapEl[0]) return; | |
closeEl = rootElem.querySelectorAll('.js-close-cross'); | |
closeBubbleEl = rootElem.querySelectorAll('.js-close-cross-bubble'); | |
closeOverEl = rootElem.querySelectorAll('.js-close-overlay'); | |
for (var k = 0; k < closeEl.length; k++) { | |
closeItemsEl = closeWrapEl[k].querySelectorAll('.js-close-reason'); | |
if (!closeEl || !closeBubbleEl || !closeOverEl || !closeWrapEl[k] || !closeEl[k] || !closeBubbleEl[k] || !closeOverEl[k]) return; | |
addElemEvent(closeBubbleEl[k], 'click', function(e) { | |
e.stopImmediatePropagation(); | |
e.preventDefault(); | |
}); | |
addElemEvent(closeEl[k], 'click', onCloseClick.bind(null, { | |
closeWrapEl:closeWrapEl[k], | |
closeEl:closeEl[k], | |
closeBubbleEl:closeBubbleEl[k], | |
closeOverEl:closeOverEl[k], | |
closeItemsEl:closeItemsEl | |
})); | |
addElemEvent(closeOverEl[k], 'click', hideClose.bind(null, { | |
closeWrapEl:closeWrapEl[k], | |
closeEl:closeEl[k], | |
closeBubbleEl:closeBubbleEl[k], | |
closeOverEl:closeOverEl[k], | |
closeItemsEl:closeItemsEl | |
})); | |
for (var i = 0; i < closeItemsEl.length; i++) { | |
addElemEvent(closeItemsEl[i], 'click', onCloseReasonClick.bind(null, { | |
closeWrapEl:closeWrapEl[k], | |
closeEl:closeEl[k], | |
closeBubbleEl:closeBubbleEl[k], | |
closeOverEl:closeOverEl[k], | |
closeItemsEl:closeItemsEl | |
})); | |
} | |
} | |
} | |
init(); | |
})({rootId: 'trg-b-29284408-180507781'}); | |
</script><!--/closeBlock--> | |
<style> | |
#trg-b-pad-276902 .trg-b-wrap { | |
border-style:solid!important;border-color:#210f38!important;border-width:1px!important;background-color:#fefefe!important;} | |
#trg-b-pad-276902 .trg-b-wrap .trg-b-header { | |
color:#210f38!important;font-family:Verdana,Arial,Verdana,sans-serif!important;font-size:22px!important;text-decoration:none!important;} | |
#trg-b-pad-276902 .trg-b-wrap .trg-b-header:hover { | |
color:#000!important;} | |
#trg-b-pad-276902 .trg-b-wrap .trg-b-domen { | |
color:#00cbca!important;font-family:Open Sans,Arial,Verdana,sans-serif!important;font-size:18px!important;text-decoration:underline!important;} | |
#trg-b-pad-276902 .trg-b-wrap .trg-b-domen:hover { | |
color:#999!important;} | |
#trg-b-pad-276902 .trg-b-wrap .trg-b-text { | |
color:#000!important;font-family:Open Sans,Arial,Verdana,sans-serif!important;font-size:17px!important;} | |
#trg-b-pad-276902 .trg-b-wrap .trg-b-cta { | |
color:white!important;font-family:Roboto,Arial,Verdana,sans-serif!important;font-size:14px!important;background-color:#851796!important;} | |
</style> | |
<script> | |
try { | |
(function(w, d, prefix) { | |
w.RB = w.RB && w.RB.v && w.RB.v === 1 ? w.RB : (function() { | |
var | |
// main flag, | |
enabled = !1, | |
enabledObserver = !1, | |
enabledGeom = !1, | |
useObserver = !1, | |
useGeom = !1, | |
// old opera focus flag | |
focused = !0, | |
// counted flag | |
counted = 'mailru-visibility-counted', | |
// banners to inspect | |
banners = {}, | |
// shortcuts | |
e = d.documentElement, | |
VE = (d.mozVisibilityState ? "mozvisibilitychange" : d.webkitVisibilityState ? "webkitvisibilitychange" : d.visibilityState ? "visibilitychange" : ""), | |
HP = ("hidden" in d) ? "hidden" : (("webkitHidden" in d) ? "webkitHidden" : (("mozHidden" in d) ? "mozHidden" : "")), | |
// lastTimeStamp = 0, | |
// timing | |
tm, | |
// interstion observer instance | |
observer, | |
supportIO = !!window.IntersectionObserver; | |
// handlers | |
function onFocusIn() { | |
focused = !0; | |
C(!0); | |
} | |
function onFocusOut() { | |
focused = !1; | |
} | |
// using visibility could have profits when tab is not | |
function onVisibilityChange() { | |
if (!d[HP]) onFocusIn() | |
else onFocusOut() | |
} | |
function onWindowScroll() { | |
C(); | |
} | |
function onWindowResize() { | |
C(); | |
} | |
// I – inspect | |
function I(bannerObject, id) { | |
if (Object.prototype.toString.call(bannerObject) === '[object Array]') { | |
Clear(bannerObject); | |
var k = bannerObject.length - 1; | |
for (; k >= 0; k--) { | |
if (!s(bannerObject[k].el, counted)) { | |
I(bannerObject[k]); | |
} | |
}; | |
return; | |
} | |
// bannerObject contains bannerObject.el and bannerObject.pixels | |
if (!bannerObject.el.id) { | |
id = prefix + (new Date().getTime()) + (Math.round(Math.random() * 1E6)); | |
bannerObject.el.id = id; | |
} | |
id = bannerObject.el.id; | |
var io = bannerObject.observer; | |
io = io && supportIO; | |
// lastTimeStamp = new Date().getTime(); | |
// adding the banner container to storage | |
if (!banners[id]) { | |
banners[id] = { | |
c: bannerObject.el, | |
px: bannerObject.pixels, | |
cb: bannerObject.callback, | |
io: io | |
}; | |
} | |
// enabling anyway | |
useObserver = useObserver || io; | |
useGeom = useGeom || !io; | |
on(); | |
if (io) { | |
o(bannerObject.el); | |
} | |
C(!0); | |
} | |
// C – check viewability of banner with t, timeout after loading | |
function C(t) { | |
for (var id in banners) { | |
if (banners[id] && !G(id)) { | |
CL(id); | |
} else if (banners[id] && getVA(banners[id].c) >= 50 && hasFocus() && !banners[id].t) { | |
(function(_id) { | |
banners[_id].t = setTimeout(function() { | |
try { | |
P(_id) | |
} catch (e) {} | |
}, 1E3) | |
}(id)); | |
} else if (banners[id] && getVA(banners[id].c) < 50) { | |
if (banners[id].t) { | |
clearTimeout(banners[id].t); | |
delete banners[id].t; | |
} | |
} else if (banners[id] && !hasFocus()) { | |
if (banners[id].t) { | |
clearTimeout(banners[id].t); | |
delete banners[id].t; | |
clearTimeout(tm); | |
t = false; | |
} | |
} else if (!banners[id]) { | |
CL(id); | |
} | |
} | |
if (t && useGeom) { | |
clearTimeout(tm); | |
tm = setTimeout(function() { | |
C(!0); | |
}, 3e2); | |
} | |
} | |
// CL – Clear timers and stop listeners | |
function CL(id, onlyTM) { | |
if (id && banners[id]) { | |
clearTimeout(banners[id].t); | |
banners[id].t = null; | |
if (!onlyTM) { | |
if (banners[id].io && observer) { | |
observer.unobserve(banners[id].c); | |
} | |
banners[id].c = null; | |
delete banners[id]; | |
} | |
return; | |
} | |
clearTimeout(tm); | |
tm = null; | |
for (var id in banners) { | |
if (banners[id].t) { | |
CL(id, !0) | |
} | |
} | |
} | |
function Clear(bannersArray) { | |
if (bannersArray && bannersArray.length >= 0) { //clear banners from array | |
var k = bannersArray.length - 1; | |
var id; | |
for (; k >= 0; k--) { | |
id = bannersArray[k].el.id; | |
if (id && banners[id]) { | |
CL(id); | |
} | |
}; | |
} else { | |
for (var id in banners) { //clear all | |
CL(id); | |
} | |
} | |
} | |
// P – pixel to send | |
function P(id, obj, cnt) { | |
if (!G(id)) { | |
CL(id); | |
// banner removed | |
return | |
} | |
if (banners[id]) { | |
obj = banners[id].c; | |
} else { | |
return; | |
} | |
if (!hasFocus()) { | |
CL(id, !0); | |
return; | |
} else if (getVA(obj) < 50) { | |
CL(id, !0); | |
return; | |
} | |
for (cnt = banners[id].px.length - 1; cnt >= 0; cnt--) { | |
new Image().src = banners[id].px[cnt]; | |
}; | |
// set counted flag - skip in next collect loops | |
obj[counted] = true; | |
//try fire callback | |
var cb = banners[id].cb; | |
if (cb && typeof cb === 'function') { | |
try { | |
cb(); | |
} catch (e) {} | |
} | |
// remove banner from storage of inspectable items | |
CL(id); | |
// turn listeners off if banners are not present | |
if (!l(banners)) off(); | |
} | |
function hasFocus() { | |
if (HP) focused = !d[HP]; | |
else if (!VE && typeof d.hasFocus === "function") focused = d.hasFocus(); | |
return focused; | |
} | |
function getVA(obj, source) { | |
if (obj.id && banners[obj.id] && banners[obj.id].io) { | |
return banners[obj.id].v || 0; | |
} | |
var R = {}; | |
R.w = R.h = Infinity; | |
if (!isNaN(d.body.clientWidth) && d.body.clientWidth > 0) { | |
R['w'] = d.body.clientWidth; | |
} | |
if (!isNaN(d.body.clientHeight) && d.body.clientHeight > 0) { | |
R['h'] = d.body.clientHeight; | |
} | |
if (!!e && !!e.clientWidth && !isNaN(e.clientWidth)) { | |
R['w'] = e.clientWidth; | |
} | |
if (!!e && !!e.clientHeight && !isNaN(e.clientHeight)) { | |
R['h'] = e.clientHeight; | |
} | |
if (!!w.innerWidth && !isNaN(w.innerWidth)) { | |
R['w'] = Math.min(R['w'], w.innerWidth); | |
} | |
if (!!w.innerHeight && !isNaN(w.innerHeight)) { | |
R['h'] = Math.min(R['h'], w.innerHeight); | |
} | |
if (R.h == Infinity || R.h == Infinity) { | |
R = { | |
"E": ":-(" | |
}; | |
} else { | |
var r = obj.getClientRects()[0]; | |
if (!r) { | |
R = { | |
"p": 0 | |
}; | |
return R; | |
} | |
R.t = r.top; | |
R.b = r.bottom; | |
R.l = r.left; | |
R.r = r.right; | |
if (r.bottom < 0 || r.right < 0 || r.top > R.clientHeight || r.left > R.clientWidth) { | |
R = 0; | |
} else { | |
var totalObjectArea = (r.right - r.left) * (r.bottom - r.top), | |
xMin = Math.ceil(Math.max(0, r.left)), | |
xMax = Math.floor(Math.min(R.w, r.right)), | |
yMin = Math.ceil(Math.max(0, r.top)), | |
yMax = Math.floor(Math.min(R.h, r.bottom)), | |
visibleObjectArea = (xMax - xMin) * (yMax - yMin); | |
R = Math.round(visibleObjectArea / totalObjectArea * 100); | |
} | |
} | |
return R; | |
} | |
/** LISTENERS SWITCHERS **/ | |
function on() { | |
if (enabled) return; | |
if (!enabledGeom && useGeom) { | |
ev(w, 'resize', onWindowResize); | |
ev(w, 'scroll', onWindowScroll); | |
enabledGeom = true; | |
} | |
if (!enabledObserver && useObserver) { | |
observer = new IntersectionObserver(h, { | |
threshold: [0.5] | |
}); | |
enabledObserver = true; | |
} | |
if (VE) ev(d, VE, onVisibilityChange); | |
else { | |
ev(w, 'blur', onFocusOut); | |
ev(w, 'focus', onFocusIn); | |
} | |
if (enabledGeom && enabledObserver) { | |
enabled = true; | |
} | |
} | |
function off() { | |
rm(w, 'resize', onWindowResize); | |
rm(w, 'scroll', onWindowScroll); | |
if (VE) rm(d, VE, onVisibilityChange); | |
rm(w, 'focus', onFocusIn); | |
rm(w, 'blur', onFocusOut); | |
if (observer) { | |
observer.disconnect(); | |
observer = null; | |
} | |
clearTimeout(tm); | |
enabled = false; | |
useObserver = false; | |
useGeom = false; | |
enabledGeom = false; | |
enabledObserver = false; | |
} | |
/** INTERSECTION OBSERVER UTILS **/ | |
function o(e) { | |
observer && observer.observe(e); | |
} | |
function h(changes) { | |
changes.forEach(function(changeRecord) { | |
var element = changeRecord.target; | |
var id = element.id; | |
if (id && banners[id]) { | |
banners[id].v = Math.round(changeRecord.intersectionRatio * 100); | |
} | |
}); | |
C(); | |
} | |
/** UTILS **/ | |
// G - get element by ID; | |
function G(E) { | |
return d.getElementById(E) | |
} | |
// ev - EVent to handle | |
function ev(elem, eventName, callback) { | |
elem.addEventListener ? elem.addEventListener(eventName, callback, !1) : elem.attachEvent && elem.attachEvent("on" + eventName, callback) | |
} | |
function rm(elem, eventName, callback) { | |
elem.removeEventListener ? elem.removeEventListener(eventName, callback, !1) : elem.detachEvent && elem.detachEvent("on" + eventName, callback) | |
} | |
// obj length | |
function l(obj) { | |
var s = 0, | |
key; | |
for (key in obj) { | |
if (obj.hasOwnProperty(key)) s++ | |
} | |
return s; | |
} | |
function s(elem, state) { | |
return !(typeof elem[state] == undefined || elem[state] !== true); | |
} | |
//elem state | |
/** PUBLIC INTERFACE **/ | |
return { | |
I: I | |
// debug | |
// , banners: banners | |
, | |
v: 1 | |
} | |
}()); | |
}(window, document, 'mailru')) | |
} catch (e) {} | |
</script> | |
<script> | |
(function(prefix){ | |
try{ | |
function getAdsContainers() { | |
var ADS_CLASS = prefix + '-visibility-check', | |
ADS_COUNTER_CLASS = ADS_CLASS + '-counter', | |
ADS_CALLBACK_CLASS = ADS_CLASS + '-callback', | |
COUNTER_ATTR = 'data-counter', | |
CALLBACK_ATTR = 'data-callback', | |
OBSERVER_ATTR = 'data-observer', | |
containers = [], | |
countables = [], | |
i, k, counters, _counter, _observer; | |
containers = getByClass(document, ADS_CLASS); | |
for (i = containers.length - 1; i >= 0; i--) { | |
var counters = getByClass(containers[i], ADS_COUNTER_CLASS, 'span'); | |
_counter = containers[i].getAttribute(COUNTER_ATTR); | |
_observer = containers[i].hasAttribute(OBSERVER_ATTR); | |
countables[i] = { | |
el: containers[i], | |
pixels: [], | |
observer: _observer | |
}; | |
if (_counter) countables[i].pixels.push(_counter); | |
for (k = counters.length - 1; k >= 0; k--) { | |
_counter = counters[k].getAttribute(COUNTER_ATTR); | |
if (_counter && counters[k].parentNode === countables[i].el) countables[i].pixels.push(_counter); | |
} | |
var callback = getByClass(containers[i], ADS_CALLBACK_CLASS, 'span'); | |
if (callback[0]) { | |
var _callback = callback[0].getAttribute(CALLBACK_ATTR); | |
if (_callback && window.RB_CALLBACKS && window.RB_CALLBACKS[_callback]) { | |
countables[i].callback = window.RB_CALLBACKS[_callback]; | |
} | |
} | |
if (!countables[i].pixels.length) countables.splice(i, 1); | |
} | |
return countables; | |
} | |
function getByClass(parent, childClassName, tagName) { | |
if (parent.getElementsByClassName) { | |
return parent.getElementsByClassName(childClassName); | |
} else if (parent.querySelectorAll) { | |
return parent.querySelectorAll('.' + childClassName); | |
} else { | |
var els = []; | |
var tmp = parent.getElementsByTagName(tagName ? tagName : "*"); | |
var regex = new RegExp("(^|\s)" + childClassName + "(\s|$)"); | |
for (var i = 0; i < tmp.length; i++) { | |
if (regex.test(tmp[i].className)) { | |
els.push(tmp[i]); | |
} | |
} | |
return els; | |
} | |
} | |
RB.I(getAdsContainers()); | |
}catch(e){} | |
}('mailru')) | |
</script> | |
</ins> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment