var NavToggle=Class.create({duration:0.5,postTransTimeout:100,open:false,active:true,overviewText:"Overview",pathName:document.location.pathname.replace(document.location.pathname.split("/").pop(),""),productName:document.location.pathname.split("/")[1],_isiOS4:null,isiOS4:function(){if(this._isiOS4===null){this._isiOS4=AC.Detector.iOSVersion()>=4
}return this._isiOS4},_isiOS:null,isiOS:function(){if(this._isiOS===null){this._isiOS=AC.Detector.iOSVersion()
}return this._isiOS},initialize:function(a,b){this._delegate={};this.container=$(a);
this._isTop=(b)?false:true;this.browse=(this._isTop)?$("browse-strip-top"):$("browse-strip-bottom");
this.button=this.browse.down("a.browse");this.caret=new Element("span",{className:"caret"});
this.browse.insert(this.caret);this.list=this.container.down("ul");if(this.isiOS4()){this.button.observe("touchstart",this.toggle.bind(this));
Element.observe(document.body,"touchmove",this.bodyClick.bind(this))}this.button.observe("click",this.toggle.bind(this));
if(this.isiOS4()){this.wrapper=(this._isTop)?$("wrapper"):null;this.subWrapper=(this._isTop)?$("sub-wrapper"):null;
this.content=$("main").down(".content");this.globalfooter=$("globalfooter");this.promofooter=$("promofooter");
this.sosumi=$("sosumi");this._boundTransitionEnd=this.transitionEnd.bindAsEventListener(this);
this.container.addVendorEventListener("transitionEnd",this._boundTransitionEnd)
}else{this.height=this.list.getHeight();this.list.setOpacity(0)}this.activateCurrent();
if(b){this.container.addClassName("features-pagenav");this.createPageNav()}},delegate:function(){return this._delegate
},setDelegate:function(a){if(typeof a==="object"){this._delegate=a}return this._delegate
},bodyClick:function(a){if(!this.active){a.stop()}},toggle:function(a){if(typeof a!=="undefined"){a.stop()
}if(!this.active){return false}this.active=false;var b=(!this._isTop)?"padding-top":"padding-bottom";
if(this.open){this.button.removeClassName("active");this.container.removeClassName("open");
this.list.removeClassName("open");this.caret.removeClassName("open");if(this.isiOS()&&!this.isiOS4()){this.list.addClassName("threetwo")
}if(this.isiOS4()){this.list.addClassName("open-pre-trans");if(this._isTop){if(!!this.wrapper){this.wrapper.removeClassName("open");
this.wrapper.addClassName("open-pre-trans");setTimeout(function(){this.wrapper.addClassName("open-post-trans")
}.bind(this),this.postTransTimeout)}}else{this.browse.removeClassName("open");this.globalfooter.removeClassName("open");
this.promofooter.removeClassName("open");if(!!this.sosumi){this.sosumi.removeClassName("open")
}this.browse.addClassName("open-pre-trans");this.globalfooter.addClassName("open-pre-trans");
this.promofooter.addClassName("open-pre-trans");if(!!this.sosumi){this.sosumi.addClassName("open-pre-trans")
}setTimeout(function(){this.browse.addClassName("open-post-trans");this.globalfooter.addClassName("open-post-trans");
this.promofooter.addClassName("open-post-trans");if(!!this.sosumi){this.sosumi.addClassName("open-post-trans")
}}.bind(this),this.postTransTimeout)}setTimeout(function(){this.list.addClassName("open-post-trans")
}.bind(this),this.postTransTimeout)}else{this.container.morph(b+":0px;",{duration:this.duration,afterFinish:function(){this.active=true
}.bind(this)});Effect.Fade(this.list,{duration:this.duration})}}else{this.button.addClassName("active");
this.caret.addClassName("open");if(this.isiOS()&&!this.isiOS4()){this.list.addClassName("threetwo")
}if(this.isiOS4()){this.list.addClassName("pre-trans");if(typeof this.height=="undefined"){this.height=this.list.getHeight()
}if(this._isTop){if(!!this.wrapper){this.wrapper.addClassName("pre-trans");setTimeout(function(){this.wrapper.addClassName("post-trans")
}.bind(this),this.postTransTimeout)}}else{this.browse.addClassName("pre-trans");
this.globalfooter.addClassName("pre-trans");this.promofooter.addClassName("pre-trans");
if(!!this.sosumi){this.sosumi.addClassName("pre-trans")}setTimeout(function(){this.browse.addClassName("post-trans");
this.globalfooter.addClassName("post-trans");this.promofooter.addClassName("post-trans");
if(!!this.sosumi){this.sosumi.addClassName("post-trans")}}.bind(this),this.postTransTimeout)
}setTimeout(function(){this.list.addClassName("post-trans")}.bind(this),this.postTransTimeout)
}else{if(this._isTop){this.container.morph(b+":"+(this.height+25)+"px;",{duration:this.duration,afterFinish:function(){this.active=true
}.bind(this)})}else{this.container.morph(b+":"+this.height+"px;",{duration:this.duration,afterFinish:function(){this.active=true
}.bind(this)})}Effect.Appear(this.list,{duration:this.duration})}if("track" in this._delegate&&typeof this._delegate.track==="function"){this._delegate.track(this)
}}this.open=!this.open},transitionEnd:function(a){if(this.open){this.list.addClassName("open");
this.container.addClassName("open");if(this._isTop){this.wrapper.addClassName("open")
}else{this.browse.addClassName("open");this.globalfooter.addClassName("open");this.promofooter.addClassName("open");
if(!!this.sosumi){this.sosumi.addClassName("open")}}}else{this.list.removeClassName("pre-trans");
this.list.removeClassName("post-trans");this.list.removeClassName("open-pre-trans");
this.list.removeClassName("open-post-trans");if(this._isTop){if(!!this.wrapper){this.wrapper.removeClassName("pre-trans");
this.wrapper.removeClassName("post-trans");this.wrapper.removeClassName("open-pre-trans");
this.wrapper.removeClassName("open-post-trans")}}else{this.browse.removeClassName("pre-trans");
this.browse.removeClassName("post-trans");this.browse.removeClassName("open-pre-trans");
this.browse.removeClassName("open-post-trans");this.globalfooter.removeClassName("pre-trans");
this.globalfooter.removeClassName("post-trans");this.globalfooter.removeClassName("open-pre-trans");
this.globalfooter.removeClassName("open-post-trans");this.promofooter.removeClassName("pre-trans");
this.promofooter.removeClassName("post-trans");this.promofooter.removeClassName("open-pre-trans");
this.promofooter.removeClassName("open-post-trans");if(!!this.sosumi){this.sosumi.removeClassName("pre-trans");
this.sosumi.removeClassName("post-trans");this.sosumi.removeClassName("open-pre-trans");
this.sosumi.removeClassName("open-post-trans")}}}this.active=true},get:function(b){if(!this._current&&b!=="next"){return false
}var a=(this._current)?this._current.up("li"):this.list.down("li");if(a&&this._current){a=a[b]()
}if(!a){if(b=="previous"&&document.location.pathname!==this.pathName){a=new Element("li").insert('<a class="overview" href="'+this.pathName+'"><div><div>'+this.overviewText+"</div></div></a>")
}}if(a&&a.hasClassName("skip")){a=a[b]()}if(!a){return false}a=a.down("a");if(!a){return false
}a=a.cloneNode(true);a=a.addClassName(b);a.innerHTML=a.innerHTML.replace("icon","iconb");
a.innerHTML=a.innerHTML.replace(/<br.*?>/ig,"");return a},getCurrent:function(){if(this._current==null){this._current=false;
var a=document.location.toString().replace(/.*\//,"").replace(/\?.*/,"").replace(/#.*/,"");
if(a){this._current=this.container.down('a[href$="'+a+'"]');if(this._current==this.button){this._current=new Element("a")
}}}return this._current},activateCurrent:function(){var a=this.getCurrent();if(a){a.addClassName("active")
}},createPageNav:function(){var b=this.get("previous"),a=this.get("next");if(!!b){b.insert(b.down("img")||"");
this.browse.insert({top:b});b.observe("mousedown",function(c){AC.Storage.setItem("s_"+productName+"_nav","footer nav","0")
})}else{this.browse.insert({top:new Element("span",{className:"previous"})})}if(!!a){this.browse.insert({bottom:a});
a.observe("mousedown",function(c){AC.Storage.setItem("s_nav","footer nav","0")})
}else{this.browse.insert({bottom:new Element("span",{className:"next"})})}}});Event.onDOMReady(function(){var c={track:function(g){var d=!g._isTop?"footer":"header";
AC.Tracking.trackClick({prop3:AC.Tracking.pageName()+" - browse all - "+d},g,"o",AC.Tracking.pageName()+" - browse all - "+d);
if(!g.trackedLinksWithin){var e=g.list.select("a");for(var f=e.length-1;f>=0;f--){e[f].observe("mousedown",function(h){if(AC&&AC.Storage){AC.Storage.setItem("s_nav","browse all - "+d,"0")
}})}g.trackedLinksWithin=true}}};var b=new NavToggle("features-nav-top",false);
b.setDelegate(c);var a=new NavToggle("features-nav-bottom",true);a.setDelegate(c)
});
