function showImage(matchedImage){
	$('#'+matchedImage).show();
}

$(function(){
	
	$('a.lightbox').lightBox(); // Select all links with lightbox class
	
	$('a.menu-item[href="'+location.pathname+'"]').addClass('active')
	
	$('img.image_thumb').hover(function(){
		theMatch = $(this).attr('match');
		if ($('#'+theMatch).is(":hidden")){
			$('.bio:visible').hide('fast',showImage(theMatch));
		}
	});
	
	$('.button').hover(function(){
		theMatch = $(this).attr('match');
		if ($('#'+theMatch).is(":hidden")){
			$('.bio:visible').hide('fast',showImage(theMatch));
		}
	});

	$('td.bio-button').click(function(){
		theMatch = $(this).attr('match');
		if ($('#'+theMatch).is(":hidden")){
			$('.bio:visible').hide('fast',showImage(theMatch));
		}
	});
});

// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
	// 
	// function hideAllBios(){
	// 	$(".bio").hide();
	// 	// 	    var bioDivs = $$("div.bio");
	// 	// var biop = $$("p.bio");
	// 	// bioDivs.each(function(item) {  //for each element of the array, hide them
	// 	// 	item.hide();  
	// 	// });
	// 	// biop.each(function(item) {  //for each element of the array, hide them
	// 	// 	item.hide();  
	// 	// });
	// };
	
// Event.observe(window, 'load', function() {
//     var nameDivs = $$(".button");
// 	nameDivs.each(function(item){
//    		$(item).observe('mouseover',
// 			function(event){
// 				hideAllBios();
// 				var element = $(Event.element(event));
// 				var id = element.id.substring(0,element.id.length-1);
// 		  		var idt = document.getElementById(id);
//   				idt.show();
// 			}//end function(event)
// 		); //end item.observe
//    	});//end nameDivs.each
// 
//     var bioDivs = $$("td.bio-button");
// 	bioDivs.each(function(item){
//    		$(item).observe('click',
// 			function(event){
// 				hideAllBios();
// 				var element = $(Event.element(event));
// 				var id = element.id.substring(0,element.id.length-1);
// 		  		var idt = document.getElementById(id);
//   				idt.show();
// 			}//end function(event)
// 		); //end item.observe
//    	});//end nameDivs.each
// 
//    	
// }); //end Event.observe(window,..)

