added javascript functions to support dynamic ui
changes are done to facilitate new dynamic ui implementation
Added and changed methods to implement new dynamic ui functionality. Working properly