Use goog.global instead of this or window.
Convert cumbersome conditionals into calls to goog.getObjectByName.
Fix onchange handler handler.