public Page( int totalrecords, int pagenum){
		this.pagenum = pagenum;
		this.totalrecords = totalrecords;
		this.totalpage = (totalrecords - 1 + pagesize)/pagesize;
		this.startindex = pagenum * pagesize - pagesize;
		
		if(totalpage < 10){
			this.startpage = 1;
			this.endpage = totalpage;	
			
		}else{
		
			this.startpage = this.pagenum - 4;
			this.endpage = this.pagenum + 5;
			
			
			if(this.startpage < 1){
				this.startpage = 1;
				this.endpage = 10;
			}
			
			if(this.endpage > this.totalpage){
				this.startpage = this.totalpage - pagesize + 1;
				this.endpage = this.totalpage;
			}

		}
	}