Make Function Variable Global Javascript Function Definition Is Not Allowed