
function NavImages(num, dontcache, dir, prefix) 
{
	this.num = num;
	this.images = new Array();
	this.dontcache = dontcache;

	if (!dir)
		this.dir = "images/";
	else
		this.dir = dir;

	if (!prefix)
		this.prefix = "nav";
	else
		this.prefix = prefix;

	if (!dontcache)
		this.CacheImages();		
}

NavImages.prototype.CacheImages = function()
{
	for (var i = 1; i <= this.num; i++)
	{
		this.CacheImage(i);
	}
}

NavImages.prototype.CacheImage = function(i)
{
	var rel = "";
	if (rel_path) rel = rel_path;

	this.images[i] = new Array();
	this.images[i][0] = new Image();
	this.images[i][0].src = this.dir + this.prefix + i + "_0.gif";
	this.images[i][1] = new Image();
	this.images[i][1].src = this.dir + this.prefix + i + "_1.gif";
}

NavImages.prototype.SI = function(img, i, on, reset_all)
{
	if (!this.images[i])
		this.CacheImage(i);

	if (reset_all)
	{
		for (var j in this.images)
		{
			var temp_img = document.getElementById(this.prefix + j);

			if (temp_img)
			{
				temp_img.src = this.images[j][0].src;
				temp_img.onmouseout = function () 
				{ 
					var index = this.id.match(/.*([0-9]+)$/);
					var func = this.onmouseover + "";//
					func = func.match(/([a-zA-Z_0-9]+)\.SI/);

					eval(func[1]).SI(this,index[1],0); 
				};
			}
		}

		img.onmouseout = function () { return true; }
	}

	img.src = this.images[i][on].src;
}