function AdFox_SetLayerVis(e,t){document.getElementById(e).style.visibility=t}function AdFox_Open(e){AdFox_SetLayerVis("AdFox_DivBaseFlash_"+e,"hidden"),AdFox_SetLayerVis("AdFox_DivOverFlash_"+e,"visible")}function AdFox_Close(e){AdFox_SetLayerVis("AdFox_DivOverFlash_"+e,"hidden"),AdFox_SetLayerVis("AdFox_DivBaseFlash_"+e,"visible")}function adfoxSdvigContent(e,t,n){var o=document.getElementById("adfoxBanner"+e).style;o.width="100%"==t?t:t+"px",o.height="100%"==n?n:n+"px"}function adfoxVisibilityFlash(e,t,n){var o=document.getElementById(e).style;o.width="100%"==t?t:t+"px",o.height="100%"==n?n:n+"px"}function adfoxStart(e,t,n,o,i,r,a,d){1==t?adfoxVisibilityFlash("adfoxFlash1"+e,i,r):2==t&&(adfoxVisibilityFlash("adfoxFlash2"+e,a,d),"yes"==n&&adfoxVisibilityFlash("adfoxFlash1"+e,i,r),"yes"==o?adfoxSdvigContent(e,a,d):adfoxSdvigContent(e,i,r))}function adfoxOpen(e,t,n,o,i){var r=new Image,a=document.getElementById("aEventOpen"+e);a&&(r.src=a.title+"&rand="+1e6*Math.random()+"&prb="+1e6*Math.random()),adfoxVisibilityFlash("adfoxFlash2"+e,o,i),"yes"!=t&&adfoxVisibilityFlash("adfoxFlash1"+e,1,1),"yes"==n&&adfoxSdvigContent(e,o,i)}function adfoxClose(e,t,n,o,i){var r=new Image,a=document.getElementById("aEventClose"+e);a&&(r.src=a.title+"&rand="+1e6*Math.random()+"&prb="+1e6*Math.random()),adfoxVisibilityFlash("adfoxFlash2"+e,1,1),"yes"!=t&&adfoxVisibilityFlash("adfoxFlash1"+e,o,i),"yes"==n&&adfoxSdvigContent(e,o,i)}!function(){if("undefined"!=typeof _montblanc)var e=!0;else{var e=!1;console.log("_montblanc doesnt included")}var t={};t.dom={},t.counter=1,t.util={debug:!0,DOC_READY:!1,CRTG_CONTENT:"",getBodyScrollTop:function(e){var t=e||window;return t.pageYOffset||t.document.documentElement&&t.document.documentElement.scrollTop||t.document.body&&t.document.body.scrollTop},getBodyScrollLeft:function(e){var t=e||window;return t.pageXOffset||t.document.documentElement&&t.document.documentElement.scrollLeft||t.document.body&&t.document.body.scrollLeft},getElementPosition:function(e,t){var n=t||document,o=n.getElementById(e),i={};for(i.width=o.offsetWidth,i.height=o.offsetHeight,i.left=0,i.top=0;o;)i.left+=o.offsetLeft,i.top+=o.offsetTop,o=o.offsetParent;return i},createScript:function(e,t,n){var o=n||document,i=o.createElement("script");return i.src=e,i.type="text/javascript",i.async=!!t,i},insertScript:function(e,t){var n=t||document,o=n.getElementsByTagName("script")[0];o.parentNode.insertBefore(e,o)},getProtocol:function(e){var t=e||document;return"https:"==t.location.protocol?"https:":"http:"},getScreenSize:function(){var e="",t="";if(self.screen)t=screen.width,e=screen.height;else if(self.java){var n=java.awt.Toolkit.getDefaultToolkit(),o=n.getScreenSize();t=o.width,e=o.height}return t&&e?[t,e]:["",""]},getWindowSize:function(e){var t,n,o=e||window;return"number"==typeof o.innerWidth?(t=o.innerWidth,n=o.innerHeight):o.document.documentElement&&(o.document.documentElement.clientWidth||o.document.documentElement.clientHeight)?(t=o.document.documentElement.clientWidth,n=o.document.documentElement.clientHeight):o.document.body&&(o.document.body.clientWidth||o.document.body.clientHeight)&&(t=o.document.body.clientWidth,n=o.document.body.clientHeight),{width:t,height:n}},getDate:function(){var e=new Date;return{date:e.getDate(),day:e.getDay(),hour:e.getHours()}},wrapScript:function(e){return'"},createElement:function(e,t,n,o){var i=o||document,r=i.createElement(e);return"string"==typeof t&&r.setAttribute("id",t),"string"==typeof n&&(r.className+=n),r},getFrameWindow:function(e,t){var n=t||window;return e.contentWindow?e.contentWindow:n.frames[e.name]},getFrameDocument:function(e,t){var n=t||window;if(n.safari){var o=e.contentWindow||e.contentDocument;return o.document?o.document:o}return n.document.all&&!n.opera?e.document:e.contentDocument},isIe:function(e){var t=e||window,n=t.navigator.userAgent;return-1!=n.indexOf("MSIE ")},getIeVersion:function(){var e=navigator.userAgent,t=e.indexOf("MSIE ");return parseFloat(e.substring(t+5,e.indexOf(";",t)))},ieSetFrameBody:function(e,n,o){var i,r=t.util.getIeVersion();n.contents=o,i=6e){try{document.all&&!window.opera?a=window.frames[o].document:document.getElementById&&(a=document.getElementById(o).contentDocument)}catch(d){}a?a.write(''):setTimeout(function(){t.util.getCodeScript(++e,n,o)},100)}else 10==e&&window.console.log("Can not access to frameDocument && frameWindow; id = "+o);t.inner.checkBannerLoaded(i,r)},createAdIframe:function(e,t){var n=t||document,o=n.createElement("iframe");return o.setAttribute("id",e),o.setAttribute("marginwidth","0"),o.setAttribute("marginheight","0"),o.setAttribute("scrolling","no"),o.setAttribute("frameBorder","0"),o.setAttribute("width","1"),o.setAttribute("height","1"),o.style.position="absolute",o},getReferrer:function(){if("undefined"!=typeof document.referrer){if("undefined"==typeof e)var e=escape(document.referrer)}else var e="";return e}},t.init={criteo:function(e){function n(e){var t,n,o,i=document.cookie.split(";");for(t=0;tn?d.Begun&&d.Begun.Autocontext&&d.Begun.Autocontext.addBlock?Begun.Autocontext.addBlock(r,function(n,d){i.puid52=n,i.puid53=d,t.banner.show(o,i,a),t.util.debug&&console.log("adCall = "+e+"; bid = "+r["begun-block-id"]+"; div_id = "+o)}):setTimeout(function(){t.inner.show_b(e,++n,o,i,r,a,d)},100):(t.util.debug&&console.log("win.Begun.Autocontext.addBlock is not defined.; div_id = "+o),t.banner.show(o,i,a))},checkBannerLoaded:function(e,t){var n=new Date,o=setInterval(function(){var i=new Date;return i-n>=5e3?(clearInterval(o),"function"==typeof t&&t(e.scrollWidth,e.scrollHeight,!1),!1):e.scrollHeight>50?(clearInterval(o),"function"==typeof t&&t(e.scrollWidth,e.scrollHeight,!0),!0):void 0},100)},getMonblanc:function(t){return e?_montblanc.get(t,""):""}},t.banner={needReload:!1,account_id:171817,pr:Math.floor(1e6*Math.random()),dl:escape(document.location),montblanc:{puid3:t.inner.getMonblanc("4i"),puid4:t.inner.getMonblanc("c6"),puid11:t.inner.getMonblanc("dd"),puid22:t.inner.getMonblanc("y1"),puid33:t.inner.getMonblanc("bj"),puid37:t.inner.getMonblanc("k4"),puid38:t.inner.getMonblanc("x3")},show:function(e,n,o,i){var r=typeof e;if("function"==typeof o&&(i=o),"string"==r)var a=document.getElementById(e);else if("object"==r)var a=e;var d=Math.floor(1e6*Math.random()),c=Math.floor(1e6*Math.random()),l=0,u=t.util.createElement("div","AdFox_banner_"+d,o),s=t.util.createAdIframe("AdFox_iframe_"+d),f=t.banner.needReload?Math.floor(1e6*Math.random()):t.banner.pr,m=t.util.getProtocol()+"//ads.adfox.ru/"+(n.account_id?n.account_id:t.banner.account_id)+"/prepareCode?pfc=a&pfb=a&pt=b&pd="+t.util.getDate().date+"&pw="+t.util.getDate().day+"&pv="+t.util.getDate().hour+"&prr="+t.util.getReferrer()+"&pdw="+t.util.getScreenSize()[0]+"&pdh="+t.util.getScreenSize()[1]+"&dl="+t.banner.dl+"&pr1="+d+"&random="+c+"&pr="+f;for(var g in t.banner.montblanc)m+="&"+g+"="+t.banner.montblanc[g];if("object"==typeof n)for(var g in n)"criteo"==g?(t.util.CRTG_CONTENT&&(l=-1!=t.util.CRTG_CONTENT.indexOf(n[g])?n[g]:"0"),m+="&puid23="+l):m+="&"+g+"="+n[g];else console.log("options ="+typeof n);a?(a.appendChild(u),a.appendChild(s)):console.log("adfox can not access banner_place"),t.util.debug&&console.log("div_id = "+e),t.util.debug&&console.log(n),t.util.getCodeScript(1,m,"AdFox_iframe_"+d,a,i)},reload:function(e,n,o,i){t.banner.needReload=!0,document.getElementById(e).innerHTML="",t.banner.show(e,n,o,i),t.banner.needReload=!1},showScroll:function(e,n,o,i){var r=t.util.getWindowSize(),a=r.width,d=r.height,c=t.util.getBodyScrollTop(),l=t.util.getBodyScrollLeft(),u=t.util.getElementPosition(e),s=u.left,f=u.top;c+d+5>=f&&l+a+5>=s?t.banner.show(e,n,o,i):setTimeout(function(){t.banner.showScroll(e,n,o,i)},100)},showScroll_b:function(e,n,o,i,r){var a=t.util.getWindowSize(),d=a.width,c=a.height,l=t.util.getBodyScrollTop(),u=t.util.getBodyScrollLeft(),s=t.util.getElementPosition(e),f=s.left,m=s.top;l+c+5>=m&&u+d+5>=f?t.banner.show_b(e,n,o,i,r):setTimeout(function(){t.banner.showScroll_b(e,n,o,i,r)},100)},show_b:function(e,n,o,i,r){var a=r||window;t.inner.show_b(t.counter,1,e,n,o,i,a),t.counter=t.counter+1},reload_b:function(e,n,o){t.banner.needReload=!0,document.getElementById(e).innerHTML="",t.banner.show_b(e,n,o),t.banner.needReload=!1}},window.Adf={},window.Adf.util=t.util,window.Adf.init=t.init,window.Adf.banner=t.banner}();