iFrame fixes

Few JavaScript changes to allow the Dynamix UI to be run inside an
iFrame without error.
Problems mainly occurred with disabling an enabling control (when a
dialog shows) which would try to access the parent when it should access
itself. Other issues include using 'top' instead of 'parent.frames'
which would access the host frame throwing security exceptions.