var ATMO=(function(){var b={};b.borderizeVoices=function(l){var j=$("#voices-grid"),a=j.children("div"),k=a.length%2,i,h;if(l){i=$("#voice-box-"+l);if(i){i.remove();a=j.children("div")}k=!k}a.each(function(c){h=$(a.get(c));if(!(c%2)){h.addClass("border")}if(k){if(a.length-c<=1){h.addClass("last")}}else{if(a.length-c<=2){h.addClass("last")}}})};return b}());ATMO.ads=(function(){var c={},d=function(b){var f,a="";for(f in b){if(b.hasOwnProperty(f)){a+=f+"="+b[f]+";"}}return a};c.createFactory=function(r,m,n){var q=Math.round(Math.random()*10000000000000000),p=0,o=r||"dctestsite",s=m||"dctestzone",t=n||"",b=function(e,f){return(e||o)+"/"+(f||s)},a={};if("string"!==typeof t){t=d(t)}a.displayAtlanticAd=function(i,g,e,f){var h="http://ad.doubleclick.net/adj/"+b(e,f)+";";p+=1;h+="pos="+i+";";h+="tile="+p+";";if("topleader"===i){h+="dcopt=ist;"}h+=t+"sz="+g+";ord="+q+"?";document.write('<script src="'+h+'" type="text/javascript"><\/script>')};return a};return c}());ATMO.nav=(function(){var e={},d,f=[{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://w1.buysub.com/servlet/OrdersGateway?cds_mag_code=AMY&amp;cds_page_id=32073"},{title:"Renew",link:"https://w1.buysub.com/pubs/AT/AMY/AMY_EmailEntryForm.jsp?cds_page_id=2917&amp;cds_mag_code=AMY&amp;id=1182791388282&amp;lsid=71761209482010172&amp;vid=1"}]},{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://w1.buysub.com/servlet/OrdersGateway?cds_mag_code=AMY&amp;cds_page_id=32073",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://w1.buysub.com/servlet/OrdersGateway?cds_mag_code=AMY&cds_page_id=32073"},{title:"Renew",link:"https://w1.buysub.com/pubs/AT/AMY/AMY_EmailEntryForm.jsp?cds_page_id=2917&cds_mag_code=AMY"},{title:"Subscribe Help",link:"https://w1.buysub.com/pubs/AT/AMY/AMY_EmailEntryForm.jsp?cds_page_id=2917&cds_mag_code=AMY"}]}];e.showSubmenu=function(b){var a,h,c=f[b].submenu;$("#submenu").empty();for(h=0;h<c.length;h+=1){if(c[h].link){a=$("<a></a>").attr({id:"smitem"+h,href:c[h].link}).text(c[h].title)}else{a=$("<span></span>").attr("id","smitem"+h).text(c[h].title)}a.wrap('<li id="subMenuItem'+h+'"></li>');$("#submenu").append(a)}};e.select=function(a){var b=parseInt($(a.target).attr("id").charAt(5),10);if(d>-1){$("#mmImg"+d).attr("src",f[d].offImg)}if(f[b].onImg){$("#mmImg"+b).attr("src",f[b].onImg)}if(f[b].submenu){e.showSubmenu(b)}else{$("#submenu").html("<li>&nbsp;</li>")}d=b};e.build=function(){var j,b,a=$('<div id="menu"></div>'),c=$('<ul id="mainmenu"></ul>'),i=$('<ul id="submenu"></ul>');for(j=0;j<f.length;j+=1){if(f[j].link){b=$('<a href="'+f[j].link+'"></a>')}else{b=$("<span></span>")}b.attr("id","mmItem"+j);b.bind("mouseover",e.select);b.append($("<img />").attr({id:"mmImg"+j,src:f[j].offImg,alt:f[j].title}));c.append($("<li></li>").attr({id:"mainMenuItem"+j,className:"mitem menu-item menu-item-"+f[j].title.toLowerCase()}).append(b))}a.append(c);a.append(i.html($("<li>&nbsp;</li>")));a.insertAfter("#header")};return e}());ATMO.slideshow=(function(){var b={};b.create=function(h){var j,g,a=[],i={};i.slideshowID=h;i.loadImages=function(e){var d,c;for(c in e){if(e.hasOwnProperty(c)){d=$("<img />").attr({src:e[c].src,width:"352",height:"248"});a.push({image:d,attrib:e[c].attrib})}}return a};i.createImgAttrib=function(c){return $("<p>"+c+"</p>")};i.switchSerrifs=function(d){var c=$("#"+i.slideshowID).find(".ss-serif");switch(d){case 0:c.eq(0).css("display","none");c.eq(1).css("display","block");break;case 1:c.eq(0).css("display","none");c.eq(1).css("display","none");break;case 2:c.eq(0).css("display","block");c.eq(1).css("display","none");break}};i.doRollImg=function(f,q,s){if(j!==s){var e=$(s).find("a").attr("href"),r=f[q].image,d=i.createImgAttrib(f[q].attrib),u=$("#"+i.slideshowID).find(".slideshow-images"),c=u.children("div").get(0),t=$("<a></a>"),v;$(t).attr("href",e);t.append(r);v=$("<div></div>").addClass("slideshow-image");v.append(t);v.append(d);if(c){u.children(".slideshow-image").replaceWith(v)}else{u.append(v)}if(j){$(j).removeClass("selected")}$(s).addClass("selected");$(s).wrap('<a href="'+e+'"></a>');j=s;i.switchSerrifs(q)}};i.rollImg=function(e,d,c){g=setTimeout(function(){i.doRollImg(e,d,c)},20)};i.stopRoll=function(){clearTimeout(g)};return i};return b}());