var i4_Message = {
	initialized: false,
	
	id_name: 'i4_message',
	show_time: 2, // seconds
	timeout_id: 0,
	
	// background colors
	color_bg_progress: '#FAFF99',
	color_border_progress: '#C9CD7B',
	color_bg_message: '#B5FFAA',
	color_border_message: '#8FCA87',

	initialize: function() {
		$$('body')[0].appendChild(Builder.node('div', {id: this.id_name}));
		$(this.id_name).setStyle({
			'position': 'absolute',
			'width': '300px',
			'top': '1px',
			'left': '50%',
			'padding': '3px',
			'marginLeft': '-153px',
			'minHeight': '10px',
			'border': '1px solid black',
			'fontSize': '11px',
			'zIndex': '91'
		});
		
		this.initialized = true;
	},
	
	progress: function(){
		if(!this.initialized){ this.initialize(); }
		$(this.id_name).hide();
		$(this.id_name).setStyle({
			'border': '1px solid '+this.color_border_progress,
			'background': this.color_bg_progress
		});
		
		$(this.id_name).update('Laden...');
		$(this.id_name).show();
	},
	
	show: function(text){
		if(!this.initialized){ this.initialize(); }
		$(this.id_name).hide();
		clearTimeout(this.timeout_id);
		
		$(this.id_name).setStyle({
			'border': '1px solid '+this.color_border_message,
			'background': this.color_bg_message
		});
		
		$(this.id_name).update(text);
		$(this.id_name).appear({ duration: 0.2 });
		this.timeout_id = setTimeout("i4_Message.hide()", this.show_time*1000);
	}, 
	
	hide: function(){
		$(this.id_name).fade({ duration: 0.5 });
	}
}
