/* 320x50 (4) */
 
/* Переменная 'info' необходима для указания юридической информации о компании */
 
var info = "<strong>[[ORD_LEGAL_NAME]]<br>ИНН: [[ORD_CLIENT_INN]]</strong>";
 
var trimLength = 38;
 
/* Ниже этой строчки код редактировать не рекомендуется */
 
var linkFont=document.createElement("LINK");linkFont.rel="stylesheet",linkFont.href="https://fonts.googleapis.com/css2?family=PT+Sans&display=swap",document.getElementById(elementId).appendChild(linkFont);var custom_script=document.createElement("SCRIPT");custom_script.onload=function(){$(document).ready((function(){function enlarge(item){var that=$(item);$(that).addClass("item--upper"),$(that).addClass("item--fullsize")}function squeeze(item){var that=$(item);$(that).removeClass("item--fullsize"),setTimeout((function(){$(that).removeClass("item--upper")}),500)}if("ontouchstart"in document.documentElement)$(".item").click((function(){if($(this).hasClass("item--fullsize"))squeeze(this);else enlarge(this)}));else $(".item").on("mouseenter",(function(){var that=$(this),timer=setTimeout((function(){enlarge(that)}),600);$(that).on("mouseleave",(function(){if(clearTimeout(timer),$(that).hasClass("item--fullsize"))squeeze(that)}))}))}))},custom_script.type="text/javascript",custom_script.src="https://cdn.adhigh.net/jquery-3.6.0.min.js",custom_script.defer="defer",document.getElementById(elementId).appendChild(custom_script);var desiredGoodsCount=4,actualGoodsCount=products.length<desiredGoodsCount?products.length:desiredGoodsCount,creative=function(){var container=document.createElement("div");return container.innerHTML='<div class="wrapper"><a class="logo" href="' + urlWithRedirect + '" target="_blank"><img src="https://[[SITE_LOGO]]"></a><div class="content">'+goods(0,actualGoodsCount)+'</div><div class="footer"><a class="footer__logo" href="https://getintent.com/" target="_blank"><span>Реклама</span><img class="pic" src="https://cdn.adhigh.net/banners/dynamic-template/logo-getintent.svg"></a><div class="footer__about"><span>Рекламодатель</span></div><div class="footer__disclaimer">'+info+"</div></div></div>",container.firstChild};function goods(i,count){for(var goods="",c=0;c<count;c++){var itemName="no name model g:title";if(products[i+c].hasOwnProperty("name"))if(products[i+c].name)itemName=products[i+c].name;if(products[i+c].hasOwnProperty("model"))if(products[i+c].model)itemName=products[i+c].model;if(products[i+c].hasOwnProperty("g:title"))if(products[i+c]["g:title"])itemName=products[i+c]["g:title"];if(itemName.length>=trimLength)itemName.substring(0,trimLength).trim()+"...";goods+='<a class="item" href="'+products[i+c].url+'" target="_blank"><div class="top"><img src="'+products[i+c].picture+'"/></div></a>'}return goods}document.getElementById(elementId).appendChild(creative());


/* Переменные для настройки внешнего вида креатива */
 
:root {
  --itemTextSize: 8px;
  --buttonTextSize: 15px;
}
 
/* Ниже этой строчки код редактировать не рекомендуется */
 
