(function(){var a,e="http://www.thisamericanlife.org/",d=function(){a(document).ready(function(h){var i=new Date(),g=h(".this-american-life:not(.loaded)"),f=h("<link>",{rel:"stylesheet",type:"text/css",href:"http://audio.thisamericanlife.org/widget/widget.min.css?"+parseInt(new Date().getTime(),10)});f.appendTo("head");g.each(function(){var p=h(this),m,j,o=false,q=p.attr("id"),l,k,n=parseInt(p.width()-70,10);if(!p.hasClass("loaded")){p.hide().addClass("loaded");l=q.match(/^this-american-life-playlist-(\d+)/);if(l){m=l[1];o=true}else{l=q.match(/^this-american-life-(\d+)-(\d+)/);if(l){m=l[1];j=l[2]}else{l=q.match(/^this-american-life-(\d+)/);if(l){m=l[1]}else{l=q.match(/^this-american-life-(\w+)/);if(l){m=l[1]}}}}if(m){if(o){k=e+"episode/json/playlist/"+m}else{if(j){k=e+"episode/json/"+m+"/"+j}else{k=e+"episode/json/"+m}}h.ajax({url:k,dataType:"jsonp",error:function(){p.remove()},success:function(u){var t=h("<div>"),v=h("<div>").addClass("this-american-life-inner"),s=h("<div>").addClass("this-american-life-header"),r=h("<div>").addClass("description");s.append(h("<div>").addClass("air-date").text(u.date));if(o){s.append(h("<h2>").text("Playlist: "+u.title));v.append(s);v.append(h("<div>").addClass("this-american-life-player").append(h("<div>").attr({id:"this-american-life-player-"+u.episode})));v.append(r);v.append(h("<div>").addClass("copyright").html(u.copyright));t.append(h("<h1>").append(h("<a/>").attr({href:e}).text("This American Life")));t.append(v);p.html(t).show();jwplayer("this-american-life-player-"+u.episode).setup({flashplayer:"http://audio.thisamericanlife.org/widget/player.swf",playlist:u.playlist,height:24,width:n,wmode:"opaque",controlbar:"bottom",repeat:"list",autostart:false})}else{if(u.act){s.append(h("<h2>").append(h("<a/>").attr({href:u.link}).text(u.episode+": "+u.title)));v.append(s);v.append(h("<div>").addClass("this-american-life-player").append(h("<div>").attr({id:"this-american-life-player-"+u.episode})));r.append(h("<h3>").html(u.act.title));v.append(r.append(u.act.description));v.append(h("<div>").addClass("copyright").html(u.copyright));t.append(h("<h1>").append(h("<a/>").attr({href:e}).text("This American Life")));t.append(v);p.html(t).show();jwplayer("this-american-life-player-"+u.episode).setup({flashplayer:"http://audio.thisamericanlife.org/widget/player.swf",start:u.act.start,streamer:"rtmp://wbez.fcod.llnwd.net/a3989/o35",file:"thislife/jomamashouse/ismymamashouse/"+u.episode+".mp3",height:24,width:n,wmode:"opaque",controlbar:"bottom",repeat:"list",autostart:false,events:{onTime:function(x){var w=parseInt(x.position,10);if((u.act.end&&x.position>u.act.end)||(u.act.start&&x.position<u.act.start)){jwplayer("this-american-life-player-"+u.episode).stop()}}}})}else{s.append(h("<h2>").append(h("<a/>").attr({href:u.link}).text(u.episode+": "+u.title)));v.append(s);v.append(h("<div>").addClass("this-american-life-player").append(h("<div>").attr({id:"this-american-life-player-"+u.episode})));v.append(r.html(u.description));v.append(h("<div>").addClass("copyright").html(u.copyright));t.append(h("<h1>").append(h("<a/>").attr({href:e}).text("This American Life")));t.append(v);p.html(t).show();jwplayer("this-american-life-player-"+u.episode).setup({flashplayer:"http://audio.thisamericanlife.org/widget/player.swf",streamer:"rtmp://wbez.fcod.llnwd.net/a3989/o35",file:"thislife/jomamashouse/ismymamashouse/"+u.episode+".mp3",height:24,width:n,wmode:"opaque",controlbar:"bottom",repeat:"list",autostart:false})}}}})}else{p.remove()}}})})},c=function(){a=window.jQuery.noConflict(true);d()},b;if(window.jwplayer===undefined||window.jwplayer.version!=="5.5.1641 (Licensed version)"){b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("src","http://audio.thisamericanlife.org/widget/jwplayer.js");(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(b)}if(window.jQuery===undefined||window.jQuery.fn.jquery!=="1.4.2"){b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("src","http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");b.onload=c;b.onreadystatechange=function(){if(this.readyState==="complete"||this.readyState==="loaded"){c()}};(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(b)}else{a=window.jQuery;d()}}());
