There has been a lot done with this subject on this forum. Rather than repeat it, possibly leaving out some helpful information in the process, try doing a search for the old threads. I should assume "masking" will bring up the right threads.
I think you'll find more than you ever wanted to know on the subject, which includes several different approaches. Members have done some pretty neat things, including motorized masking.
When you do the search, go to the most recent (end of list). That's where the most of them appear.
Here's one of the more recent threads:http://www.avsforum.com/ubb/Forum9/HTML/001287.html