--**********************
--  EHSD
--  AG MODE PAGE
--  JDAM Target DATA
--**********************

local map_scale = 0.5 * GetScale()

for i = 1, 4 do
	local	JDAM_Target_Point					= create_mpcd_textured_box( 190, 767, 205, 782)
			JDAM_Target_Point.name				= "JDAM_Target_Point" .. string.format("%02d", i)
			JDAM_Target_Point.init_pos			= {0, 0, 0}
			JDAM_Target_Point.controllers		= {{"JDAM_Mode", i - 1}, {"JDAM_Target_Pos", i - 1, map_scale}}
	Add_MPCD_VIDEO_Element(JDAM_Target_Point)
	
	local	JDAM_LARS_Max_BG					= CreateElement "ceSimpleLineObject"
			JDAM_LARS_Max_BG.name				= "JDAM_LARS_Max_BG_" .. string.format("%02d", i)
			JDAM_LARS_Max_BG.material   		= mpcd_ehsd_lines_bg
			JDAM_LARS_Max_BG.width      	 	= 0.007
			JDAM_LARS_Max_BG.init_pos			= {0, 0, 0}
			JDAM_LARS_Max_BG.parent_element		= "JDAM_Target_Point" .. string.format("%02d", i)
			JDAM_LARS_Max_BG.controllers		= {{"JDAM_LARS_Max", i - 1, map_scale}}
	Add_MPCD_VIDEO_Element(JDAM_LARS_Max_BG)
	
	local	JDAM_LARS_Max_FG					= CreateElement "ceSimpleLineObject"
			JDAM_LARS_Max_FG.name				= "JDAM_LARS_Max_FG_" .. string.format("%02d", i)
			JDAM_LARS_Max_FG.material   		= mpcd_ehsd_lines_fg
			JDAM_LARS_Max_FG.width       		= 0.005
			JDAM_LARS_Max_FG.init_pos			= {0, 0, 0}
			JDAM_LARS_Max_FG.parent_element		= "JDAM_Target_Point" .. string.format("%02d", i)
			JDAM_LARS_Max_FG.controllers		= {{"JDAM_LARS_Max", i - 1, map_scale}}
	Add_MPCD_VIDEO_Element(JDAM_LARS_Max_FG)
	
	local	JDAM_LARS_Min_BG					= CreateElement "ceSimpleLineObject"
			JDAM_LARS_Min_BG.name				= "JDAM_LARS_Min_BG_" .. string.format("%02d", i)
			JDAM_LARS_Min_BG.material   		= mpcd_ehsd_lines_bg
			JDAM_LARS_Min_BG.width      	 	= 0.007
			JDAM_LARS_Min_BG.init_pos			= {0, 0, 0}
			JDAM_LARS_Min_BG.parent_element		= "JDAM_Target_Point" .. string.format("%02d", i)
			JDAM_LARS_Min_BG.controllers		= {{"JDAM_LARS_Min", i - 1, map_scale}}
	Add_MPCD_VIDEO_Element(JDAM_LARS_Min_BG)
	
	local	JDAM_LARS_Min_FG					= CreateElement "ceSimpleLineObject"
			JDAM_LARS_Min_FG.name				= "JDAM_LARS_Min_FG" .. string.format("%02d", i)
			JDAM_LARS_Min_FG.material   		= mpcd_ehsd_lines_fg
			JDAM_LARS_Min_FG.width      	 	= 0.005
			JDAM_LARS_Min_FG.init_pos			= {0, 0, 0}
			JDAM_LARS_Min_FG.parent_element		= "JDAM_Target_Point" .. string.format("%02d", i)
			JDAM_LARS_Min_FG.controllers		= {{"JDAM_LARS_Min", i - 1, map_scale}}
	Add_MPCD_VIDEO_Element(JDAM_LARS_Min_FG)
	
	local	JDAM_Target_Number					= CreateElement "ceStringPoly"
			JDAM_Target_Number.name				= "JDAM_Target_Number" .. string.format("%02d", i)
			JDAM_Target_Number.material			= mpcd_tpod_font
			JDAM_Target_Number.init_pos			= { 0, -0.1, 0}
			JDAM_Target_Number.alignment		= "CenterCenter"
			JDAM_Target_Number.formats			= {"%d"}
			JDAM_Target_Number.stringdefs		= MPCD_large_font_size
			JDAM_Target_Number.parent_element	= "JDAM_Target_Point" .. string.format("%02d", i)
			JDAM_Target_Number.controllers		= {{"JDAM_Target_Index", i - 1}}
	Add_MPCD_VIDEO_Element(JDAM_Target_Number)
	
end