// Javascript Function for "Toggle Buttons"
// Clicking the button will show / hide content.

// Remember last used ID so it can be hidden when another block is shown:
// NYI /////////var lastid;

function toggleDiv(id){
	var divid = "block_" + id;
	var imgid = "img_" + id;
	var togid = "toggle_" + id;
	
	// Toggle Hidden -> Shown:
	if(document.getElementById(divid).style.display == 'none'){
		document.getElementById(divid).style.display = 'block';
		document.getElementById(imgid).style.display = 'block';
		document.getElementById(togid).src = '../images/buttons/expand-collapse_up.gif';
		
		document.getElementById(imgid).width='100';
		document.getElementById(imgid).height='100';
		
		// If another DIV has been toggled ON before this one, un-toggle it:
		//     This will keep only one DIV open at a time.
		/* NYI //////////////////
		if (window.lastid){
			toggleDiv(window.lastid);
		}
		window.lastid = id;
		*/		

	// Toggle Shown -> Hidden:
	}else{
		document.getElementById(divid).style.display = 'none';
		//document.getElementById(imgid).style.display = 'none';
		document.getElementById(imgid).style.display = 'block';
		document.getElementById(togid).src = '../images/buttons/expand-collapse_down.gif';
		
		document.getElementById(imgid).width='30';
		document.getElementById(imgid).height='30';
		
		// Ignore usage of "lastid" - (NYI)
		//   when hiding a DIV, there's no reason to pop the old one back up.
	}
}

function toggleCut(id){
	var divid = "block_" + id;
	var cutid = "cut_" + id;
	
	// Toggle Hidden -> Shown:
	if(document.getElementById(divid).style.display == 'none'){
		document.getElementById(divid).style.display = 'block';
		document.getElementById(cutid).style.display = 'none';

	// Toggle Shown -> Hidden:
	}else{
		// No use for shown -> Hidden, toggle a cut is one-way.
	}
}