I suffer from panic attacks and in the last year have learnt to curb them.
I always found that when it happened to me, regardless of whether I was sitting watching the tv or walking down the high street, I always stood up and got away from where I was. Its not a bad thing to do this, just go with it. Your mind is trying to make you feel safer, so get out of the situation you are in. Fighting it sometimes made me panic more. Tell yourself that the way you are feeling is due to a panic attack. Remind yourself that the feeling will pass soon. I found that carrying a brown paper bag helped. You can use this to stop yourself from hyperventilating, but I very rarely had to use it, just the knowledge that I had it made me feel more in control. Breathe in through your nose, hold it for a few seconds and out through your mouth. I always found that this helped to relax my breathing. Explain to your friends that this happens to you and tell them to stay calm when you start to panic. Seeing someone else freak out whilst having a panic attack aint good.
But finally, see your doctor, explain the panic attacks to him/ her. Doc may refer you to a counciler or give you medication. This all helps. Good luck.