Changes to panels.js. Code should be more PEP 8 like.