if (Object.isUndefined(s3core))throw 's3core.loader is part of the s3core libraray. s3core.js must be loaded first.';
s3core.loader=Class.create
(
	{
		config:
		{
			header:				'Please wait a moment...',
			info:				'',
			message:			'Performing loading operations...',
			wrapperStyle:		'padding: 2px;width: 500px;height: auto;border: 1px solid #ccc;background-color: #FFF;',
			innerWrapperStyle:	'padding: 10px;margin: 0;',
			idicatorStyle:		'margin-right:8px;float:left;vertical-align:top;',
			headerStyle:		'font-weight: bold; font-size: 14px;',
			infoStyle:			'font-weight: normal;',
			messageStyle:		'font: normal 10px arial,tahoma,sans-serif;',
			template:			s3core.template
			(
				'<div id="#{wrapperID}" style="#{wrapperStyle};">',
					'<div id="#{innerWrapperID}" style="#{innerWrapperStyle}">',
						'<img src="'+$COREROOT+'images/large-loading.gif" width="32" height="32" id="#{indicatorID}" style="#{idicatorStyle}"/><span id="#{headerID}" style="#{headerStyle}">#{header}</span><br />',
						'<span id="#{infoID}" style="#{infoStyle}">#{info}</span><br />',
						'<hr />',
						'<span id="#{messageID}" style="#{messageStyle}">#{message}</span>',
					'</div>',
				'</div>'
			)
		},
		initialize: function(config)
		{
			this.config=					Object.extend(this.config,config);
			this.config.wrapperID=			s3core.random();
			this.config.innerWrapperID=		s3core.random();
			this.config.indicatorID=		s3core.random();
			this.config.headerID=			s3core.random();
			this.config.infoID=				s3core.random();
			this.config.messageID=			s3core.random();
			return;
		},
		toString: function()
		{
			return this.config.template.evaluate(this.config);
		},
		show: function()
		{
			$(this.config.wrapperID).show();
		},
		appear: function()
		{
			$(this.config.wrapperID).appear();
		},
		hide: function()
		{
			$(this.config.wrapperID).hide();
		},
		fade: function()
		{
			$(this.config.wrapperID).fade();
		},
		updateMessage: function(message)
		{
			$(this.config.messageID).update(message);
			return this;
		}
	}
);