if (typeof(PB) == 'undefined') {
	PB = {};
	PB.com = {};
	PB.utl = {};
};

PB.com.NavImg = function (id, name, href)
{
	var		tmp;

	this.mm = new BS.com.Delete;
	
	this.obj = BS.utl.dom.get(id);
	this.name = name;
	this.href = href;

	this.img = this.mm.domNew(this.obj, 'img');
	this.img.src = this.basedir + '/' + this.name + '.gif';
	
	this.ce = this.mm.ceNew('imgNav', this);
	this.ce.addCB(this._mouseE);
	this.ce.attach(this.img, 'mouseover');
	this.ce.attach(this.img, 'mouseout');
	this.ce.attach(this.img, 'click');
};

PB.com.NavImg.prototype = {
	basedir:	'http://www.picbee.net/marc/img/_nav',
	f_sel:		false,

	_delete: function ()
	{
		this.mm._delete();
	},
	
	_draw: function (suf)
	{
		if (suf) suf = '-' + suf;
		else suf = (this.f_sel) ? '-on' : '';

		this.img.src = this.basedir + '/' + this.name + suf + '.gif';
	},

	_mouseE: function (type, data, args)
	{
		var type = args[0].type;
		
		switch (type) {
		case 'mouseover':
			this._draw('over');
			break;
		case 'mouseout':
			this._draw(null)
			break;
		case 'click':
			location.href = this.href;
			break;
		}
	},

	select: function ()
	{
		this.f_sel = true;
		this._draw(null);
	}
};