",e+="
"+t.title+"
",e+=""},s=function(){var t=''};return this.each(function(){var n=t(this);a(i.url).done(function(e){o(),n.addClass("bso-boxed");var a=[],r=0;t(e).find("item").each(function(){var n=t(this),e={};return e.title=n.find("title").text(),e.link=n.find("link").text(),e.image=n.find("enclosure").attr("url"),a.push(e),r++,r==i.limit?!1:void 0}),l(n,a)})})},t("[data-bso]").boxOdkazy()}("undefined"==typeof jQuery?void 0:jQuery),function(){var t,n;t=this.jQuery||window.jQuery,n=t(window),t.fn.stick_in_parent=function(e){var i,o,a,l,r,s,c,d,u,p,m,f,h;for(null==e&&(e={}),f=e.sticky_class,s=e.inner_scrolling,m=e.recalc_every,p=e.parent,u=e.offset_top,d=e.spacer,a=e.bottoming,null==u&&(u=0),null==p&&(p=void 0),null==s&&(s=!0),null==f&&(f="is_stuck"),i=t(document),null==a&&(a=!0),l=function(e,o,l,r,c,g,w,v){var y,k,b,x,_,z,A,M,N,T,D,j;if(!e.data("sticky_kit")){if(e.data("sticky_kit",!0),_=i.height(),A=e.parent(),null!=p&&(A=A.closest(p)),!A.length)throw"failed to find stick parent";if(b=!1,y=!1,D=null!=d?d&&e.closest(d):t(""),D&&D.css("position",e.css("position")),M=function(){var t,n,a;return v?void 0:(_=i.height(),t=parseInt(A.css("border-top-width"),10),n=parseInt(A.css("padding-top"),10),o=parseInt(A.css("padding-bottom"),10),l=A.offset().top+t+n,r=A.height(),b&&(b=!1,y=!1,null==d&&(e.insertAfter(D),D.detach()),e.css({position:"",top:"",width:"",bottom:""}).removeClass(f),a=!0),c=e.offset().top-(parseInt(e.css("margin-top"),10)||0)-u,h=e.offset().left,g=e.outerHeight(!0),w=e.css("float"),D&&D.css({width:e.outerWidth(!0),height:g,display:e.css("display"),"vertical-align":e.css("vertical-align"),"float":w}),a?j():void 0)},M(),g!==r)return x=void 0,z=u,T=m,j=function(){var t,p,k,N,j,E;return v?void 0:(k=!1,null!=T&&(T-=1,0>=T&&(T=m,M(),k=!0)),k||i.height()===_||(M(),k=!0),N=n.scrollTop(),null!=x&&(p=N-x),x=N,b?(a&&(j=N+g+z>r+l,y&&!j&&(y=!1,e.css({position:"fixed",bottom:"",top:z,left:h}).trigger("sticky_kit:unbottom"))),c>N&&(b=!1,z=u,null==d&&(("left"===w||"right"===w)&&e.insertAfter(D),D.detach()),t={position:"",width:"",left:"",top:""},e.css(t).removeClass(f).trigger("sticky_kit:unstick")),s&&(E=n.height(),g+u>E&&(y||(z-=p,z=Math.max(E-g,z),z=Math.min(u,z),b&&e.css({top:z+"px"}))))):N>c&&(b=!0,t={position:"fixed",top:z,left:h},t.width="border-box"===e.css("box-sizing")?e.outerWidth()+"px":e.width()+"px",e.css(t).addClass(f),null==d&&(e.after(D),("left"===w||"right"===w)&&D.append(e)),e.trigger("sticky_kit:stick")),b&&a&&(null==j&&(j=N+g+z>r+l),!y&&j)?(y=!0,"static"===A.css("position")&&A.css({position:"relative"}),e.css({position:"absolute",bottom:o,top:"auto"}).trigger("sticky_kit:bottom")):void 0)},N=function(){return M(),j()},k=function(){return v=!0,n.off("touchmove",j),n.off("scroll",j),n.off("resize",N),t(document.body).off("sticky_kit:recalc",N),e.off("sticky_kit:detach",k),e.removeData("sticky_kit"),e.css({position:"",bottom:"",top:"",width:""}),A.position("position",""),b?(null==d&&(("left"===w||"right"===w)&&e.insertAfter(D),D.remove()),e.removeClass(f)):void 0},n.on("touchmove",j),n.on("scroll",j),n.on("resize",N),t(document.body).on("sticky_kit:recalc",N),e.on("sticky_kit:detach",k),setTimeout(j,0)}},r=0,c=this.length;c>r;r++)o=this[r],l(t(o));return this}}.call(this);var stateResults={AL:{name:"Alabama",win:"trump"},AK:{name:"Alaska",win:"trump"},AZ:{name:"Arizona",win:"trump"},AR:{name:"Arkansas",win:"trump"},CA:{name:"California",win:"clinton"},CO:{name:"Colorado",win:"clinton"},CT:{name:"Connecticut",win:"clinton"},DE:{name:"Delaware",win:"clinton"},DC:{name:"Washington DC",win:"clinton"},FL:{name:"Florida",win:"trump"},GA:{name:"Georgia",win:"trump"},HI:{name:"Hawaii",win:"clinton"},ID:{name:"Idaho",win:"trump"},IL:{name:"Illinois",win:"clinton"},IN:{name:"Indiana",win:"trump"},IA:{name:"Iowa",win:"trump"},KS:{name:"Kansas",win:"trump"},KY:{name:"Kentucky",win:"trump"},LA:{name:"Louisiana",win:"trump"},ME:{name:"Maine",win:"clinton"},MD:{name:"Maryland",win:"clinton"},MA:{name:"Massachusetts",win:"clinton"},MI:{name:"Michigan",win:"trump"},MN:{name:"Minnesota",win:"clinton"},MS:{name:"Mississippi",win:"trump"},MO:{name:"Missouri",win:"trump"},MT:{name:"Montana",win:"trump"},NE:{name:"Nebraska",win:"trump"},NV:{name:"Nevada",win:"clinton"},NH:{name:"New Hampshire",win:"clinton"},NJ:{name:"New Jersey",win:"clinton"},NM:{name:"New Mexico",win:"clinton"},NY:{name:"New York",win:"clinton"},NC:{name:"North Carolina",win:"trump"},ND:{name:"North Dakota",win:"trump"},OH:{name:"Ohio",win:"trump"},OK:{name:"Oklahoma",win:"trump"},OR:{name:"Oregon",win:"clinton"},PA:{name:"Pennsylvania",win:"trump"},RI:{name:"Rhode Island",win:"clinton"},SC:{name:"South Carolina",win:"trump"},SD:{name:"South Dakota",win:"trump"},TN:{name:"Tennessee",win:"trump"},TX:{name:"Texas",win:"trump"},UT:{name:"Utah",win:"trump"},VT:{name:"Vermont",win:"clinton"},VA:{name:"Virginia",win:"clinton"},WA:{name:"Washington",win:"clinton"},WV:{name:"West Virginia",win:"trump"},WI:{name:"Wisconsin",win:"trump"},WY:{name:"Wyoming",win:"trump"}},colors={clinton:"#4393c3",trump:"#d6604d",na:"#bababa"},winnerStatement={trump:'Zvítězil zde republikán Donald Trump.',clinton:'Zvítězila zde demokratka Hillary Clinton.',na:"Výsledky v tomto státě zatím nejsou známé."},width=document.documentElement.clientWidth;width>1e3&&(width=1e3);var height=500*(width/1e3),svg=d3.select("#mapa").append("svg").attr("width",width).attr("height",height),infoBox=d3.select("#mapa").append("div").attr("id","infobox").html("Najetím myši vyberte stát USA.").style("left",width/3*2+"px").style("bottom",height-20+"px");d3.json("./media/cartogram.json",function(t,n){var e=topojson.feature(n,n.objects.tiles),i=d3.geoTransform({point:function(t,n){this.stream.point(t,-n)}}),o=d3.geoPath().projection(i),a=svg.append("g").attr("transform","translate(0,"+(height-.1*height)+") scale("+width/2350+")");a.selectAll(".tiles").data(e.features).enter().append("path").style("fill",function(t,n){return colors[stateResults[t.properties.state].win]}).attr("d",o);var l=[];n.objects.tiles.geometries.forEach(function(t){-1===l.indexOf(t.properties.state)&&l.push(t.properties.state)});var r=l.map(function(t){return topojson.merge(n,n.objects.tiles.geometries.filter(function(n){return n.properties.state===t}))});a.selectAll("path.border").data(r).enter().append("path").attr("d",o).attr("class","border").attr("fill","none").attr("stroke","#e0e0e0").attr("stroke-width",1),a.selectAll("path").on("mouseover",function(t){void 0!=t.properties&&infoBox.html(''+stateResults[t.properties.state].name+" (volitelů: "+t.properties.tilegramValue+')
'+winnerStatement[stateResults[t.properties.state].win]+" ")})}),function(){function t(t){return console.log("click"),t.preventDefault(),window.open(this.getAttribute("href"))}function n(t){return t.preventDefault(),window.open(this.getAttribute("href"),"","width=550,height=265")}var e,i,o,a,l,r,s,c,d;for(document.querySelector("a#scroll-btn").addEventListener("click",function(t){var n,e,i,o,a,l,r;return t.preventDefault(),n=document.querySelector("#content"),e=window.pageYOffset||document.documentElement.scrollTop,i=ig.utils.offset(n).top,o=i-e,a=Date.now(),l=600,r=function(){var t,n,i;return t=Date.now()-a,n=t/l,n>1&&(n=1),i=e+o*Math.sin(n*(Math.PI/2)),window.scrollTo(0,i),1>n?window.requestAnimationFrame(r):void 0},window.requestAnimationFrame(r)}),e=0,o=(i=document.querySelectorAll("a[href^='http:'],a[href^='https:']")).length;o>e;++e)a=i[e],"logo"!==a.id&&(null!=(l=a.classList)&&l.contains("share")||a.addEventListener("click",t));for(e=0,o=(i=document.querySelectorAll("a.share")).length;o>e;++e)a=i[e],a.addEventListener("click",n);r=!0,s=document.querySelector("body > header"),c=null!=(i=document.querySelector("#opener").classList)?i.contains("no-cover-img"):void 0,d=function(){var t,n,e,i;return t=document.body.scrollTop||document.documentElement.scrollTop,n=c?1:window.innerHeight,t>=n&&r?(null!=(e=s.classList)&&e.remove("at-top"),r=!1):n>t&&!r?(null!=(i=s.classList)&&i.add("at-top"),r=!0):void 0},window.addEventListener("scroll",d),d()}.call(this),function(){}.call(this);