Create switchVisibility method

Create switchVisibility method, to show hide category layers when state = "category list" and categoryLayers already exist.