function $(e) { return document.getElementById(e); }

document.getElementsByClassName = function(className) {
  var children = document.getElementsByTagName('*') || document.all;
  var elements = new Array();
  
  for (var i = 0; i < children.length; i++) {
    var child = children[i];
    var classNames = child.className.split(' ');
    for (var j = 0; j < classNames.length; j++) {
      if (classNames[j] == className) {
        elements.push(child);
        break;
      }
    }
  }
  
  return elements;
}

function rmvSiteName(e) {
	var startPoint = e.value.indexOf(' site:');
	
	e.value = e.value.substring(0,startPoint);
}

function showHideBio(d) {
	var div = $(d);
	var anchor = document.getElementsByClassName(d);

	// switch expander "icon" back and forth
	(anchor[0].firstChild.nodeValue == 'show bio') ? anchor[0].firstChild.nodeValue = 'hide bio' : anchor[0].firstChild.nodeValue = 'show bio';
	// show and hide selected div
	(div.style.display == '' || div.style.display == 'none') ? div.style.display = 'block' : div.style.display = 'none';
}