hey, i have a similar problem to you, in terms of the "self-esteem" thing where i normally joke around with friends and then suddenly i go into a depression and theres this little voice telling me im crap, not worth living etc. i had these mood swings (where id also lash out on friends, by putting them down for no particular reason) up until one day when i just realised i had to get a life in a sense and stop feeling sorry for myself. Sounds harsh, but since then i havent had such a bad depression spell, even though i still think im crappish (not as crap as before though lol).
Think about why you feel that way about your friend, do you like her and feel that you're jealous about that she is paying more attention to others and not you? is school bringing you down?
hope everything turns out ok in the end, if you want any help PM me xx