var currentDiv = 0 ;
var currentNode = 0 ;
var currentClass = 0 ;

function highlight(nodeId, divid) {
  if ( currentDiv ) {
    document.getElementById(currentDiv).className = currentClass ;
  }
  if ( currentNode ) {
    currentNode.className = "off" ;
  }
  nodeId.className = "selected" ;
  currentNode = nodeId ;
 
  var elt = document.getElementById(divid) ;

  elt.className = "highlighted" ;

  currentDiv = divid ;
  return true ;
}
function statuscell(id) {
  document.write(
	'<select id="s' + id + '">'
	+ '<option value="Not checked">Not checked</option>'
	+ '<option value="Guideline set aside">Guideline set aside</option>'
	+ '<option value="Action required">Action required</option>'
	+ '<option value="Review required">Review required</option>'
	+ '<option value="Not applicable">Not applicable</option>'
	+ '<option value="Guideline satisfied">Guideline satisfied</option>'
	+ '</select></td>'
  ) ;
}
function commentcell(id) {
  document.write( '<td><input id="c' + id + '" size="32">' ) ;
}
function guideline(n, msg, anchor) {
  var gl = 'gl'+n ;
  var url = "http://www.w3.org/TR/WCAG10/#" + anchor ;

  document.write(
	'<tr class="gl" id="' + gl + '"><td><a href="' + url + '" id="w' + gl
//	+ '" onclick="return showgl' + burl + ';">'
//	+ '" onclick="return false;">'
//	+ '" onclick="alert(' + msg + '); return false;">'
	+ '" target="help">' + n + ': '
	+ msg + '</a></td><td class="gl">'
  ) ;
  statuscell(gl) ;
  commentcell(gl) ;
  document.write("<td>&#160;</td></tr>\n") ;
}
