This is being reported on several news site, some of which can't really get straight if it was a passenger or a crew member that had the panic attack, but basing it off (what I would say is one of the more creditable sources online) AVHerald.com is reporting it was a captain.
Incident: Jetblue A320 near Amarillo on Mar 27th 2012, captain incapacitated by panic attack
...the captain suffered a panic attack and behaved entirely incoherent forcing the first officer to seek assistance by cabin crew and passengers to overpower the captain, lock him out of the cockpit and have him restrained in the passenger cabin. ... The airline confirmed the flight diverted because of a medical condition with the captain. Another captain travelling as passenger on the flight joined the first officer in the cockpit. The ill captain was taken to a local hospital. ...
I wish the best for this captain, and hopes he has a successful recovery. I do bet it was bit scary for the passengers for a bit up there.