var ATMO=(function(){var a={};a.borderizeVoices=function(c){var f=$("#voices-grid"),b,e,g,d;if(c){if("string"===typeof c){$("#voice-box-"+c).remove()}else{if($.isArray(c)){for(d=0;d<c.length;d+=1){$("#voice-box-"+c[d]).remove()}}}}b=f.children("div");e=b.length%2;b.each(function(h){g=$(b.get(h));if(!(h%2)){g.addClass("border")}if(e){if(b.length-h<=1){g.addClass("last")}}else{if(b.length-h<=2){g.addClass("last")}}})};return a}());ATMO.ads=(function(){var b={},a=function(c){var e,d="";for(e in c){if(c.hasOwnProperty(e)&&c[e]){d+=e+"="+c[e]+";"}}return d};b.createFactory=function(c,h,g){var d=Math.round(Math.random()*10000000000000000),e=0,f=c||"dctestsite",l=h||"dctestzone",k=g||"",i=function(n,m){return(n||f)+"/"+(m||l)},j={};if("string"!==typeof k){k=a(k)}j.displayAtlanticAd=function(m,o,q,p){var n="http://ad.doubleclick.net/adj/"+i(q,p)+";";e+=1;n+="pos="+m+";";n+="tile="+e+";";if("topleader"===m){n+="dcopt=ist;"}n+=k+"sz="+o+";ord="+d+";exclude=";document.write('<script src="'+n+'" type="text/javascript"><\/script>');};return j};return b}());ATMO.nav=(function(){var e={},a,c=[{title:"Magazine",link:"http://www.theatlantic.com/doc/current",offImg:"http://static.theatlantic.com/images/nav/magazine_off.png",onImg:"http://static.theatlantic.com/images/nav/magazine_on.png",submenu:[{title:"Current Issue",link:"http://www.theatlantic.com/doc/current"},{title:"Back Issues",link:"http://www.theatlantic.com/magazine/backissues.mhtml"},{title:"Fiction Issue",link:"http://www.theatlantic.com/doc/200808"},{title:"Flashbacks",link:"http://www.theatlantic.com/doc/index/flashbacks"},{title:"Premium Archive",link:"http://pqasb.pqarchiver.com/theatlantic/advancedsearch.html"},{title:"Newsletters",link:"http://www.theatlantic.com/a/newsletters.mhtml"},{title:"Subscribe",link:"https://secure.palmcoastd.com/pcd/eSv?iMagId=23301&i4Ky="},{title:"Renew",link:"https://secure.palmcoastd.com/pcd/eServ?iServ=MjMzMDE1ODgzNQ=="}]},{title:"Channels",offImg:"http://static.theatlantic.com/images/nav/channels_off.png",onImg:"http://static.theatlantic.com/images/nav/channels_on.png",submenu:[{title:"Business",link:"http://business.theatlantic.com/"},{title:"Politics",link:"http://politics.theatlantic.com/"},{title:"Food",link:"http://food.theatlantic.com/"}]},{title:"Voices",link:"http://www.theatlantic.com/bloggers.mhtml",offImg:"http://static.theatlantic.com/images/nav/voices_off.png",onImg:"http://static.theatlantic.com/images/nav/voices_on.png",submenu:[{title:"Sullivan",link:"http://andrewsullivan.theatlantic.com/the_daily_dish/"},{title:"McArdle",link:"http://meganmcardle.theatlantic.com/"},{title:"Ambinder",link:"http://marcambinder.theatlantic.com/"},{title:"Coates",link:"http://ta-nehisicoates.theatlantic.com/"},{title:"Fallows",link:"http://jamesfallows.theatlantic.com/"},{title:"Goldberg",link:"http://jeffreygoldberg.theatlantic.com/"},{title:"Crook",link:"http://clivecrook.theatlantic.com/"}]},{title:"Correspondents",link:"http://correspondents.theatlantic.com/",offImg:"http://static.theatlantic.com/images/nav/correspondents_off.png",onImg:"http://static.theatlantic.com/images/nav/correspondents_on.png"},{title:"Dispatches",link:"http://www.theatlantic.com/doc/index/dispatch",offImg:"http://static.theatlantic.com/images/nav/dispatches_off.png",onImg:"http://static.theatlantic.com/images/nav/dispatches_on.png"},{title:"Video",link:"http://podcasts.theatlantic.com/",offImg:"http://static.theatlantic.com/images/nav/video_off.png",onImg:"http://static.theatlantic.com/images/nav/video_on.png",submenu:[{title:"Slideshows",link:"http://podcasts.theatlantic.com/slideshow/"},{title:"Videos",link:"http://podcasts.theatlantic.com/video/"},{title:"Audio",link:"http://podcasts.theatlantic.com/audio/"}]},{title:"Subscribe",link:"https://secure.palmcoastd.com/pcd/eSv?iMagId=23301&i4Ky=",offImg:"http://static.theatlantic.com/images/nav/subscribe_off.png",onImg:"http://static.theatlantic.com/images/nav/subscribe_on.png",submenu:[{title:"Subscribe",link:"https://secure.palmcoastd.com/pcd/eSv?iMagId=23301&i4Ky="},{title:"Renew",link:"https://secure.palmcoastd.com/pcd/eServ?iServ=MjMzMDE1ODgzNQ=="},{title:"Subscribe Help",link:"https://secure.palmcoastd.com/pcd/eServ?iServ=MjMzMDE1ODgzNQ=="}]}],b=function(f){var g,i,j=c[f].submenu,h=$("#submenu");h.empty();for(i=0;i<j.length;i+=1){if(j[i].link){if(j[i].title.match(/subscribe$/i)){j[i].link+=e.subscribeSection}g=$("<a></a>").attr({id:"smitem"+i,href:j[i].link}).text(j[i].title)}else{g=$("<span></span>").attr("id","smitem"+i).text(j[i].title)}g.wrap('<li id="subMenuItem'+i+'"></li>');h.append(g)}},d=function(g){var f=parseInt($(g.target).attr("id").charAt(5),10);if(a>-1){$("#mmImg"+a).attr("src",c[a].offImg)}if(c[f].onImg){$("#mmImg"+f).attr("src",c[f].onImg)}if(c[f].submenu){b(f)}else{$("#submenu").html("<li>&nbsp;</li>")}a=f};e.build=function(g){var f,k,h=$('<div id="menu"></div>'),j=$('<ul id="mainmenu"></ul>'),i=$('<ul id="submenu"></ul>');e.subscribeSection=g||"IA1D";for(f=0;f<c.length;f+=1){if(c[f].title.match(/subscribe/i)){c[f].link+=e.subscribeSection}if(c[f].link){k=$('<a href="'+c[f].link+'"></a>')}else{k=$("<span></span>")}k.attr("id","mmItem"+f);k.bind("mouseover",d);k.append($("<img />").attr({id:"mmImg"+f,src:c[f].offImg,alt:c[f].title}));j.append($("<li></li>").attr({id:"mainMenuItem"+f,className:"mitem menu-item menu-item-"+c[f].title.toLowerCase()}).append(k))}h.append(j);h.append(i.html($("<li>&nbsp;</li>")));h.insertAfter("#header")};e.setMenuTree=function(f){delete c;c=f;$("#menu").remove();e.build()};e.getMenuTree=function(){return c};return e}());ATMO.slideshow=(function(){var a={},b=navigator.userAgent,c=!!(b.match(/mobile/i)&&b.match(/safari/i));a.init=function(e,g){var k,j,m=[],i={},f=[],d=function(n){return $("<p>"+n+"</p>")},l=function(n){$(".ss-serif","#"+i.slideshowID).show().eq(n).hide().end().eq(n-1).hide()},h=function(t){if(k!==t){var v=$(t).parent().find(".slideshow-story").index(t),w=$(t).find("a").attr("href"),u=m[v].image,n=d(g[v].attrib),q=$("#"+i.slideshowID).find(".slideshow-images"),o=q.children("div").get(0),r=$("<a></a>"),p;r.attr("href",w);r.append(u);p=$("<div></div>").addClass("slideshow-image");p.append(r);p.append(n);if(o){q.children(".slideshow-image").replaceWith(p)}else{q.append(p)}$(k).removeClass("selected");$(t).addClass("selected");if(!c){$(t).wrap('<a href="'+w+'"></a>');$(k).parent().replaceWith($(k))}else{$(t).bind("mousemove",function(){document.location=f[v]});$(k).unbind("mousemove")}k=t;l(v)}};i.slideshowID=e;i.setImages=function(n){var o,q,p=[];for(q=0;q<n.length;q+=1){o=$("<img />").attr({src:n[q].src,width:"352",height:"248"});p.push({image:o,attrib:n[q].attrib})}m=p};i.setImages(g);$(".slideshow-story","#"+e).each(function(n){var o=this;$(o).hover(function(){j=setTimeout(function(){h(o)},20)},function(){clearTimeout(j)})});if(c){$("#"+e).find(".story-headline").each(function(n){f[n]=$(this).children("a").attr("href");$(this).html($(this).children("a").html())})}h($(".slideshow-story","#"+e).get(0));return i};return a}());$(document).ready(function(){$("#mainmenu img").click(function(){s.tl(this,"o","Nav - "+$(this).attr("alt"))});$("#submenu a").click(function(){s.tl(this,"o","Subnav - "+$(this).html())});$("#slideshow .heading:eq(1)").click(function(){s.tl(this,"o","Slideshow 1")});$("#slideshow .heading:eq(2)").click(function(){s.tl(this,"o","Slideshow 2")});$("#slideshow .heading:eq(3)").click(function(){s.tl(this,"o","Slideshow 3")});$("#cross-promote a").click(function(){s.tl(this,"o","Feedbox")});$("#channels #politics a").click(function(){s.tl(this,"o","Feedbox - Politics")});$("#channels #business a").click(function(){s.tl(this,"o","Feedbox - Business")});$("#channels #food a").click(function(){s.tl(this,"o","Feedbox - Food")});$("#channels #magazine a").click(function(){s.tl(this,"o","Feedbox - Magazine")});$("#subform form").submit(function(){s.tl(this,"o","Circulation Form Submission")});$("#subform form").focus(function(){s.tl(this,"o","Circulation Form Focused")});$("#mostread_content1 a").click(function(){s.tl(this,"o","Most Box 1")});$("#mostread_content2 a").click(function(){s.tl(this,"o","Most Box 2")});$("#mostread_content3 a").click(function(){s.tl(this,"o","Most Box 3")});$("#magazinebox a").click(function(){s.tl(this,"o","Current Issue")});$("#newsletters form").submit(function(){s.tl(this,"o","Newsletter Enrollment")});$("#AtlanticWireMini a").click(function(){s.tl(this,"o","Special Reports Module")});$("#more_from_the_atlantic a").click(function(){s.tl(this,"o","More From the Atlantic")});$("#voice-box-andrew-sullivan a").click(function(){s.tl(this,"o","Voices - Andrew Sullivan")});$("#voice-box-megan-mcardle a").click(function(){s.tl(this,"o","Voices - Megan McArdle")});$("#voice-box-marc-ambinder a").click(function(){s.tl(this,"o","Voices - Marc Ambinder")});$("#voice-box-ta-nehisi-coates a").click(function(){s.tl(this,"o","Voices - Ta Nahisi")});$("#voice-box-james-fallows a").click(function(){s.tl(this,"o","Voices - James Fallows")});$("#voice-box-jeffrey-goldberg a").click(function(){s.tl(this,"o","Voices - Jeffrey Goldberg")});$("#voice-box-clive-crook a").click(function(){s.tl(this,"o","Voices - Clive Crook")});$("#rp ul:first a").click(function(){s.tl(this,"o","Recent Posts - Ambinder")});$("#rp ul:eq(2) a").click(function(){s.tl(this,"o","Recent Posts - Good")});$("#search form").submit(function(){s.tl(this,"o","Search Box")});$("#circ_ad a").click(function(){s.tl(this,"o","Circ Ad")});$("#circ_ad_2 a").click(function(){s.tl(this,"o","Circ Ad 2")});$("#archives a").click(function(){s.tl(this,"o","Archives")});$("#blog_roll a").click(function(){s.tl(this,"o","Blog Roll")});$("#whatreading a").click(function(){s.tl(this,"o","What Were Reading")});$(".content-nav a").click(function(){s.tl(this,"o","Blog - Next/Previous Entry")})});