size = { 251, 60 }

defineProperty("bg1", loadImage("menu1.png", 158, 359, 251, 30))
defineProperty("bg2", loadImage("menu1.png", 158, 523, 251, 30))
defineProperty("closing", loadImage("closing.png", 16, 16))

defineProperty("eicas_3d_p", globalPropertyi("cl300/eicas_3d_p"))
defineProperty("chkl_panel_s", globalPropertyi("cl300/chkl_panel_s"))
defineProperty("mfd_pan", globalPropertyi("cl300/mfd_pan"))
defineProperty("slider11", globalPropertyf("sim/cockpit2/switches/custom_slider_on[11]"))
defineProperty("inst_p", globalPropertyi("cl300/inst_p"))

color1 = {0.1,0.2,0.4}
color2 = {0.4,0.4,0.4}
color3 = {0.6,0.6,0.6}
font1 = loadFont('font_7.fnt')


components = {

 --[[   textureLit {
        position = {0,30,251,30},
        image = get(bg1)

    },

    textureLit {
        position = {0,0,251,30},
        image = get(bg2)

    },--]]







--eicas
	clickable {
       position = {  23, 15, 40, 30  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(eicas_3d_p) == 1 then
				set(eicas_3d_p, 0)
			else
				set(eicas_3d_p, 1)
			end
        end


    },

	--chklst
	clickable {
       position = {  73, 15, 40, 30  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(chkl_panel_s) == 1 then
				set(chkl_panel_s, 0)
			else
				set(chkl_panel_s, 1)
			end
        end


    },

	--mfd
	clickable {
       position = {  128, 15, 50, 30  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(mfd_pan) == 1 then
				set(mfd_pan, 0)
			else
				set(mfd_pan, 1)
			end
        end


    },

	--fms
--[=[	clickable {
       position = {  198, 15, 30, 30  },
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(slider11) == 1 then
				set(slider11, 0)
			else
				set(slider11, 1)
			end
        end


    },--]=]

 		-- close zone
    textureLit {
        position = {size[1] - 27, size[2] - 32, 16, 16 },
        image = get(closing)

    },
		rectangle {
	position = { 10, 15, 230, 30 };
	color = { 0.0, 0.0, 0.0, 0.4 };
	visible = true,
    },
		clickable {
		position = {size[1]-27, size[2]-32, 16, 16 },

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


}

function draw()

drawAll(components)

drawText(font1, 23, 25, "EICAS",  color3[1],color3[2],color3[3])
drawText(font1, 73, 25, "CKLST",  color3[1],color3[2],color3[3])
drawText(font1, 128, 25, "MFDCTL",  color3[1],color3[2],color3[3])
--drawText(font1, 198, 25, "FMS",  color3[1],color3[2],color3[3])
	--set(disp, get(customslider1))


end
