Pager = Class.create();

Pager.prototype = {
    initialize: function (loadFunc){
        this.loadFunction = loadFunc;
    },
	loadFunction:function(page){},
	nextID:'loadnextpage',
	prevID:'loadprevpage',
	appliedTag:null,
	current:1,
	setCurrent:function(page, isNext){
		if (page < 1) page = 1;
		this.current = parseInt(page);
		try{
			if (page == 1) {
				Element.hide(this.prevID);
			}else{
				Element.show(this.prevID);
			}
			if (isNext) {
				Element.show(this.nextID);
			}else{
				Element.hide(this.nextID);
			}
		}catch(e){}
	},
	loadNext: function(){ this.loadPage(this.current+1);},
	loadPrev: function(){ this.loadPage(this.current-1);},
	loadPage: function(pagenum){
		if (pagenum < 1) pagenum = 1;
		if (pagenum == this.current) return;
		this.loadFunction(pagenum);
	}
}