Q:

What types of kayaks are suitable for occasional class 1 and 2 rapids

According to the scale on this Wikipedia page (the International Scale of River Difficulty), what are the types of kayaks in the following list that are suitable to occasionally handle class 1 and 2 rapids ?

whitewater
sea
recreational
sit on top

By occasionally I mean, no more than 20% of the time spent kayaking. 

A:

I understand your goal in asking this question, but I think you're approaching it wrong: you should choose a kayak based on your skill and expected use. Each type of kayak will have benefits and drawbacks in each type of water, and some are completely unsuited for it -- choose one that fits your uses best. A well-known example: a recreational kayak is the wrong choice for kayaking on the ocean.
Class 1 and 2 rapids are fantastic. I think it's probably fair to say that anybody with no skill and the right boat can make it through class 1 rapids with no concern. I think class 2 rapids should probably be handled by somebody with at least a little experience on the water, and the less experienced should always be accompanied by somebody more experienced.
So, I am confident that you could do some class 1 rapids with any of those types of kayaks. For class two rapids, I would first be concerned with your skill level -- both on the water in general, and with the type of kayak being used (and maybe even the specific model). While class two rapids may not require much maneuvering, spinning a 20' sea/touring kayak is going to be practically impossible and therefore impractical; a 14-16' sea kayak is probably manageable for any experienced paddler. A whitewater or completely flat-bottomed rec kayak provide the maneuverability required, however a less experienced paddler will find themselves spinning with each stroke and out of control -- and therefore perhaps in a dangerous situation.
In my opinion, the right choice for a new paddler is a rec kayak. They're fun, easy to use, and relatively cheap to buy/rent. Getting some experience with an eye towards determining what you ultimately want to do will help you make an informed decision. Rent a few times and take a lesson or two and you'll have gained a huge amount of experience to help you know what kind of kayak you really want and will lead you to the best choice.
Experience is king. An experienced paddler will be able to take anything through class 1 or 2 rapids, no doubt. An inexperienced paddler could end up in a dangerous situation. I think it's essential to start out on calm flat water to learn strokes, practice technique, and gain some confidence. On that flat water you can learn to maneuver the kayak around strainers, rocks, or buoys. You can learn how a sweep differs from a front stroke, and what you can make the kayak do with each of those. Also on flat water, try working in windy conditions -- it'll do a surprisingly good job of mimicking how a river and rapids can push your boat around and teach you how to handle it. Once confident, go out on a slow river to put your skills to the test. Eventually move up to some faster moving water, and throw in a class 1 rapid. Try a short class 2 next. Then if you can find it, go through a long class 2 -- you'll get splashed quite a bit and get a solid workout. After working through class 2 you might want to step up to class 3.
While gaining all of this experience you're going to learn how a kayak handles and what it does well and poorly, and more importantly you're going to see how your skill grows with it. As you do this stuff you'll be able to recognize where each type of boat is the right choice.
Trying to more directly answer your question: IMO, a whitewater kayak is only useful for whitewater/surfing waves. A sit on top is good for jumping in and out of the water. A rec kayak is a good choice for many. A short touring/sea kayak is a good choice for many. A long touring/sea kayak is the right choice for racers and travelers.

A:

I think your answer makes sense, but I would caution boaters who use recreational kayaks on class 2 rivers because I've need to rescue recreational kayakers attempting this.
Recreational kayaks are usually fine for class 1 rivers and for easy class 2 rivers.  I wouldn't recommend one for long class 2 rapids, and not for a class 2+ rapid (and many class 2 rivers contain class 2+ when the water gets higher from a some rain or snowmelt).
And please wear a PFD (life jacket).  Most of those I've had to rescue in recreational kayaks have no PFD.  I think you should have a helmet anywhere there are rocks, as well.
You need to absolutely step up to a whitewater craft of some sort when you hit class 3.
You'll find that whitewater kayaks will spin more on flatwater when you first start with one, and that after you learn to keep them going straight, that they will be slower and require more work to cover the same distance on flatwater.

A:

There's a specific class of boat designed to do exactly what you want - "crossover" kayaks. 
Here's some examples:

In general they..

are much longer than a whitewater boat but are still short enough to be usable on a river
are very stable and forgiving
have proper whitewater outfitting (means they can be controlled properly)
have hatches for storage
often have skegs 

All the major manufacturers have their own models, often a range. 
There are different designs, some are a bit more focused on whitewater, some a bit more on sea, touring etc.
As another poster said, skills are the most important thing. Going from flat to moving water isn't hard, but there's very important differences in safety, rescue, and skills. It's not about the boat - a paddler with the right ability will  paddle a river more safely in an inflatable rubber duck than someone else in the right boat. If you have a club nearby, join up. 

