former panel control js code.