It sounds as though your dog is having anxiety attacks. My beagle has those same symptoms during rainy weather and thunder storms. My vet gave her Prozac to take everyday. This helps with the anxiety and calms her down. Try to see what is going on when your dog begins to pant and hide. Maybe your vet can offer the dog something for the anxiety.
My cocker spaniel did that one time after I gave her leftovers that was toxic for her. The food had chili powder in it and I spoke to a vet online and they told me just to make sure and give her lots of water. She got over it pretty quickly.