I think you need to be doing both. The closer you get to having a viable prototype the more you should know about if there will be a market for it. This will depend on your budget, time and experience.
If your product is something totally new, never heard of and outside of the box then you should get help from other people in the industry who understand the development and marketing process. You can probably go to a university close to you to get help from a couple of professors who teach in the areas related to your product. They can point you in the right direction for free or offer to pay for a lunch. Make sure to have them sign a non-disclosure!
But that should help you the most in your situation.
Hope this helps.
stevens5/12/2009 6:29 PM