I have an I-Phone 4. I want to set it up so that it detects motions, takes pics and uploads them to email. Do I have to buy an app to detect motion or does the I-phone already have this capability? I can write scripts and programs when I know the steps involved. Ideas? Where should I look? Surely someone has seen this done or has it on his i-phone.