var __tnt=window.__tnt||{};(function(u,c,s,m,g){var o=m.ads||(m.ads={}),n={};o.curl=function(t){var e='
',i='',l="";if(t.clickuri){var r=t.clickuri.replace(/"/g,""");l='"}else l='";n.paint(t,l)},o.expandable=function(t){var e='',i='',l=e+i;n.paint(t,l).then(n.setWrapper(t)).then(n.setLink(t)).then(n.setTrigger(t)).then()},o.html=function(t){t.width||(t.width=s(t.positionDiv).closest(".tncms-region-ads").prev().data("tnt-ads-tmp").width),n.paint(t,t.html)},o.image=function(t){var e="",i="";if(typeof t.clickuri<"u"&&(e=t.clickuri.replace(/"/g,""")),t.display=="wallpaper"){var l=t.height,r=c.getElementsByTagName("body")[0];r.style.backgroundImage="url("+t.asseturl+")",r.style.height=l+"px",r.className+=" wallpaper-ad ",t.clickuri&&(i+='')}else if(t.display=="anchor"){var a="fas tnt-times";i=t.clickuri===""?'':''}else i=t.clickuri===""?'':'';n.paint(t,i)},o.text=function(t){var e=n.overline(t),i="";if(t.width||(t.width=s(t.positionDiv).closest(".tncms-region-ads").prev().data("tnt-ads-tmp").width),(typeof e>"u"||e===null)&&(e="Advertisement"),t.clickuri){var l=t.clickuri.replace(/"/g,""");i=''+t.title+""+t.text+'
'+e+" "}else i=''+t.title+"
"+t.text+'
'+e+"
";n.paint(t,i)},o.popup=function(t){var e=c.createElement("div"),i="";if(e.setAttribute("id","BlackOutDiv"),e.style.position="fixed",e.style.top=0,e.style.left=0,e.style.width="100%",e.style.height="100%",e.style.zIndex=10000001,e.style.backgroundColor="black",e.style.opacity=.9,e.style.filter="alpha(opacity=90)",i+='',t.type=="video"){var l="video/mp4";t.asseturl.match(/\.flv\?/)!=null&&(l="video/x-flv"),t.clickuri&&(i+=''),i+=''}else if(t.type=="text"){var r=n.overline(t);if((typeof r>"u"||r===null)&&(r="Advertisement"),t.clickuri){var a=t.clickuri.replace(/"/g,""");i+=''+t.title+""+t.text+'
'+r+" "}else i+=''+t.title+"
"+t.text+'
'+r+"
"}else if(t.type=="image"){var p="";typeof t.clickuri<"u"&&(p="http://"+t.clickuri.replace(/"/g,""")),i+=t.clickuri===""?'':''}else if(t.type=="html")i+='',i+=t.html,i+="
";else if(t.type=="html5"){var h="//"+t.cdn+"/content/tncms/ads/__html5/"+t.uuid+"/"+t.html5_id+"/"+t.htmlfile;t.clickuri&&(h+="?clickTag="+encodeURIComponent(t.clickuri)),i+='',i+='",i+="
"}i+="";function v(){s("#blox-ad-position-_popup1").remove(),s("#BlackOutDiv").remove()}typeof e.addEventListener<"u"?e.addEventListener("click",v,!1):(c.compatMode=="BackCompat"&&(e.style.width="110%",e.style.height="110%",e.style.position="absolute"),e.attachEvent("onclick",v)),c.getElementsByTagName("body")[0].appendChild(e),TNCMS.AdManager.renderAd(t),n.paint(t,i)},n={getAnimationSpeed:function(t){switch(t){case"slow":return 1e3;case"medium":return 500;case"fast":return 250;case"instant":return 0;default:return 500}},overline:function(t){var e;return s(t.positionDiv).closest(".tncms-region-ads").prev().attr("data-tnt-ads-tmp")?e=s(t.positionDiv).closest(".tncms-region-ads").prev().data("tnt-ads-tmp").overline:s(t.positionDiv).attr("data-tnt-ads")&&(e=s(t.positionDiv).data("tnt-ads").overline),e},paint:function(t,e){var i=new s.Deferred,l=["tnt-ads","tnt-"+t.type+"-ad-wrapper"],r="";if(t.display=="anchor"?l.push("tnt-ads-anchor","alert"):t.display=="popup"&&l.push("tnt-ads-popup"),r=l.join(" "),t.display=="wallpaper")s("#wallpaper-left").empty().append(e),s("#wallpaper-right").empty().append(e);else if(t.display=="popup")s(t.positionDiv).empty().removeAttr("style").removeClass().addClass(r).css({"max-width":t.width+"px","max-height":t.height+"px"}).append(e);else if(s(t.positionDiv).empty().removeAttr("style").removeClass().addClass(r).css({"max-width":t.width+"px"}).append(e),s(u).width()==320&&t.width<=320&&t.width>s(t.positionDiv).width()){var a=Math.round((s(t.positionDiv).width()-t.width)/2);s(t.positionDiv).css({margin:"0 "+a+"px"})}if(t.type!="text"){var p=n.overline(t);if(p&&s(t.positionDiv).siblings(".tnt-ads-overline").length<1){var h=''+p+"
";s(t.positionDiv).before(h)}}return i.resolve(t),i.promise()},setAnimation:function(t,e){var i=new s.Deferred,l=s(t.positionDiv).find(".tnt-expandable-big"),r=e===0?e:n.getAnimationSpeed(t.transition_speed);switch(t.overlay_content){case"0":l.addClass("noOverlay");break;case"1":l.addClass("overlay");break}switch(t.transition_direction){case"left":l.css({position:"absolute",top:0,"z-index":999,right:t.width}).stop().animate({width:"toggle"},r);break;case"right":l.css({position:"absolute",top:0,left:t.width,"z-index":999}).stop().animate({width:"toggle"},r);break;case"up":l.css({position:"absolute",bottom:t.height,left:0,"z-index":999}).stop().slideToggle(r);break;default:l.css({left:0,"z-index":999}).stop().slideToggle(r);break}return i.resolve(t),i.promise()},setLink:function(t){var e=new s.Deferred;return t.clickuri&&(s(t.positionDiv).find(".tnt-expandable-big img").wrap(''),t.start_open!=0&&s(t.positionDiv).find(".tnt-expandable-small img").wrap('')),e.resolve(t),e.promise()},setTitle:function(t,e,i){return t.toString()+"x"+e.toString()+" "+i+" ad"},setTrigger:function(t){var e=new s.Deferred;switch(t.start_open){case"1":n.setAnimation(t,0),t.auto_limit!=="0"?setTimeout(function(){n.setAnimation(t)},t.auto_limit*1e3):s(t.positionDiv).find(".tnt-expandable-small").on("click",function(){n.setAnimation(t)});break;case"2":s(t.positionDiv).on("mouseover mouseout",function(){n.setAnimation(t)});break;case"3":n.setAnimation(t,0),s(t.positionDiv).find(".tnt-expandable-small").addClass("click-to-close"),t.auto_limit!=="0"?(setTimeout(function(){n.setAnimation(t)},t.auto_limit*1e3),setTimeout(function(){s(t.positionDiv).on("mouseover mouseout",function(){n.setAnimation(t)})},t.auto_limit*1e3+500)):s(t.positionDiv).find(".tnt-expandable-small").hasClass("click-to-close")&&s(t.positionDiv).find(".tnt-expandable-small").on("click hover",function(){n.setAnimation(t)});break;default:s(t.positionDiv).find(".tnt-expandable-small").on("click",function(){n.setAnimation(t)});break}return e.resolve(t),e.promise()},setWrapper:function(t){var e=new s.Deferred;return s(t.positionDiv).css("position","relative"),e.resolve(t),e.promise()}}})(window,document,jQuery,__tnt);
//# sourceMappingURL=tnt.ads.init.c2b9574823d0d16ffc6f20eef83f4232.js.map