// JavaScript Document



//Code that makes a script run on pageload

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(staffstartup);
//you can add more onload events right here using the above syntax


function staffstartup(){
	
		
	//Make the info boxes fade in and out
	var biotitles = document.getElementsByClassName("biotitle");
	for (x=0; x < biotitles.length; x++) 
	{
		bindslide(x,biotitles);
     }
	
	var bioclosers = document.getElementsByClassName("bioclose");
	for (x=0; x < bioclosers.length; x++) 
	{
		bindslideup(x,bioclosers);
     }
	
	
}


//Putting it in a separate function solves the closure problem
function bindslide(x,array){
	Event.observe(array[x], "click", function(){Effect.BlindDown('bio'+(x+1));$(array[x]).style.backgroundImage='url("images/grayarrow_down.jpg")';});
}

function bindslideup(x,array){
	Event.observe(array[x], "click", function(){Effect.BlindUp('bio'+(x+1));biotitles = document.getElementsByClassName("biotitle");$(biotitles[x]).style.backgroundImage='url("images/grayarrow.jpg")';});
}


//