// Function to open pop-up window
function NewWindow(mypage,myname,w,h,scroll,side) 
{
	// Position it 'nicely' left or right
	var winx=40
	var winy=40
	if( side == 'right' )
		winx = screen.width - w - 40
			
	winprops = 'height='+h+',width='+w+',top='+winy+',left='+winx+',scrollbars='+scroll+',resizeable'
	win = window.open(mypage,myname,winprops)
	win.window.focus();
}

// for 2.0 support.
function makeArray(n,thing) 
{
	this.length = n
	for (var i = 1; i<=n; i++) 
	{
		this[i] = new thing()
	}
	return this
}

// Does this work?
//function makeMatrix(x,y,thing) 
//{
//	for (var i = 1; i <= x; i++) 
//	{
//		this[i].length = y
//		this[i] = makeArray(y,thing)
//	}
//	return this
//}

// Function to 'activate' images.
function onImage(imgName) {
// eval must evaluate to executable code, not a file name string for example!
        if (document.images) {
            document[imgName].src = eval(imgName + "_on.src");
        }
}

// Function to 'deactivate' images.
function offImage(imgName) {
        if (document.images) {
            document[imgName].src = eval( imgName + "_off.src");
        }
}

// Link in one place - mouseover and image appears elsewhere
function onPlates(image_name,img_inst, com_inst) 
{
	var comm_image = 'c'+image_name;

	document.images[image_name].src = 'plates/'+img_inst;
	document.images[comm_image].src = 'plates/'+com_inst; 
}
