jQuery(function($){
	// speaker page logic
    $providers = $("#providers");
    if($providers.length){
        $providers.find("div.write-up").each(function(i, item){
            (function(){
                $item = $(item);
                $item.find("div.bio").hide();
                                
                $toggleBtn = $item.find("a.toggle-bio-btn");
                $toggleBtn.click(function(event){
                    $this = $(event.target);
                    $item = $(item);
                    $bio = $item.find("div.bio");
                    
                    if ($bio.is(":hidden")) {
                        $this.html("close");
                        $this.addClass("close");
                        if($this.hasClass("expand"))
                            $this.removeClass("expand");
                    }else{ 
                        $this.html("expand");
                        $this.addClass("expand");
                        if($this.hasClass("close"))
                            $this.removeClass("close");
                    }
                    $bio.slideToggle("fast");
                
                    return false;
                });
            })();
        })
    }
});
