function Button (i, n, h)
{
	var img = document.images[i];
	
	img.n = new Image();
	img.n.src = n;
	
	img.h = new Image();
	img.h.src = h;
	
	img.src = n;
	
	img.onmouseover = function () 
	{
		this.src = this.h.src;
	};
	
	img.onmouseout = function () 
	{
		this.src = this.n.src;
	};
}

// Adapted from DreamWeaver
function Find (n, d)
{
	if (!d)
		d = document;
		
	var p = n.indexOf("?");
	
	if (p > 0 && parent.frames.length)
	{
		d = parent.frames[n.substring(p + 1)];
		n = n.substring(0, p);
	}
	
	var x = d[n];
	
	if (!x && d.all)
		x = d.all[x];
		
	var i;
	
	for (i = 0; !x && i < d.forms.length; i++)
		x = d.forms[i][n];
		
	if (!x && d.layers)
		for (i = 0; !x && i < d.layers.length; i++)
			x = Find(n, d.layers[i].document);
	
	if (!x && d.getElementById)
		x = d.getElementById(n);
		
	return x;
}

/*
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
*/

function Menu (i, n, h)
{
	var img = document.images[i];
	
	img.n = new Image();
	img.n.src = n;
	
	img.h = new Image();
	img.h.src = h;
	
	img.src = n;
	
	img.m = Find("sub" + i);
	img.m.i = img;
	
	img.onmouseover = function () 
	{
		clearTimeout(this.m.to);
		
		PopUp(this.id);
	};
	
	img.onmouseout = function () 
	{
		SchedulePopOut(this.id);
	};
	
	img.m.onmouseover = function ()
	{
		clearTimeout(this.to);
	}
	
	img.m.onmouseout = function ()
	{
		SchedulePopOut(this.i.id);
	}
}

function SetVisibility (o, f)
{
	if (o.style)
		o.style.visibility = f ? "visible" : "hidden";
}

function PopUp (i)
{
	var o = document.images[i];
	
	o.src = o.h.src;
	
	SetVisibility(o.m, true);
}

function PopOut (i)
{
	var o = document.images[i];
	
	o.src = o.n.src;
	
	SetVisibility(o.m, false);
}

function SchedulePopOut (i)
{
	document.images[i].m.to = setTimeout("PopOut('" + i + "')", 10);
}