aligned to server modification
merged with server modification of safety.js (based on Christopher mail of 2013/12/7)