add js to switch panel