Bw.Widgets.Image =
{
	superclassName: "Bw.Widgets.Widget",
	selfclassName: "Bw.Widgets.Image",
		
	create: function (src)
	{
		var obj = document.createElement ("IMG");
	
		if (src) {
			obj.setAttribute ("source", src);
		}
	
		Bw.Core.bootstrap (obj, "Bw.Widgets.Image");
		
		return obj;
	},
	
	initialize: function ()
	{
		Bw.Widgets.Widget.initialize.call (this);
		
		this.url = null;
		
		var s = this.style;
		s.MozUserSelect="none";
		s.MozUserInput="disabled";

		var u = this.getAttribute ("source");
		if (u) {
			this.setSource (u);
		}
		
		return false;
	},
	
	draw: function ()
	{
		var png = (this.url.toLowerCase().indexOf(".png") != -1);

		if (document.all && png)
		{
			this.src = Bw.themePath + Bw.Widgets.StockIcon.storagePath + "none.gif";
			this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.url + "')";
		}
		else
		{
			this.src = this.url;
		}
	},

	getSource: function ()
	{
		return this.url;
	},

	setSource: function (src)
	{
		this.url = src;
		this.draw();
	}
};



