var appDelegate={trackingNameForSection:function(d,f,e){if(d.count<2){d.count++;
return false}var a=e._triggers[0];if(a.up("#firstcolumn")){return false}var c=e.id;
c=c.substring(0,c.indexOf("_"));var b=a.down("span");if(b){b=b.innerHTML;b=b.substring(b.indexOf(".")+2,b.length);
return c+" - "+b}return c+" - "+a.innerHTML}};var featureViewer=null;var topicsHash=[];
var browser=Class.create();Object.extend(browser.prototype,{initialize:function(){this.setPaidAppsLink("paidapps");
this.setFreeAppsLink("freeapps");this.paidAppsLink.addClassName("active");this.freeAppsLink.removeClassName("active");
this.sendReq()},setPaidAppsLink:function(a){this.paidAppsLink=$(a);return this.paidAppsLink
},setFreeAppsLink:function(a){this.freeAppsLink=$(a);return this.freeAppsLink},sendReq:function(){var a=new Ajax.Request("/autopush/us/iphone/appstore/feeds/guide.json",{method:"GET",onException:function(b,c){throw (c)
},onComplete:this.acknowledgeComplete.bind(this)})},scopedEval:function(stringValue){try{return(function(){return eval("("+stringValue+")")
})()}catch(e){return null}},acknowledgeComplete:function(b){var c=b.responseText;
var a=this.scopedEval(c);if(a){this.sections=a;this.setColumns()}},setPaidFreeLinks:function(a){this.changePaidFreeLinks(a);
Event.observe(this.paidAppsLink,"click",this.setFirstColumnIdsPaid.bindAsEventListener(this));
Event.observe(this.freeAppsLink,"click",this.setFirstColumnIdsFree.bindAsEventListener(this))
},changePaidFreeLinks:function(c){var a=c.sub("free","paid");var b=c.sub("paid","free");
this.paidAppsLink.href="#"+a;this.freeAppsLink.href="#"+b},setFirstColumnIdsPaid:function(a){if(a){Event.stop(a)
}if(this.freeAppsLink.hasClassName("active")){this.freeAppsLink.removeClassName("active")
}if(!this.paidAppsLink.hasClassName("active")){this.paidAppsLink.addClassName("active")
}$$("#firstcolumn .ACSliderMaskDiv ul li a.sub-nav-link").each(function(b){var c=b.id;
c=c.sub("free","paid");b.id=c;b.href="#"+c});this.changeActiveContent()},setFirstColumnIdsFree:function(a){if(a){Event.stop(a)
}if(this.paidAppsLink.hasClassName("active")){this.paidAppsLink.removeClassName("active")
}if(!this.freeAppsLink.hasClassName("active")){this.freeAppsLink.addClassName("active")
}$$("#firstcolumn .ACSliderMaskDiv ul li a.sub-nav-link").each(function(b){var c=b.id;
c=c.sub("paid","free");b.id=c;b.href="#"+c});this.changeActiveContent()},changeActiveContent:function(){var a=$$("#firstcolumn .active")[0];
featureViewer.triggerClicked(null,a)},setColumns:function(){var d=new TipsSlider("firstcolumn");
var a=false;for(var c=0,h;h=this.sections[c];c++){var m=h.title;var l=h.type;var k=h.id;
var e=h.topics;var g=null;var f=null;if(l=="Paid"){f=Builder.node("a",{className:"sub-nav-link",id:k,href:"#"+k},[Builder.node("span",[m])]);
g=new AC.SliderItem(f);d.items.push(g);if(!a){a=k}}topicsHash[c]={id:k,topics:e}
}for(var b=0;b<topicsHash.length;b++){topicsHash[topicsHash[b].id]=topicsHash[b]
}d.render(10);d.resetPages();featureViewer=new FeatureViewer($$(".section-content"),"secondcolumn","sub-nav-link",{initialId:a,shouldAnimateContentChange:false,silentTriggers:true,subViewer:this.subFeatureViewer,alwaysShowSection:true});
this.setPaidFreeLinks(a)}});Event.onDOMReady(function(){var a=new browser();var b=new AC.ViewMaster.Tracker("click");
b.setDelegate(appDelegate)});
