your mind can play ALL kinds of tricks on your body. i'm not a doctor by any means, but i think your problem is psychological. it happened a few times, for whatever reason, and now your preoccupied with it. it's fucking with your mind (ie: performance anxiety). maybe try some liquid cialis from the cel store (great stuff from what i hear). that will get your confidence back up and soon you won't need it anymore (unless you have a special weekend planned and want to show off, porn star style).
just my 2 cents. . .