<!-- dropdown.js -->
<!-- Copyright 2009 Mike Oliver, moliver at acm.org.  All Rights Reserved. -->

function highlight(elem) { elem.style.color = "#ffcc00"; }
function lowlight(elem) { elem.style.color = "#aaaaaa"; }
function clicked(elem) { lowlight(elem); elem.blur(); allInvis(); return true; }

function _getDivs(cName) { arr = new Array(); divs = document.getElementsByTagName("div"); for (ix = 0 ; ix < divs.length ; ++ix) { div = divs[ix]; if (div.className == cName) { arr.push(div); } } return arr; }

var _DropCaptions = null;
function getDropCaptions() { if (_DropCaptions == null) { _DropCaptions = _getDivs("dropcaption"); } return _DropCaptions; }

var _DropDowns = null;
function getDropDowns() {  if (_DropDowns == null) { _DropDowns = _getDivs("dropdown"); } return _DropDowns; }

function _elemsInvis(arr) { if (arr) { for (ix = 0 ; ix < arr.length ; ++ix) { arr[ix].style.display = "none"; } } }
function allInvis() { _elemsInvis(getDropDowns()); _elemsInvis(getDropCaptions()); }
function makeVis(elemName) { allInvis(); if (elemName) { elem = document.getElementById(elemName); elem.style.display = "inline"; } }
function makeInvis(elemName) { elem = document.getElementById(elemName); elem.style.display = "none"; }

<!-- end dropdown.js -->

