refactored html creation to javascript functions to allow adding an onclick handler that is not an 'inline' execution based on security policy
added prod/nonprod toggles