using hook_init() instead of hook_preprocess() to get rid of duplicate JS code
