Bw.Widgets.StockIcon =
{
	superclassName: "Bw.Widgets.Image",
	selfclassName: "Bw.Widgets.StockIcon",
	
	storagePath: "icons/",
	
	create: function (src)
	{
		var obj = document.createElement ("IMG");
	
		if (src) obj.setAttribute ("source", src);
	
		Bw.Core.bootstrap (obj, "Bw.Widgets.StockIcon");
		
		return obj;
	},
	
	initialize: function ()
	{
		Bw.Widgets.Image.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 p = Bw.themePath + this.storagePath;
		
		if (this.url == "none")
		{
			this.src = p + "none.gif";
			if (document.all) this.style.filter = "";
		}
		else
		{
			if (document.all)
			{
				this.src = p + "none.gif";
				this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + p + this.url + ".png')";
			} 
			else
			{
				this.src = p + this.url + ".png";
			}
		}
	}
};



