don't pollute the global namespace: define a controller.
missing semicolon, wrap your damn boolean logic tests in a backet you heathen