var moving = false
var current_page = ''

$(document).ready(function () {
  // hide all ULs inside LI.drawer
  $('LI.drawer UL.paragraph').hide();
  $('LI.drawer UL.show').show(); 
  
  $('H2.drawer-handle').click(function () { 
  	
  	if(!moving){
  		moving = true
	    // hide the currently visible drawer contents
	    $('LI.drawer UL:visible').slideUp();
	    
	    // remove the open class from the currently open drawer
	    $('H2.open').removeClass('open');
	    $(this).addClass('open');
	    
	    // show the associated drawer content to 'this' (this is the current H2 element)
	    // since the drawer content is the next element after the clicked H2, we find
	    // it and show it using this:
	    if(current_page != this){
		    $(this).next().slideDown(function(){
		    	moving = false
		    	
		    });
	    }
	    else{
	    	moving = false
	    }
	 }
	 current_page = this
	 if($(this).children().attr("href") == "#"){
	 	 return false
		}
  });


	$('.bio').hide()
	$('.bio:first').show().addClass("selected_bio")
	
	$('.bio_link').click(function(){
		$('.selected_bio').slideUp()
		
		id = $(this).attr("id").split("_")[1]
		$('#bio_'+id).slideDown().addClass("selected_bio")
		
	})


});

