function Page()
{

	this.construct = function()
	{



	}

	this._refresh = false;
	this._refreshOptions = null;

	this._sf = null;
	this._btnSf = null;
	this._pipe = null;
	this._control = null;
	this._caption = '';

	this._ctl = null;
	this._ctlId = '';
	this._ctlInstance = null;

	this._rendered = false;

	this.getSurface = function()
	{
		return this._sf;
	}

	this.setSurface = function( sf )
	{
		this._sf = sf;
	}

	this.setButtonSurface = function( sf )
	{
		this._btnSf = sf;
	}

	this.getButtonSurface = function()
	{
		return this._btnSf;
	}

	this.setCaption = function( text )
	{
		this._caption = text;
	}

	this.getCaption = function()
	{
		return this._caption;
	}

	this.setControl = function( ctl, ctlId )
	{
		this._control = ctl;

		if( ctlId != null ) {
			this._ctlId = ctlId;
		}


	}

	this.getControl = function()
	{
		return this._control;
	}

	this.getControlInstance = function()
	{
		if( !this._ctlInstance ) {

			var tmp = this._control;

			if( tmp != null ) {
				tmp = tmp.replace( '/*@*/', '\'' + this.getSurface().__getAttachmentElement().id + '\'' );
				this._ctlInstance = eval( tmp );
			}
		

		}

		return this._ctlInstance;
	}

	this.setControlRendered = function( flag )
	{
		this._rendered = flag;
	}

	this.getControlRendered = function()
	{
		return this._rendered;
	}


	this.refresh = function( refreshOptions )
	{
		this._refresh = true;
		this._refreshOptions = refreshOptions;
	}

	this.doRefresh = function( refreshOptions )
	{
		if( this._refresh == true ) {

			var opt = refreshOptions;
			if( !opt ) opt = this._refreshOptions;	

			var ctl = this.getControlInstance();

			if( ctl != null ) {
				if( ctl.refresh ) {
					ctl.refresh( opt );
				}
			}

			this._refresh = false;
		}
	}

	this.construct();

}
