Changed the panel Javascript