size = { 251, 120 }

----[=[
defineProperty("bg1", loadImage("menu1.png", 158, 359, 251, 60))
defineProperty("bg2", loadImage("menu1.png", 158, 493, 251, 60))
defineProperty("box", loadImage("menu1.png", 419, 357, 19, 19))
defineProperty("green", loadImage("menu1.png", 441, 354, 17, 22))
defineProperty("cross", loadImage("menu1.png", 441, 382, 15, 15))
defineProperty("scale", loadImage("menu1.png", 462, 354, 122, 10))
defineProperty("knob", loadImage("menu1.png", 464, 368, 9, 15))
defineProperty("opt_p", globalPropertyi("sim/custom/xap/opt_p"))

defineProperty("sound_vol", globalPropertyi("sim/custom/xap/sound_vol"))
defineProperty("sound_mute", globalPropertyi("sim/custom/xap/sound_mute"))
defineProperty("position_saving", globalPropertyi("sim/custom/xap/position_saving"))

font1 = loadFont('font_5.fnt')

	color1 = {0.4,0.4,0.4}
	color2 = {0.4,0.4,0.4}

	pos = {150}

	val = get(sound_vol)
	v = {}

	mouse_stat = true
	count = 0
function update()

pos[1] = get(sound_vol)*0.055 + 30


end


components = {

    textureLit {
        position = {0,60,251,60},
        image = get(bg1)

    },

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

    },

    textureLit {
        position = {200,75,19,19},
        image = get(box)

    },

    textureLit {
        position = {202,77,17,22},
        image = get(green),
		visible = function()
		return get(position_saving) == 1
		end,

    },

	    textureLit {
        position = {202,77,15,15},
        image = get(cross),
		visible = function()
		return get(position_saving) == 0
		end,
    },


    textureLit {
        position = {200,25,19,19},
        image = get(box)

    },

    textureLit {
        position = {202,27,17,22},
        image = get(green),
		visible = function()
		return get(sound_mute) == 1
		end,

    },

	    textureLit {
        position = {202,27,15,15},
        image = get(cross),
		visible = function()
		return get(sound_mute) == 0
		end,
    },


	    textureLit {
        position = {30,30,122,10},
        image = get(scale)

    },

		textureLit {
        position = function()
		return {pos[1],27,9,15}
		end,
        image = get(knob)

    },

	clickable {
       position = {200,25,19,19},
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(sound_mute) == 1 then
				set(sound_mute, 0)
			else
				set(sound_mute, 1)
			end
        end


    },

	clickable {
       position = {200,75,19,19},
       cursor = {
            x = 0,
            y = 0,
            width = 32,
            height = 16,
            shape = loadImage("clickable.png")
        },
        onMouseClick = function()
			if get(position_saving) == 1 then
				set(position_saving, 0)
			else
				set(position_saving, 1)
			end
        end,


    },



   lever{
       position = {30,27,129,17},
       value = {sound_vol},
       lever_img = get(knob),
       minimum = 0,
       maximum = 2200,
   },

 		-- 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(opt_p, 0)
		 end
	},

}
--]=]

function draw()

drawAll(components)

--if get(cam_type) == 0 then
drawText(font1, 30, 80, "SAVE POSITION",  color1[1],color1[2],color1[3])
drawText(font1, 30, 55, "CUSTOM SOUNDS VOL ",  color2[1],color2[2],color2[3])
drawText(font1, 160, 30, "MUTE",  color2[1],color2[2],color2[3])
--drawText(font1, 30, 126, "CABIN 1",  color3[1],color3[2],color3[3])
--drawText(font1, 30, 102, "CABIN 2",  color4[1],color4[2],color4[3])
--drawText(font1, 30, 78, "CABIN 3",  color5[1],color5[2],color5[3])
--drawText(font1, 30, 54, "LAVATORY",  color6[1],color6[2],color6[3])
--drawText(font1, 30, 30, "BAGAGE",  color7[1],color7[2],color7[3])

end
