/**
* StatusWidget
*
* The StatusWidget is a composite of two SimpleWidgets: an image widget and a message widget.
*
* @param style_set
*   -style_set_img_sw
*   -style_set_img_sw_container
*   -style_set_status_container
**/
function StatusWidget( style_set ) { 

	this.style_set = style_set;

	this.img_widget = new SimpleWidgetFactory( this.style_set + "_img" ).build();

	this.container_dom = document.createElement( 'div' );
	this.container_dom.className = "hidden_widget";

	this.container_dom.appendChild( this.img_widget.getWidgetDOM() );

}

StatusWidget.prototype = new AbstractWidget();

StatusWidget.prototype.hideWidget = function() { this.container_dom.className = "hidden_widget"; }
StatusWidget.prototype.showWidget = function() { this.container_dom.className = this.style_set + "_status_container"; }

/**
* StatusWidget.setStatus
*
* @param status_name The name defined for the status.  This name determines what image goes with the img_widget
* @param message The text message to place into the msg_widget
**/
StatusWidget.prototype.setStatus = function( status_name, message ) { 

	this.current_status = status_name;
	this.img_widget.clearContents();

	this.current_message = message;

	var status_img = document.createElement( 'img' );
	status_img.src = "img/page/status/" + status_name + ".gif";

	status_img.title = this.current_message;

	this.img_widget.addContentNode( status_img );

	this.showWidget();

}

