var active=-1;
function pull(id) {
 button = document.getElementById("b"+id);
 notes = document.getElementById("notes"+id);
 if (notes.style.display=="") {
  notes.style.display="none";
  button.src="img/plus.gif";
  active=-1;
 } else {
  notes.style.display="";
  button.src="img/minus.gif";
  if (active!=-1) {
   document.getElementById("notes"+active).style.display="none";
   document.getElementById("b"+active).src="img/plus.gif";
  }
  active=id;
 } 
}
function trigger(id,checked,radio) {
 var i;
 var inputs;
 var row;
 if (radio) {
  inputs = document.getElementsByTagName("input");
  for (i = 0; i < inputs.length; i++) {
   row = document.getElementById("row"+i);
   if (row) row.className = 'd';
  }
 }
 row = document.getElementById("row"+id);
 if (checked)
  /* row.style.backgroundColor = "#ddf"; */
  row.className = "dsel";
 else
  /* row.style.backgroundColor = ""; */
  row.className = "d";
}
function restore() {
 var i;
 var inputs;
 
 document.getElementById("form").reset();
 
 inputs = document.getElementsByTagName("input"); 
 
 for (i = 0; i < inputs.length-4; i++)
   document.getElementById("row"+i).style.backgroundColor = "";
  
 for (i = 0; i < inputs.length; i++)
  if (inputs(i).checked)
   inputs(i).onclick();
} 
