PageNav=Class.create({initialize:function(d,c){this.container=$(d);this.content=$(c);
if(this.content){this.links=this.content.select("li>a");this.item=this.getElement();
if(this.container&&this.container.empty()&&this.item){if(this.item.up("li")){this.item.up("li").addClassName("active")
}this.getPrevious();this.getNext();this.writeLinks()}}},getElement:function(){url=location.pathname;
for(this.i=0;this.i<this.links.length;this.i++){href=this.links[this.i].readAttribute("href");
if(url==href){break}}return this.links[this.i]},getPrevious:function(){this.previous=this.links[this.i-1];
if(this.previous){this.previous=$(this.previous);this.previous=this.writeWrappers(this.previous);
this.previous.className+="arrow_prev"}},getNext:function(){this.next=this.links[this.i+1];
if(this.next){this.next=$(this.next);this.next=this.writeWrappers(this.next);this.next.className+="arrow_next"
}},writeWrappers:function(d){var c=$(d.cloneNode(true));return c},writeLinks:function(){if(this.previous&&this.previous.nodeType==1){this.container.appendChild(this.previous)
}if(this.next&&this.next.nodeType==1){this.container.appendChild(this.next)}}});
Event.onDOMReady(function(){new PageNav("pagenav","sidebarnav")},false);
