	allHidden = true;
	
	// Load some images from the server and keep them handy
	if (document.images) {
		rightoff = new Image(); rightoff.src = "/images/rrtriangle.gif";
		righton = new Image(); righton.src = "/images/rytriangle.gif";
		downon = new Image(); downon.src = "/images/dytriangle.gif";
		downoff = new Image(); downoff.src = "/images/drtriangle.gif";
	}
	
	
	function changeImages( rowID ) {
		var rowName = 'row' + rowID; 
		var imgName = 'imgRow' + rowID;
		
		var row = document.getElementById( rowName );
		var img = document.getElementById( imgName );
	
		if (row.style.display =='') {
			// the row is open, so show the downward arrow
			img.src=downon.src;
		}
		else {
			// the row is closed, so show right arrow
			img.src=righton.src;
		}
	}
	
	
	function changeImagesBack( rowID ) {
		var rowName = 'row' + rowID; 
		var imgName = 'imgRow' + rowID;
	
		var row = document.getElementById( rowName );
		var img = document.getElementById( imgName );
		
		if (row.style.display =='') {
			// the row is open, so show the downward arrow
			img.src=downoff.src;
		}
		else {
			// the row is closed, so show right arrow
			img.src=rightoff.src;
		}
	}
	
	
	function change( row, img ) {
		if (row.style.display == '') { 
			row.style.display = 'none';
			img.src = righton.src;
		}
		else { 
			row.style.display = '';
			img.src = downon.src;
		}	
	}
	
	
	function displayRows( minRowID, maxRowID ) {
		imgName = 'imgRow' + maxRowID;
		img = document.getElementById( imgName );
		
		for( i = minRowID; i < maxRowID + 1; ++i ) {
			rowName = 'row' + i;
			//alert( rowName );	
			row = document.getElementById( rowName );			
			change( row, img );
		}
	}
	
	
	function displayRow( rowID ) {
		var rowName = 'row' + rowID;
		var imgName = 'imgRow' + rowID;
			
		img = document.getElementById( imgName );
		row = document.getElementById( rowName );			
		change( row, img );
		
		// This won't work in FireFox, unfortunately...
		/*	
		alert( document.all(rowName).length );
				
		if( 0 < document.all(rowName).length ) {
			for( i = 0; i < document.all(rowName).length; ++i ) {
				change( document.all(rowName,i), img ); 
			} 	
		}
		else {
			row = document.getElementById( rowName );			
			change( row, img );
		}
		*/
	}
	
	
	function showHideAllRows( ) {
		if( allHidden == false ) {
			disp = 'none';
			imgsrc = rightoff.src;
			frmShowHide1.btnShowHideDetails.value = 'Show all details';
			frmShowHide2.btnShowHideDetails.value = 'Show all details';
			allHidden = true;
		} 
		else {
			disp = '';
			imgsrc = downoff.src;
			frmShowHide1.btnShowHideDetails.value = 'Hide all details';
			frmShowHide2.btnShowHideDetails.value = 'Hide all details';
			allHidden = false;
		}
		
		for( x = 1; x < nRows + 1; ++x ) {
			rowName = 'row' + x;
			imgName = 'imgRow' + x;
			
			row = document.getElementById( rowName );
			img = document.getElementById( imgName ); 
		
			row.style.display = disp;	
			img.src = imgsrc;
		}
	}

	// How many collapsible rows are there?
	nRows = 1;
	function setNRows( x ) {
		nRows = x;
	}