Added deactivate function
Added Javascript Functions