re-factored collapse_panel class to used prototype based method defintions