I also write down the ideas I have, because crazy ideas are easily forgotten. I think they're generated by temporary surprise connections made by the brain.
I also find that certain locations are more likely to give me better ideas than others. I get good creative ideas staring out the window, taking naps, or taking a shower; definitely away from the computer.