pretty solid jquery function for opening and closing div