Well Harry different states have different primary structures. The primaries, as I'm sure you've heard, are how the parties pick their candidates to run against the opposition. You don't have to register as either party to vote in the general elections for president and congress. For the primaries it comes down to how the individual states handle the matter. For instance, I live in a state with an open primary so I registered as a independent. That means that come Feb 5th I can walk up to my polling location and cast my votes in any particular parties primaries whether it be Democrat, Republican, Reform, Libertarian, Communist, Nazi, etc. (We do have those parties on the ballot in my state. You just don't hear about them because they don't have a chance in hell of winning.

)
I can't switch off though. I have to only vote for candidates in one particular party. The choice of party is up to me when I arrive. Open primaries have been criticized because some people believe that a process called "raiding" can go on. They suspect that people sometimes sign up as independent so they can vote in the oppositions primary and vote for the candidate least likely to win. No one has ever proved that this goes on, but I've heard some say that it is one of the reasons for the Democrats stranglehold on Louisiana.
At the state level there are some good reason why you might not want to vote for your particular parties primary. I live in Arkansas which is one of the few southern states that still votes almost entirely Democrat for our state government. I know that many Republicans in my state vote for the Democratic primaries because they know that none of the Republican candidates are likely to win. Thus whoever wins the Democratic primary will probably be the winner.