/** utilities.js: JavaScript utilities
  *
  * 
  */

/** Toggle DIVs function - turns the display of 
  * any particular DIV to 'block' or 'none'
  * depending on the current state of that DIV 
  * 
  * Use this in the following fashion:
  * <a onclick="tg('contentClip')">linkToClick</a> 
  *
  * <div id="contentClip">This is the div content that will appear 
  *   when the link is clicked.  It will disappear again when the 
  *   link is clicked again. 
  * </div>
  */ 
function tg(id){
	if (document.getElementById){
		if((document.getElementById(id).style.display == 'none')
		 || (document.getElementById(id).style.display == null)
		 || (document.getElementById(id).style.display == '')){
			document.getElementById(id).style.display = 'block';
		} else {
			document.getElementById(id).style.display = 'none';
		}
	} else if (document.all) {
		if (document.all[id].style.display == 'none') {
			document.all[id].style.display = 'block';
		} else {
			document.all[id].style.display = 'none';
		}
	}
}


/**
  * showOnlyOneID will set style.display on every ID in the array listOfIDs 
  * to 'none' and the single ID id to 'block'.
  *
  * This will be useful where multiple div's are showable and hideable.
  */

    var menuChoices = ["rfs", "rfa", "cf", "ne", "am", "ac"];
    var campusChoices = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "11", "12", 
	    "13", "14", "15", "16", "18", "19", "23", "GC"];
	  // There are no 10, 17, 20, 21, or 22. 
  

function showOnlyOneID(id, list) {

	var d = document.getElementById(id);
	for (var i in list) {
		if ( document.getElementById(list[i]) ) {
			document.getElementById(list[i]).style.display='none';
		}
	}
	if (d) {
		d.style.display='block';
	}

}  // end function showOnlyOneID 
