My laptop has a built in webcam feature that motion detects as well, pretty sure there is a regular webcam out there that does the same. It doesnt start recording until there is movement then records it until it stops. Apparently it even has a feature that will send an email alert when motion is detected.
google is your friend.
How to use your PC and Webcam as a motion-detecting and recording security camera - Simplehelp
But yeah most webcams do have such a feature.