Recognizing Orientation

In my app I check for a change from portrait to landscape or vice-versa with _orientationchange(). After the change is triggered I check whether it has changed to portrait or landscape mode by checking if SysInfo(2) is greater than SysInfo(3). This only works, however, when the device (iPhone 6) is rotated counter-clockwise. (If the device is rotated clockwise, _orientationchange() is triggered, but SysInfo(2) and SysInfo(3) don’t change). Is there a better way of checking what my current orientation is?

Never mind, I just found window.orientation in the documentation