converting control panel to javascript ( to improve UI experience )