// ************************************************************************************
// BasePaginatorControl
// ************************************************************************************
// namespace
Type.registerNamespace("Competir.Web.UI.Webparts");

// constructor
Competir.Web.UI.Webparts.BasePaginatorControl = function(element)
{
	Competir.Web.UI.Webparts.BasePaginatorControl.initializeBase(this, [element]);
	this._Paginate = false;
	this._ActualPage = 0;
	this._PageLength = 0;
	this._PageSetLength = 0;
	this._PaginateXpression = "ROOT/Class";
	this._SortHelperXpression = "";
	this._SortHelperDataType = "String";
	this._SortHelperOrder = "Ascending";
	this._MaxPageCache = 0;
};

// prototype
Competir.Web.UI.Webparts.BasePaginatorControl.prototype =
{
	// methods
	renderContent: function()
	{
		this.changePageIndex(0);
	},
	changePageIndex: function(index)
	{
		this.set_ActualPage(index);
	},

	// properties
	get_Paginate: function()
	{
		return this._Paginate;
	},
	set_Paginate: function(value)
	{
		if (this._Paginate !== value)
		{
			this._Paginate = value;
			this.raisePropertyChanged("Paginate");
		}
	},
	get_ActualPage: function()
	{
		return this._ActualPage;
	},
	set_ActualPage: function(value)
	{
		if (this._ActualPage !== value)
		{
			this._ActualPage = value;
			this.raisePropertyChanged("ActualPage");
		}
	},
	get_PageLength: function()
	{
		return this._PageLength;
	},
	set_PageLength: function(value)
	{
		if (this._PageLength !== value)
		{
			this._PageLength = value;
			this.raisePropertyChanged("PageLength");
		}
	},
	get_PageSetLength: function()
	{
		return this._PageSetLength;
	},
	set_PageSetLength: function(value)
	{
		if (this._PageSetLength !== value)
		{
			this._PageSetLength = value;
			this.raisePropertyChanged("PageSetLength");
		}
	},
	get_PaginateXpression: function()
	{
		return this._PaginateXpression;
	},
	set_PaginateXpression: function(value)
	{
		if (this._PaginateXpression !== value)
		{
			this._PaginateXpression = value;
			this.raisePropertyChanged("PaginateXpression");
		}
	},
	get_SortHelperXpression: function()
	{
		return this._SortHelperXpression;
	},
	set_SortHelperXpression: function(value)
	{
		if (this._SortHelperXpression !== value)
		{
			this._SortHelperXpression = value;
			this.raisePropertyChanged("SortHelperXpression");
		}
	},
	get_SortHelperDataType: function()
	{
		return this._SortHelperDataType;
	},
	set_SortHelperDataType: function(value)
	{
		if (this._SortHelperDataType !== value)
		{
			this._SortHelperDataType = value;
			this.raisePropertyChanged("SortHelperDataType");
		}
	},
	get_SortHelperOrder: function()
	{
		return this._SortHelperOrder;
	},
	set_SortHelperOrder: function(value)
	{
		if (this._SortHelperOrder !== value)
		{
			this._SortHelperOrder = value;
			this.raisePropertyChanged("SortHelperOrder");
		}
	},
	get_MaxPageCache: function()
	{
		return this._MaxPageCache;
	},
	set_MaxPageCache: function(value)
	{
		if (this._MaxPageCache !== value)
		{
			this._MaxPageCache = value;
			this.raisePropertyChanged("MaxPageCache");
		}
	}
};

// registration
Competir.Web.UI.Webparts.BasePaginatorControl.registerClass("Competir.Web.UI.Webparts.BasePaginatorControl", Competir.Web.UI.Webparts.BaseWebpartControl);