// JavaScript Document
<!--

// SHOW/HIDE SCRIPT BY ED PRETE © EDWARD PRETE/PRETE DESIGN
// This script allows you to show and hide sections of a page based upon the selection of a checkbox in another section.
// It is important that you are using XHTML/CSS compliant code to ensure it's functionality.

// This script is a rewrite of various scripts resourced online. Feel free to use and customize as need be.
// This should work in a variety of browsers however I cannot guarantee such.
// If you make any modifications to the script, write me as it would be great to archive various versions of this.
// eprete AT pretedesign DOT NET - Replace at with the @ symbol.

function showhide(layer_ref, cb_ref) {

	// retrieve the checked status of the checkbox
	var cbcheckbox = document.getElementById(cb_ref).id;
	var cbchecked = document.getElementById(cb_ref).checked;
	
	eval (cbchecked);
	if (cbchecked == true) {
	var displaystatus = "block";
	} else {
	var displaystatus = "none";
	}
	
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
	// alert (layer_ref);
	eval( "document.all." + layer_ref + ".style.visibility =" + displaystatus +"");
	// document.all.layer_ref.style.display = displaystatus;
	// alert ('test1');
	}
	
	if (document.layers) { //IS NETSCAPE 4 or below
	document.layers[layer_ref].display = displaystatus;
	// alert ('test2');
	}
	
	if (document.getElementById && !document.all) {
	divobject = document.getElementById(layer_ref);
	divobject.style.display = displaystatus;
	// alert ('test3');
	}
	
}
//-->