Re-wrote Javascript for Activate/De-Activate