defineProperty("switch_1", globalPropertyi("sim/cockpit2/switches/custom_slider_on[0]"))  -- show/hide main menu
defineProperty("switch_2", globalPropertyi("sim/custom/xap/post_effect"))  -- show/hide post effect
defineProperty("switch_17", globalPropertyi("sim/cockpit2/switches/custom_slider_on[1]"))  -- show/hide main menu
defineProperty("view_type", globalPropertyi("sim/graphics/view/view_is_external"))  -- show/hide main menu

defineProperty("panel_2")
defineProperty("panel_3")

-- logic of show/hide menu
function update()

      local p2 = get(panel_2)
      local p3 = get(panel_3)


      -- show/hide switches menu
      if get(switch_1) == 1 then set(p2.visible, true)   
      else set(p2.visible, false) 
      end 

      -- vinet screen
      if get(switch_2) == 1 and get(view_type) ~= 0 then set(p3.visible, true)   
      else set(p3.visible, false) 
      end 
end 
