More information about Device Motion and Device Orientation on HTML5 Rocks.
You may also want to try out the Device Orientation demo.