:root{--itemForegroundColor:#ebebeb;--itemBackgroundColor:#373737;--itemAccentColor:#56ccf2;--itemTextColor:#ebebeb;--buttonTextColor:#fff;--footerDuration:0.2s}*,:after,:before{box-sizing:border-box}body,html{margin:0;padding:0}.wrapper{text-wrap:balance;border:1px solid var(--itemBackgroundColor);font-family:PT Sans,Arial,sans-serif;height:100%;left:50%;overflow:hidden;top:50%;transform:translate(-50%,-50%);width:100%;z-index:0}.logo,.wrapper{background-color:#fff;position:absolute}.logo{font-size:0;height:32px;right:4px;top:4px;transition:width .5s ease;width:56px;z-index:1}.logo img{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.content{align-items:center;display:flex;height:32px;justify-content:space-between;left:4px;position:absolute;top:4px;width:calc(100% - 70px)}@keyframes pic{0%{transform:translateY(-50%)}25%{transform:translateY(-75%)}75%{transform:translateY(-25%)}to{transform:translateY(-50%)}}.item{display:flex;flex-direction:column;height:32px;justify-content:space-between;position:absolute;text-decoration:none;transition:all .5s ease;width:56px}.item:focus .top,.item:hover .top{border-color:var(--itemBackgroundColor)}.item:focus .top:before,.item:hover .top:before{max-width:52px;opacity:1;width:calc(100% - 8px)}.item.item--upper{z-index:1}.item.item--fullsize{height:100%;left:0!important;width:100%}.item.item--fullsize .top{border-color:#fff}.item.item--fullsize .top img{animation-duration:5s;animation-iteration-count:infinite;animation-name:pic;animation-timing-function:linear;height:auto;position:absolute;top:50%;transform:translateY(-50%);width:100%}.item.item--fullsize .top:before{opacity:0;z-index:0}.item:first-child{left:0;top:0}.item:nth-child(2){left:64px;top:0}.item:nth-child(3){left:128px;top:0}.item:nth-child(4){left:192px;top:0}.top{background-color:#fff;border:1px solid var(--itemForegroundColor);border-radius:5px;height:100%;overflow:hidden;position:relative;transition:height .5s ease,border .5s ease}.top:before{background-color:var(--itemAccentColor);border-radius:4px;content:" ";height:4px;left:4px;opacity:0;position:absolute;top:4px;transition:all .6s ease;width:4px;z-index:1}.top img{height:32px;-o-object-fit:contain;object-fit:contain;top:50%;transform:translateY(-50%);transition:all .5s ease;width:56px}.footer,.top img{position:absolute}.footer{align-items:flex-end;bottom:0;color:var(--itemTextColor);display:flex;font-size:9px;justify-content:space-between;left:0;line-height:16px;text-align:center;width:100%;z-index:3}.footer.footer--shorten:before{width:calc(100% - 185px)}.footer:before{bottom:0;content:" ";height:10px;left:0;position:absolute;transition:width var(--footerDuration) ease;width:100%;z-index:-1}.footer:before,.footer__logo{background-color:var(--itemBackgroundColor)}.footer__logo{border-top-right-radius:8px;color:inherit;height:16px;line-height:16px;overflow:hidden;padding:0 6px;position:relative;text-decoration:none;transition:width var(--footerDuration) ease,height var(--footerDuration) ease;width:50px}.footer__logo:focus,.footer__logo:hover{height:28px;width:110px}.footer__logo:focus span,.footer__logo:hover span{line-height:28px;opacity:0}.footer__logo:focus .pic,.footer__logo:hover .pic{opacity:1}.footer__logo span{line-height:16px;transition:all var(--footerDuration) ease}.footer__logo .pic{left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);transition:opacity var(--footerDuration) ease;width:66%}.footer__about{background-color:var(--itemBackgroundColor);border-top-left-radius:8px;height:16px;line-height:16px;padding:0 6px;text-align:center;width:80px}.footer__about:focus,.footer__about:hover{opacity:0}.footer__about:focus+.footer__disclaimer,.footer__about:hover+.footer__disclaimer{opacity:1;transform:translate(0,0)}.footer__disclaimer{bottom:0;color:transparent;font-size:7px;line-height:10px;opacity:0;padding:6px;position:absolute;right:0;transform:translate(calc(100% - 80px),calc(100% - 16px));transition:all var(--footerDuration) ease,opacity .1s ease;width:185px;z-index:1}.footer__disclaimer:before{background-color:var(--itemBackgroundColor);border-top-left-radius:8px;content:" ";height:100%;left:0;opacity:.85;position:absolute;top:0;width:100%;z-index:-1}.footer__disclaimer:focus,.footer__disclaimer:hover{color:var(--itemTextColor);opacity:1;transform:translate(0,0)}.footer__disclaimer strong{font-size:9px;font-weight:400}.footer__disclaimer a{-webkit-font-smoothing:antialiased;color:#56ccf2}