  function rollIn() {
   if (x < height) {
	  d.style.height = x + 'px';
	  x = x * 1.5;
	  setTimeout("rollIn()",0);
	}
	else {
	  d.style.height = height + 'px'
	  dt.style.display = "block";
	}
  }
  
  function rollOut() {
	   if (x > 1) {
		  d.style.height = x + 'px';
		  x = x / 1.2;
		  setTimeout("rollOut()",0);
		}
		else {
		  d.style.height = '0px';
		}
  }
  

  function toggleDepartments() {
    if (searchOn) {
	  toggleSearch();
	  setTimeout("toggleDepartments()", 400);
	}
    d = document.getElementById("expander");
	dt = document.getElementById("depttable");
	if (d.style.height == '0px' | d.style.height == 0 ) {
      x = 1.01;
	  height = 460;
	  rollIn();
	  departmentsOn = true;
	} else if (d.style.height == '460px') {
	  dt.style.display = "none";
	  x = 460;
	  rollOut()
	  departmentsOn = false;
	}
  }

  function toggleSearch() {
    if (departmentsOn) {
	  toggleDepartments();
	  setTimeout("toggleSearch()", 650);
	}
    d = document.getElementById("expander");
	dt = document.getElementById("search");
	if (d.style.height == '0px' | d.style.height == 0) {
      x = 1.01;
	  height = 40;
	  rollIn();
	  searchOn = true;
	} else if (d.style.height == '40px') {
	  dt.style.display = "none";
	  x = 40;
	  rollOut()
	  searchOn = false;
	}
  }
  
  searchOn = false;
  departmentsOn = false;
