s.notificationsWidget = function(){
	options = {
		'width': "300px",
		'fixedcenter': true,
		'close': true,
		'draggable': false,
		'zindex': 4,
		'modal': true,
		'visible': false,
		'STRINGS': {'close': dict['close']}
	}
	this.widget = new y.widget.Panel("wait",options);
}

s.notificationsWidget.prototype.show = function(body,type){
	this.prepare(body,type);
	this.widget.show();
}

s.notificationsWidget.prototype.hide = function(){
	this.prepare();
	this.widget.hide();
}

s.notificationsWidget.prototype.prepare = function(body,type){
	if (!body) body = '';
	if (!type || type == 'info') {
		header = dict['message'];
	} else if (type == 'notice') {
		header = dict['notice'];
	} else if (type == 'error') {
		header = dict['error'];
	} else if (type == 'wait') {
		header = body;
		body = '<img src="'+config['MEDIA_URL']+'img/loading.gif" />';
	}
	this.widget.setHeader(header);
	this.widget.setBody(body);
	this.widget.render(document.body);
}

s.notificationsWidget.prototype.display_errors = function(){
	if (errors.length > 0){
		this.show(errors[0]['message'],errors[0]['type']);
	}
}