var _navigators=new Array();
var _navigator_id=0;
function Navigator(_1,_2,_3){
this.offset=0;
this.page=0;
this.postsperpage=_1;
this.offset=0;
this.isLastPage=false;
this.callback=_2;
this.args=_3;
this.id=_navigator_id;
if(this.args!=null){
this.args.navigator=this;
}
_navigator_id+=1;
_navigators.push(this);
this.update();
}
function do_navigation(_4,_5){
if(_navigators!=null&&_4<_navigators.length){
var _6=_navigators[_4];
if(_5){
_6.nextPage();
}else{
_6.prevPage();
}
}
}
Navigator.prototype.genHTML=function(){
var _7="<ul class=\"navigator\">";
_7+="<li><a class=\"prevpage_action "+(this.page==0?"disabled":"")+"\"  onclick=\"javascript:do_navigation("+this.id+", 0); return false;\">"+TL("prev_page")+"</a></li>";
_7+="<li><a class=\"nextpage_action "+(this.isLastPage?"disabled":"")+"\" onclick=\"javascript:do_navigation("+this.id+", 1); return false;\">"+TL("next_page")+"</a></li>";
_7+="</ul>";
return _7;
};
Navigator.prototype.update=function(){
this.offset=this.page*this.postsperpage;
if(this.callback!=null){
this.callback(this.args);
scroll(0,0);
}
};
Navigator.prototype.nextPage=function(){
if(!this.isLastPage){
this.page+=1;
this.update();
}
};
Navigator.prototype.prevPage=function(){
if(this.page>0){
this.page-=1;
this.update();
}
};

