re #750 - Added some Javascript magic