The above code works (although it does not look exactly how it looks in my final layout) BUT what it does not do run this:

$('.basic-info').css('border-left', '1px solid black');

after the first time a box is clicked (when it opens the

#expander

I realize the reason this is not working is that the JS code first adds the classes and styles, but then the next if statement removes the classes and styles. Also, I have to paste the following code two times: