size = { 424, 222 }

defineProperty("bg", loadImage("menu1.png", 593, 343, 424, 222))
defineProperty("sw_l", loadImage("menu1.png", 479, 368, 38, 30))
defineProperty("sw_r", loadImage("menu1.png", 518, 368, 38, 30))

defineProperty("mfd_pan_cas", globalPropertyi("sim/custom/xap/mfd_pan_cas"))
defineProperty("mfd_pan", globalPropertyi("sim/custom/xap/mfd_pan"))
defineProperty("mfdpan_lr_sw", globalPropertyi("sim/custom/xap/mfdpan_lr_sw"))
defineProperty("mfd_sel_state_h", globalPropertyi("sim/custom/xap/mfd_sel_state_h"))

defineProperty("mfd_checkl_l", globalPropertyi("sim/custom/xap/mfd_checkl_l"))
defineProperty("mfd_hydr_l", globalPropertyi("sim/custom/xap/mfd_hydr_l"))
defineProperty("mfd_fuel_l", globalPropertyi("sim/custom/xap/mfd_fuel_l"))
defineProperty("mfd_flt_ctr_l", globalPropertyi("sim/custom/xap/mfd_flt_ctr_l"))
defineProperty("mfd_electr_l", globalPropertyi("sim/custom/xap/mfd_electr_l"))
defineProperty("mfd_ecs_l", globalPropertyi("sim/custom/xap/mfd_ecs_l"))
defineProperty("mfd_antice_l", globalPropertyi("sim/custom/xap/mfd_antice_l"))
defineProperty("mfd_frmt_l", globalPropertyi("sim/custom/xap/mfd_frmt_l"))
defineProperty("mfd_sumry_l", globalPropertyi("sim/custom/xap/mfd_sumry_l"))

defineProperty("mfd_checkl_r", globalPropertyi("sim/custom/xap/mfd_checkl_r"))
defineProperty("mfd_hydr_r", globalPropertyi("sim/custom/xap/mfd_hydr_r"))
defineProperty("mfd_fuel_r", globalPropertyi("sim/custom/xap/mfd_fuel_r"))
defineProperty("mfd_flt_ctr_r", globalPropertyi("sim/custom/xap/mfd_flt_ctr_r"))
defineProperty("mfd_electr_r", globalPropertyi("sim/custom/xap/mfd_electr_r"))
defineProperty("mfd_ecs_r", globalPropertyi("sim/custom/xap/mfd_ecs_r"))
defineProperty("mfd_antice_r", globalPropertyi("sim/custom/xap/mfd_antice_r"))
defineProperty("mfd_frmt_r", globalPropertyi("sim/custom/xap/mfd_frmt_r"))
defineProperty("mfd_sumry_r", globalPropertyi("sim/custom/xap/mfd_sumry_r"))
defineProperty("map_mode", globalPropertyi("sim/cockpit2/EFIS/map_mode"))
defineProperty("EFIS_tcas_on", globalPropertyi("sim/cockpit2/EFIS/EFIS_tcas_on"))
defineProperty("EFIS_weather_on", globalPropertyi("sim/cockpit2/EFIS/EFIS_weather_on"))




chklist_enter = findCommand("sim/custom/xap/chklist_enter")
chklist_skip = findCommand("sim/custom/xap/chklist_skip")
chklist_jleft = findCommand("sim/custom/xap/chklist_jleft")
chklist_jright = findCommand("sim/custom/xap/chklist_jright")


components = {

    textureLit {
        position = {0,0,424,222},
        image = get(bg)

    },


    textureLit {
        position = {195,190,33,26},
        image = get(sw_l),
		visible = function()
		return get(mfdpan_lr_sw) == 0
		end,
    },

    textureLit {
        position = {203,190,33,26},
        image = get(sw_r),
		visible = function()
		return get(mfdpan_lr_sw) == 1
		end,
    },

-- cas click
	clickable {
       position = {  70, 180, 60, 20  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(mfd_pan_cas) == 1 then
				set(mfd_pan_cas, 0)
			else
				set(mfd_pan_cas, 1)
			end
        end


    },

-- l/r click
	clickable {
       position = {  180, 190, 63, 30  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(mfdpan_lr_sw) == 1 then
				set(mfdpan_lr_sw, 0)
			else
				set(mfdpan_lr_sw, 1)
			end
        end


    },

-- cklst click
	clickable {
       position = {  40, 130, 40, 20  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(mfdpan_lr_sw) == 0 then
					set(mfd_checkl_l, 1)
			else
					set(mfd_checkl_r, 1)
			end
        end


    },

-- frmt click
	clickable {
       position = {  40, 70, 40, 25  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(mfdpan_lr_sw) == 0 then
				if get(mfd_frmt_l) < 6 then
					set(mfd_frmt_l, get(mfd_frmt_l) + 1)
				end
				if get(mfd_frmt_l) > 5 or get(mfd_frmt_l) == 0 then
					set(mfd_frmt_l, 1)
				end
			else
				if get(mfd_frmt_r) < 6 then
					set(mfd_frmt_r, get(mfd_frmt_r) + 1)
				end
				if get(mfd_frmt_r) > 5 or get(mfd_frmt_r) == 0 then
					set(mfd_frmt_r, 1)
				end
			end
		end

    },

-- antice click
	clickable {
       position = {  40, 20, 40, 25  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(mfdpan_lr_sw) == 0 then
					set(mfd_antice_l, 1)
			else
					set(mfd_antice_r, 1)
			end
        end


    },

-- tfc click
	clickable {
       position = {  100, 70, 40, 25  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(EFIS_tcas_on) == 0 then
					set(EFIS_tcas_on, 1)
			else
					set(EFIS_tcas_on, 0)
			end
        end


    },

-- tr/wx click
	clickable {
       position = {  160, 70, 40, 25  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(EFIS_weather_on) == 0 then
					set(EFIS_weather_on, 1)
			else
					set(EFIS_weather_on, 0)
			end
        end


    },



-- esc click
	clickable {
       position = {  100, 20, 40, 25  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(mfdpan_lr_sw) == 0 then
					set(mfd_ecs_l, 1)
			else
					set(mfd_ecs_r, 1)
			end
        end


    },

-- elec click
	clickable {
       position = {  160, 20, 40, 25  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(mfdpan_lr_sw) == 0 then
					set(mfd_electr_l, 1)
			else
					set(mfd_electr_r, 1)
			end
        end


    },

-- flt click
	clickable {
       position = {  220, 20, 40, 25  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(mfdpan_lr_sw) == 0 then
					set(mfd_flt_ctr_l, 1)
			else
					set(mfd_flt_ctr_r, 1)
			end
        end


    },

-- fuel click
	clickable {
       position = {  280, 20, 40, 25  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(mfdpan_lr_sw) == 0 then
					set(mfd_fuel_l, 1)
			else
					set(mfd_fuel_r, 1)
			end
        end


    },

-- hyd click
	clickable {
       position = {  340, 20, 40, 25  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(mfdpan_lr_sw) == 0 then
					set(mfd_hydr_l, 1)
			else
					set(mfd_hydr_r, 1)
			end
        end


    },

-- hyd click
	clickable {
       position = {  340, 70, 40, 25  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(mfdpan_lr_sw) == 0 then
					set(mfd_sumry_l, 1)
			else
					set(mfd_sumry_r, 1)
			end
        end


    },

-- enter click
	clickable {
       position = {  245, 70, 60, 25  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			commandOnce(chklist_enter)
        end


    },

 		-- close zone
		clickable {
		position = {size[1]-16, size[2]-16, 16, 16 },

		cursor = {
			x = -16,
			y = 0,
			width = 32,
			height = 16,
			shape = loadImage("clickclose.png")
		},
		 onMouseClick = function()
			set(mfd_pan, 0)
		 end
	},

-- skip click
	clickable {
       position = {  100, 130, 40, 20  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			commandOnce(chklist_skip)
        end


    },

-- right j click
	clickable {
       position = {  230, 135, 30, 30  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			commandOnce(chklist_jright)
        end


    },

-- left j click
	clickable {
       position = {  170, 135, 30, 30  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			commandOnce(chklist_jleft)
        end


    },

}--
