// create a global array: 
//		var a_images = new Array();
// array should be:
//		a_images[<index>] = new Array('<image location>', '<associated div id>');
// You can add or delete from the array.  The indexes DO NOT need to 
// match anything else.  The first position is the graphic, the next is the div id.
//
// In your code, you will want the following structure for each image 
// corresponding to the array:
//
//	<div id="image2">
//	<script language="JavaScript" type="text/javascript">
//		show_text(2);
//	< /script>	*** remove space between bracket and slash, just added for demo		
//	</div>
//	<noscript>
//	  [<a href="graphics/qs_2K-wiz2.gif">show image</a>]<br> 
//	</noscript>
//
// In your page, if you want a show/hide all, you need the following code:
//	<script language="JavaScript" type="text/javascript">
//		if (!document.layers) {
//			document.write('<div id="showhideall">[<a href="javascript:do_all(1)">show all images</a>] &nbsp; [hide all images]</div>');
//		}
//	< /script> 	*** remove space between bracket and slash, just added for demo		

//show a single image and the hide text
function show_image(i_pos) {
	if (!document.layers) {
		o_div = document.getElementById(a_images[i_pos][1]);
		o_div.innerHTML='[<a href="javascript:show_text('+i_pos+')">hide image</a>]<br><img src="'+ a_images[i_pos][0] +'" alt="">';
	}
}

//show a single text command
function show_text(i_pos) {
	if (!document.layers) {
		o_div = document.getElementById(a_images[i_pos][1]);
		o_div.innerHTML='[<a href="javascript:show_image('+i_pos+')">show image</a>]';
	}
	// for ns4.x
	else {	
		document.write('[<a href="'+a_images[i_pos][0]+'">show image</a>]<br>');
	}
}

// show or hide all images
function do_all(b_show) {
	for (var i in a_images) { 
		if (b_show) {
			show_image(i);
		}
		else {
			show_text(i);
		}
	}
	if (!document.layers) {
		o_div = document.getElementById('showhideall');
	}
	if (b_show) {
		o_div.innerHTML='[show all images] &nbsp; [<a href="javascript:do_all(0)">hide all images</a>]';
	}
	else {
		o_div.innerHTML='[<a href="javascript:do_all(1)">show all images</a>] &nbsp; [hide all images]';
	}
}