Sounds like you have a loose connection somewhere. This can be just about anywhere starting from the connection at the pole to the a splice somewhere within the house.
It could be at the top corner of your house where the power is attached to your service, it could be in the meter pan on the side of your house, it could also be in the circuit breaker panel. I highly recommend you getting an electrician to handle this project.
Chances are he'll find it right away and you'll only be charged for the first hour plus material if any