if ('undefined' == typeof BlogRecentBlock) {
BlogRecentBlock = Class.create(BasicControl, {
	initialize: function($super, config) {
		Object.extend(this, {
			config: {
				cntr: null,
				sn: null,
				foundRows: null,
				initPage: 1
			},

			cntr: null,
			page: null
		});

		$super('blog_recent_block', config);

		this.page = this.config.initPage;
	},

	onReady: function() {	
		this.cntr = $(this.config.cntr);

		this.pageData = new Array();
		
		for (i = 0; i <= this.config.foundRows; i++)
		{
			this.pageData[i] = null;
		}
	},

	stopSS: function() {
		if (this._to)
		{
			window.clearTimeout(this._to);
		}
	},

	_goto: function(page, onSuccess) {	
		if (this.cntr)
		{
			if (('undefined' != typeof this.pageData[page]) && (null != this.pageData[page]))
			{
				this.cntr.update(this.pageData[page]);
				return;
			}
			else
			{
				this.page = page;
			}

			this.freeze();
			this.cntr.startWaiting('bigWaiting');
			
			new Ajax.Request(this.getUrl({
					blg_page_nav_page: page,
					sn: this.config.sn
				}), {
				method: 'GET',
				onFailure: function() {
					/*pAlert(
						this.getString('err_internal'), {title: this.getString('err')}
					);*/

					this.cntr.stopWaiting();
					this.unfreeze();
				}.bind(this),
				onSuccess: function(onSuccess, transport) {				
					var data, btnClear;

					if (!(data = this.evalResponse(transport)) || data.error)
					{
						/*pAlert(
							(data ? data.error : null) || this.getString('err_internal'), {title: this.getString('err')}
						);*/
					}
					else
					{
						this.pageData[this.page] = data.content;
						this.cntr.update(data.content);

						if (onSuccess)
						{
							onSuccess();
						}
					}

					this.cntr.stopWaiting();
					this.unfreeze();				
				}.bind(this, onSuccess)
			});
		}
	},

	gotoPage: function(page) {
		this.stopSS();
		this._goto(page);
	}
});
}