Effect.DefaultOptions.duration=0.3;RecentUpdates=Class.create({tickerContainer:null,promoContainer:null,feedURL:"/wwdc/rss/recent.xml",pauseLength:5000,timer:0,currentItem:0,items:null,initialize:function(){this.tickerContainer=$("rss-view")?$("rss-view"):null;
this.promoContainer=$("footer-feed")?$("footer-feed"):null;this.items=[];new Ajax.Request(this.feedURL,{method:"get",onSuccess:function(b){this.parseXML(b.responseXML);
if(this.promoContainer){this.buildPromo()}if(this.tickerContainer){this.buildTicker()
}}.bind(this)})},parseXML:function(e){var f,g,h;$A(e.getElementsByTagName("item")).each(function(a){f=a.getElementsByTagName("date")[0].childNodes[0].nodeValue;
g=a.getElementsByTagName("title")[0].childNodes[0].nodeValue;h=a.getElementsByTagName("link")[0].childNodes[0].nodeValue;
this.items.push({date:f,title:g,link:h})}.bind(this))},buildPromo:function(){var b;
this.items.each(function(d,a){if(a<5){b=new Element("li").update("<span>"+d.date+'</span><a href="'+d.link+'">'+d.title+"</a>");
this.promoContainer.appendChild(b)}}.bind(this))},buildTicker:function(){var b=new Element("span",{"class":"rss-item"}).update("<strong>"+this.items[this.currentItem].date+'</strong><a href="'+this.items[this.currentItem].link+'">'+this.items[this.currentItem].title+"</a>");
this.tickerContainer.appendChild(b);this.start()},start:function(){this.interval=setInterval(this.showNext.bind(this),this.pauseLength)
},stop:function(){clearInterval(this.interval)},showNext:function(){if(this.currentItem<this.items.length-1){this.currentItem=this.currentItem+1
}else{this.currentItem=0}new Effect.Fade(this.tickerContainer,{afterFinish:function(){this.tickerContainer.update('<span class="rss-item"><strong>'+this.items[this.currentItem].date+'</strong><a href="'+this.items[this.currentItem].link+'">'+this.items[this.currentItem].title+"</a></span>");
new Effect.Appear(this.tickerContainer)}.bind(this)})}});Event.onDOMReady(function(){new RecentUpdates()
});
