defineProperty("menu_type", globalPropertyi("cl300/menu_type"))
defineProperty("eicas_3d_p", globalPropertyi("cl300/eicas_3d_p"))
defineProperty("mfd_pan", globalPropertyi("cl300/mfd_pan"))
defineProperty("inst_p", globalPropertyi("cl300/inst_p"))
defineProperty("opt_p", globalPropertyi("cl300/opt_p"))


defineProperty("customslider1", globalPropertyi("cl300/customslider1"))
defineProperty("customslider1_r", globalPropertyf("cl300/customslider1_r"))

defineProperty("switch_1", globalPropertyi("sim/cockpit2/switches/custom_slider_on[11]"))  --
defineProperty("switch_2", globalPropertyi("cl300/post_effect"))  --
defineProperty("switch_4", globalPropertyi("sim/cockpit2/switches/custom_slider_on[4]"))  --
defineProperty("switch_17", globalPropertyi("sim/time/paused"))  --
defineProperty("view_type", globalPropertyi("sim/graphics/view/view_is_external"))

defineProperty("ext_pr_panel_s", globalPropertyi("cl300/ext_pr_panel_s"))
defineProperty("cam_panel_s", globalPropertyi("cl300/cam_panel_s"))
defineProperty("anim_panel_s", globalPropertyi("cl300/anim_panel_s"))
defineProperty("chkl_panel_s", globalPropertyi("cl300/chkl_panel_s"))

defineProperty("keyb_in_use", globalPropertyi("cl300/keyb_in_use"))






--defineProperty("panel_2")
defineProperty("panel_3")
defineProperty("panel_4")
defineProperty("panel_5")
defineProperty("panel_6")
defineProperty("panel_7")
defineProperty("panel_8")
defineProperty("panel_9")
defineProperty("panel_11")
defineProperty("panel_12")
--defineProperty("panel_20")
defineProperty("panel_21")
defineProperty("panel_22")
--local p2 = get(panel_2)
local p3 = get(panel_3)
local p4 = get(panel_4)
local p5 = get(panel_5)
local p6 = get(panel_6)
local p7 = get(panel_7)
local p8 = get(panel_8)
local p9 = get(panel_9)
local p11 = get(panel_11)
local p12 = get(panel_12)
--local p20 = get(panel_20)
local p21 = get(panel_21)
local p22 = get(panel_22)

-- logic of show/hide menu
function update()
if get(keyb_in_use) > 0 then set(p12.visible, true) else set(p12.visible, false) end
--p2 = get(panel_2)
p3 = get(panel_3)
p4 = get(panel_4)
p5 = get(panel_5)
p6 = get(panel_6)
p7 = get(panel_7)
p8 = get(panel_8)
p9 = get(panel_9)
p11 = get(panel_11)
--p20 = get(panel_20)
p21 = get(panel_21)
p22 = get(panel_22)
      -- show/hide switches menu
--[=[
      if get(switch_17) == 1 then
	  set(p2.visible, true)
      else
	  set(p2.visible, false)
      end --]=]

      --[=[if get(switch_1) == 1 then
	  set(p20.visible, true)
      else
	  set(p20.visible, false)
     end --]=]

	if get(customslider1_r) == 0 then
	  set(p22.visible, true)
    else
	 set(p22.visible, false)
    end

	if get(customslider1_r) == 0 then
	set(p21.visible, false)
	else
	set(p21.visible, true)
	end

	if get(cam_panel_s) == 1 then
	set(p3.visible, true)
	else
	set(p3.visible, false)
	end

	if get(ext_pr_panel_s) == 1 then
	set(p4.visible, true)
	else
	set(p4.visible, false)
	end

	if get(customslider1) == 0 then
	set(menu_type, 0)
	end

	if get(eicas_3d_p) == 1 then
	set(p5.visible, true)
	else
	set(p5.visible, false)
	end

	if get(anim_panel_s) == 1 then
	set(p6.visible, true)
	else
	set(p6.visible, false)
	end

	if get(chkl_panel_s) == 1 then
	set(p7.visible, true)
	else
	set(p7.visible, false)
	end

	if get(mfd_pan) == 1 then
	set(p8.visible, true)
	else
	set(p8.visible, false)
	end

	if get(inst_p) == 1 then
	set(p9.visible, true)
	else
	set(p9.visible, false)
	end
----[=[
	if get(opt_p) == 1 then
	set(p11.visible, true)
	else
	set(p11.visible, false)
	end --]=]

end
