Sample of the JavaScript rotation script