Here is a small tip for your W3C Widget on how you can identify when screen orientation have changed.
With jQuery you can add an event handler for the screen resize event. In the event you can easily check the window dimensions and with those you can define the screen orientation. This makes it easy to change the overall UI to match the landscape and portrait views. Like in some apps you may want to have your toolbar in left side in landscape view and on the bottom when on portrait view.
Here is the code how this can be done with jQuery:
You can download the whole widget here: Rotate.wgt
Here is a sample how widget works in action on Nokia N900: