function daryasoftPaging(currntPage,pageBreak,hidenFiledID,divIDTemplate)
{
	this._currntPage = currntPage;
	this._pageBreak = pageBreak;
	this._hidenFiledID = hidenFiledID;
	this._divIDTemplate = divIDTemplate;
	
	daryasoftPaging.prototype.nextPage = function()
	{
		var tmp = this._currntPage + this._pageBreak;
		if(daryasoftPaging.prototype.getElement(this._divIDTemplate + tmp))
		{
			daryasoftPaging.prototype.getElement(this._divIDTemplate + this._currntPage).style.display = 'none';
			this._currntPage += this._pageBreak;
			daryasoftPaging.prototype.getElement(this._divIDTemplate + this._currntPage).style.display = 'inline';
			daryasoftPaging.prototype.getElement(this._hidenFiledID).value = this._currntPage;
			daryasoftPaging.prototype.setControlsValue(this._hidenFiledID,this._currntPage);
		}
	}
	daryasoftPaging.prototype.lastPage = function()
	{
		var tmp = this._currntPage + this._pageBreak;
		var isLast = false ;
		while(!isLast)
		{
			isLast = (!daryasoftPaging.prototype.getElement(this._divIDTemplate + tmp));
			if(!isLast)
			{
				tmp += this._pageBreak;
			}
		}
		tmp -= this._pageBreak;
		daryasoftPaging.prototype.getElement(this._divIDTemplate + this._currntPage).style.display = 'none';
		daryasoftPaging.prototype.getElement(this._divIDTemplate + tmp).style.display = 'inline';
		this._currntPage = tmp;
		daryasoftPaging.prototype.getElement(this._hidenFiledID).value = tmp;
		daryasoftPaging.prototype.setControlsValue(this._hidenFiledID,tmp);
	}
	
	daryasoftPaging.prototype.prevPage = function()
	{
		var tmp = this._currntPage - this._pageBreak;
		if(daryasoftPaging.prototype.getElement(this._divIDTemplate + tmp))
		{
			daryasoftPaging.prototype.getElement(this._divIDTemplate + this._currntPage).style.display = 'none';
			this._currntPage -= this._pageBreak;
			daryasoftPaging.prototype.getElement(this._divIDTemplate + this._currntPage).style.display = 'inline';
			daryasoftPaging.prototype.getElement(this._hidenFiledID).value = this._currntPage;
			daryasoftPaging.prototype.setControlsValue(this._hidenFiledID,this._currntPage);
		}
	}
	
	daryasoftPaging.prototype.firstPage = function()
	{
		var tmp = 1;
		daryasoftPaging.prototype.getElement(this._divIDTemplate + this._currntPage).style.display = 'none';
		daryasoftPaging.prototype.getElement(this._divIDTemplate + tmp).style.display = 'inline';
		this._currntPage = tmp;
		daryasoftPaging.prototype.getElement(this._hidenFiledID).value = tmp;
		daryasoftPaging.prototype.setControlsValue(this._hidenFiledID,tmp);
	}
	
	daryasoftPaging.prototype.getElement = function(id)
	{
		if(document.all)
		{
			return document.all[id];
		}
		else
		{
			return document.getElementById(id);
		}
	}
	daryasoftPaging.prototype.getElementsByName = function(id)
	{
		return document.getElementsByName(id);
	}
	
	daryasoftPaging.prototype.setControlsValue = function(names,value)
	{
		var objs = daryasoftPaging.prototype.getElementsByName(names);
		if(!objs) return;
		for(i = 0 ; i < objs.length;i++)
		{
			objs[i].value = value;
		}
	}
}
