/* *******************************************************************************
	Scenario object definition
The displayed property is used to display or hide concerned section

All other properties are arrays with 4 pairs of key/value : 
- value : The propertie value
- control : The document input area in which is displayed the value
- info : The info text about this properties (displayed when control has focus)
- text : The document input area title

Each subsection (weather, teams, bases, victories, missions, units and targets) 
has its own properties array.
*********************************************************************************/


/***********************************************************************************
* 	Scenario object definition and initialization
***********************************************************************************/

// scenario section

scenario=new Object();

// The scenario map image file
scenario.map=new Image();

scenario.properties=new Array();

scenario.properties["name"]=new Array();
scenario.properties["name"]["value"]="My scenario";
scenario.properties["name"]["control"]="scen_name";
scenario.properties["name"]["info"]="Name of the scenario as it will appear on the server list and in the User Interface.";
scenario.properties["name"]["text"]="Scenario name :";

scenario.properties["terrain"]=new Array();
scenario.properties["terrain"]["value"]="";
scenario.properties["terrain"]["control"]="scen_terrain";
scenario.properties["terrain"]["info"]="Terrain filename and path.  For most Target Korea scenarios, the terrain /tk/terrain/terrain_v11/korea.ter.  For other Target Projects, the terrain will be in the /terrain/ folder within each project folder, e.g., Target Rabaul terrain will be in /tr/terrain/";
scenario.properties["terrain"]["text"]="Terrain file name (full path) :";

scenario.properties["splash"]=new Array();
scenario.properties["splash"]["value"]="";
scenario.properties["splash"]["control"]="scen_splash";
scenario.properties["splash"]["info"]="Filename and path of a graphics file (JPG or TGA) that will be displayed over the entire screen during the scenario load process. Should be 128x128, 256x256, 512x512, or 1024x1024. Optional";
scenario.properties["splash"]["text"]="Splash image file name (full path) :";

scenario.properties["info"]=new Array();
scenario.properties["info"]["value"]="";
scenario.properties["info"]["control"]="scen_info";
scenario.properties["info"]["info"]="Filename and path of a text file that describes the scenario. This information will be displayed when a player chooses a scenario for offline play, and also online, when players select &#039;Scenario Briefing&#039; from the menu. Optional";
scenario.properties["info"]["text"]="Info file name (full path) :";

scenario.properties["image"]=new Array();
scenario.properties["image"]["value"]="";
scenario.properties["image"]["control"]="scen_image";
scenario.properties["image"]["info"]="Filename and path of a graphics file (JPG or TGA) that you want displayed in a window on the screen when the player selects Scenario Briefing from the In-Game menu, then &#039;Visual Briefing&#039;. Often a map of the scenario area. Should be 64x64, 128x128, 256x256, or 512x512. Optional";
scenario.properties["image"]["text"]="Image file name (full path) :";

scenario.properties["num_teams"]=new Array();
scenario.properties["num_teams"]["value"]=1;
scenario.properties["num_teams"]["control"]="scen_num_teams";
scenario.properties["num_teams"]["info"]="The number of teams that will participate in the scenario.";
scenario.properties["num_teams"]["text"]="Number of teams :";

scenario.properties["viewpoint"]=new Array();
scenario.properties["viewpoint"]["value"]="0,0,0";
scenario.properties["viewpoint"]["control"]="scen_viewpoint";
scenario.properties["viewpoint"]["info"]="Positions the view when the scenario loads for those who haven&#039;t picked a team.  Basically, this is what people see when the scenario first loads.";
scenario.properties["viewpoint"]["text"]="View point (X,Y,Z in km):";

scenario.properties["heading"]=new Array();
scenario.properties["heading"]["value"]=0;
scenario.properties["heading"]["control"]="scen_heading";
scenario.properties["heading"]["info"]="This is the direction the player will be looking when using the viewpoint";
scenario.properties["heading"]["text"]="Heading (degrees) :";

scenario.properties["time"]=new Array();
scenario.properties["time"]["value"]="1200";
scenario.properties["time"]["control"]="scen_time";
scenario.properties["time"]["info"]="Determines the time of day. Time is given in 24 hour style (hhmm): &#039;0830&#039; = 8:30 AM, &#039;1830&#039; = 6:30 PM. This setting greatly affects lighting conditions, so use it with care. Defaults to 12 noon.";
scenario.properties["time"]["text"]="Time (hhmm) :";

scenario.properties["time_var"]=new Array();
scenario.properties["time_var"]["value"]="0000";
scenario.properties["time_var"]["control"]="scen_time_var";
scenario.properties["time_var"]["info"]="Allows for variation on the time of day specified above. The number is in the same &#039;hhmm&#039; format: &#039;0130&#039;= 1 hour, 30 minutes; &#039;1200&#039; = 12 hours. For example, if the time of day was set at 1200 (noon), and time_var was set to &#039;0300&#039;, each time the scenario ran, the game engine would assign it a time between 9:00 AM and 3:00 PM. Defaults to 0 (no time variation).";
scenario.properties["time_var"]["text"]="Time variation (hhmm) :";

scenario.properties["time_limit"]=new Array();
scenario.properties["time_limit"]["value"]="0";
scenario.properties["time_limit"]["control"]="scen_time_limit";
scenario.properties["time_limit"]["info"]="Duration of the scenario. Can also be 0 to have no time limit.";
scenario.properties["time_limit"]["text"]="Time limit (minutes) :";

scenario.properties["victory_points"]=new Array();
scenario.properties["victory_points"]["value"]=0
scenario.properties["victory_points"]["control"]="scen_victory_points";
scenario.properties["victory_points"]["info"]="If a team reaches this number of victory points they win and the scenario is over. This can also be 0, meaning victory point totals are still used to determine the winner, but there is no &#039;hard limit&#039; at which one side wins immediately.";
scenario.properties["victory_points"]["text"]="Victory points :";

scenario.properties["minimum_vp"]=new Array();
scenario.properties["minimum_vp"]["value"]=0;
scenario.properties["minimum_vp"]["control"]="scen_minimum_vp";
scenario.properties["minimum_vp"]["info"]="If a timed scenario, the minimum number of Victory Points that one side must score before the scenario will come to an end. Example: In a scenario with victory_points = 0, time_limit = 30, and minimum_vp = 500, the scenario will not end once 30 minutes have gone by, unless at least one of the teams has amassed 500 victory points; it will continue until one side reaches 500 points.";
scenario.properties["minimum_vp"]["text"]="Minimum victory points :";

// Weather section
scenario.weather=new Object();
scenario.weather.properties=new Array();

scenario.weather.properties["min_cloud_layers"]=new Array();
scenario.weather.properties["min_cloud_layers"]["value"]=0;
scenario.weather.properties["min_cloud_layers"]["control"]="weather_min_cloud_layers";
scenario.weather.properties["min_cloud_layers"]["info"]="Minimum number of cloud layers.";
scenario.weather.properties["min_cloud_layers"]["text"]="Min. number of cloud layers :";

scenario.weather.properties["max_cloud_layers"]=new Array();
scenario.weather.properties["max_cloud_layers"]["value"]=0;
scenario.weather.properties["max_cloud_layers"]["control"]="weather_max_cloud_layers";
scenario.weather.properties["max_cloud_layers"]["info"]="Maximum number of cloud layers.";
scenario.weather.properties["max_cloud_layers"]["text"]="Max. number of cloud layers :";

scenario.weather.properties["min_alt"]=new Array();
scenario.weather.properties["min_alt"]["value"]=0;
scenario.weather.properties["min_alt"]["control"]="weather_min_alt";
scenario.weather.properties["min_alt"]["info"]="Minimum cloud layer altitude.";
scenario.weather.properties["min_alt"]["text"]="Min. cloud layer altitude :";

scenario.weather.properties["max_alt"]=new Array();
scenario.weather.properties["max_alt"]["value"]=0;
scenario.weather.properties["max_alt"]["control"]="weather_max_alt";
scenario.weather.properties["max_alt"]["info"]="Maximum cloud layer altitude.";
scenario.weather.properties["max_alt"]["text"]="Max. cloud layer altitude :";

scenario.weather.properties["cover"]=new Array();
scenario.weather.properties["cover"]["value"]=0;
scenario.weather.properties["cover"]["control"]="weather_cover";
scenario.weather.properties["cover"]["info"]="A rough percentage of cloud cover to be used as a base, 0 = 0%, 1 = 100%.";
scenario.weather.properties["cover"]["text"]="Base cloud cover (1=100%)";

scenario.weather.properties["texture"]=new Array();
scenario.weather.properties["texture"]["value"]="";
scenario.weather.properties["texture"]["control"]="weather_texture";
scenario.weather.properties["texture"]["info"]="If this line is left out, or left blank, clouds will be drawn with a generic white color. Specifying a texture here allows you to closer approximate the appearance of actual cloud types.";
scenario.weather.properties["texture"]["text"]="Weather texture (full path) :";

scenario.weather.properties["detail"]=new Array();
scenario.weather.properties["detail"]["value"]="";
scenario.weather.properties["detail"]["control"]="weather_detail";
scenario.weather.properties["detail"]["info"]="File name and filepath for a texture file that will be placed on the main cloud texture as a detail texture.";
scenario.weather.properties["detail"]["text"]="Detail weather texture (full path) :";

scenario.weather.properties["detail_scale"]=new Array();
scenario.weather.properties["detail_scale"]["value"]=1;
scenario.weather.properties["detail_scale"]["control"]="weather_detail_scale";
scenario.weather.properties["detail_scale"]["info"]="The number of times you want the detail texture to repeat on a single square patch of cloud texture.";
scenario.weather.properties["detail_scale"]["text"]="Detail scale :";

scenario.weather.properties["temperature"]=new Array();
scenario.weather.properties["temperature"]["value"]=15.00;
scenario.weather.properties["temperature"]["control"]="weather_temperature";
scenario.weather.properties["temperature"]["info"]="Temperature at Sea Level for this scenario. Default SL temperature is 15.04 deg Celsius.";
scenario.weather.properties["temperature"]["text"]="Temperature in °C :";

scenario.weather.properties["pressure"]=new Array();
scenario.weather.properties["pressure"]["value"]=101.325;
scenario.weather.properties["pressure"]["control"]="weather_pressure";
scenario.weather.properties["pressure"]["info"]="The air pressure at Sea Level for this scenario. The kPa for a &#039;standard day&#039; (the conditions under which aircraft performance are always evaluated) is 101.325 kPa.";
scenario.weather.properties["pressure"]["text"]="Pressure in kPa :";


scenario.teams=new Array();
create_teams();

// create a single team with missions, targets, bases, victories, units....
function create_team(team){
	scenario.teams[team]=new Object();
	scenario.teams[team].properties=new Array();

	scenario.teams[team].properties["name"]=new Array();
	scenario.teams[team].properties["name"]["value"]="Team "+(team+1);
	scenario.teams[team].properties["name"]["control"]="team_"+team+"_name";
	scenario.teams[team].properties["name"]["info"]="Name of the Team as it will appear in the UI.";
	scenario.teams[team].properties["name"]["text"]="Team name :";

	scenario.teams[team].properties["info"]=new Array();
	scenario.teams[team].properties["info"]["value"]="";
	scenario.teams[team].properties["info"]["control"]="team_"+team+"_info";
	scenario.teams[team].properties["info"]["info"]="Filename and path of a text file that provides a general briefing for the team&#039;s activity in the current scenario. This information will be displayed when a player selects &#039;Team Briefing&#039; from the menu. Optional";
	scenario.teams[team].properties["info"]["text"]="Team info file name :";

	scenario.teams[team].properties["image"]=new Array();
	scenario.teams[team].properties["image"]["value"]="";
	scenario.teams[team].properties["image"]["control"]="team_"+team+"_image";
	scenario.teams[team].properties["image"]["info"]="Filename and path of a graphics file (JPG or TGA) that you want displayed in a window on the screen when the player selects Team Briefing from the In-Game menu, then &#039;Visual Briefing&#039;. Could be a map showing the location of the team&#039;s missions in the scenario, etc. Should be 64x64, 128x128, 256x256, or 512x512. Optional";
	scenario.teams[team].properties["image"]["text"]="Image file name :";

	scenario.teams[team].properties["viewpoint"]=new Array();
	scenario.teams[team].properties["viewpoint"]["value"]="0,0,0";
	scenario.teams[team].properties["viewpoint"]["control"]="team_"+team+"_viewpoint";
	scenario.teams[team].properties["viewpoint"]["info"]="Positions the view when the team is selected. Basically, this is what people see when they pick up the team.";
	scenario.teams[team].properties["viewpoint"]["text"]="View point (X,Y,Z in km) :";

	scenario.teams[team].properties["heading"]=new Array();
	scenario.teams[team].properties["heading"]["value"]=0;
	scenario.teams[team].properties["heading"]["control"]="team_"+team+"_heading";
	scenario.teams[team].properties["heading"]["info"]="This is the direction the player will be looking when using the viewpoint";
	scenario.teams[team].properties["heading"]["text"]="Heading :";

	scenario.teams[team].properties["players"]=new Array();
	scenario.teams[team].properties["players"]["value"]=1;
	scenario.teams[team].properties["players"]["control"]="team_"+team+"_players";
	scenario.teams[team].properties["players"]["info"]="The percentage of players currently online who are allowed to join this team.  0 = 0%, 1 = 100%.  Note that the players percentages for all the teams do not have to add up to 1.0  Example: 0.6 means a maximum of 60% of the people currently online can be on this team.";
	scenario.teams[team].properties["players"]["text"]="Allowed players (%) :";

	scenario.teams[team].properties["shared_kill"]=new Array();
	scenario.teams[team].properties["shared_kill"]["value"]=0;
	scenario.teams[team].properties["shared_kill"]["control"]="team_"+team+"_shared_kill";
	scenario.teams[team].properties["shared_kill"]["info"]="Value must be 0 or 1 or 2. See Maximum shared kill for further details.";
	scenario.teams[team].properties["shared_kill"]["text"]="Shared kill (0 / 1 / 2) :";

	scenario.teams[team].properties["max_shared"]=new Array();
	scenario.teams[team].properties["max_shared"]["value"]=2;
	scenario.teams[team].properties["max_shared"]["control"]="team_"+team+"_max_shared";
	scenario.teams[team].properties["max_shared"]["info"]="This determines how shared kills and assists are scored. If 0, a kill credit is given to the damage leader, no one else receives any credit. If 1, kill credit to damage leader, up to (max_shared-1) assists given to other contributors. If 2, the kill credit is divided amongst up to max_shared people. So if shared_kill is 2 and max_shared is 3, and 3 people score hits, each would receive 1/3 of a kill credit. If shared_kill is 1, and max_shared is 3, then the person who causes the most damage would get a kill credit, and the next 2 contributors would each get an assist credit. shared_kill defaults to 0, max_shared defaults to 3.";
	scenario.teams[team].properties["max_shared"]["text"]="Max. shared kill :";

	scenario.teams[team].properties["initial_vp"]=new Array();
	scenario.teams[team].properties["initial_vp"]["value"]=0;
	scenario.teams[team].properties["initial_vp"]["control"]="team_"+team+"_initial_vp";
	scenario.teams[team].properties["initial_vp"]["info"]="Starting victory points. Because some scenarios are the triggered by the consequence of previous ones (See [Team Victory] section, next_scenario setting), it is possible to accumulate victory points over the course of multiple scenarios. This setting can also be used to give one team a &#039;head start&#039;, perhaps when facing an overwhelming";
	scenario.teams[team].properties["initial_vp"]["text"]="Initial victory points :";

	scenario.teams[team].properties["num_victory"]=new Array();
	scenario.teams[team].properties["num_victory"]["value"]=1;
	scenario.teams[team].properties["num_victory"]["control"]="team_"+team+"_num_victory";
	scenario.teams[team].properties["num_victory"]["info"]="The number of different victory levels defined for this team.";
	scenario.teams[team].properties["num_victory"]["text"]="Number of victories :";

	scenario.teams[team].properties["num_bases"]=new Array();
	scenario.teams[team].properties["num_bases"]["value"]=1;
	scenario.teams[team].properties["num_bases"]["control"]="team_"+team+"_num_bases";
	scenario.teams[team].properties["num_bases"]["info"]="The number of landing areas available to this team in this scenario. Each one must be defined with a [Team x Base y] section. Players from this team who land within the confines of one of the defined friendly bases will be counted as having landed safely, with no points being awarded to the enemy.";
	scenario.teams[team].properties["num_bases"]["text"]="Number of bases :";

	scenario.teams[team].properties["num_missions"]=new Array();
	scenario.teams[team].properties["num_missions"]["value"]=1;
	scenario.teams[team].properties["num_missions"]["control"]="team_"+team+"_num_missions";
	scenario.teams[team].properties["num_missions"]["info"]="The total number of Missions available to this Team, each to be described in  separate Team x Mission y sections. To be valid, each team must have at least 1 mission.";
	scenario.teams[team].properties["num_missions"]["text"]="Number of missions :";

	// Bases array for team #i
	scenario.teams[team].bases=new Array();
	
	// Missions array for team #i
	scenario.teams[team].missions=new Array();

	// Victories array for team #i
	scenario.teams[team].victories=new Array();

	// Bases array initialization
	create_bases(team);

	// Victories array initialization
	create_victories(team);

	// Missions array initialization
	create_missions(team);
}

// create all teams according to num_teams
function create_teams(){
	for(team=0;team<scenario.properties["num_teams"]["value"];team++){
		create_team(team);
	}

}

// Create the specified base j for the specified team i
function create_base(team,base){
	scenario.teams[team].bases[base]=new Object();
	scenario.teams[team].bases[base].properties=new Array();

	scenario.teams[team].bases[base].properties["name"]=new Array();
	scenario.teams[team].bases[base].properties["name"]["value"]="Base "+(base+1);
	scenario.teams[team].bases[base].properties["name"]["control"]="base_"+base+"_team_"+team+"_name";
	scenario.teams[team].bases[base].properties["name"]["info"]="The name of the airfield/base. When a friendly pilot lands at this location, they will see &#039;Welcome to [name]&#039; in the text buffer.";
	scenario.teams[team].bases[base].properties["name"]["text"]="Name :";

	scenario.teams[team].bases[base].properties["location"]=new Array();
	scenario.teams[team].bases[base].properties["location"]["value"]="0,0";
	scenario.teams[team].bases[base].properties["location"]["control"]="base_"+base+"_team_"+team+"_location";
	scenario.teams[team].bases[base].properties["location"]["info"]="Location on the terrain where the base is to be defined. Is NOT relative to the mission location, it is measured from the SW corner of the terrain map.";
	scenario.teams[team].bases[base].properties["location"]["text"]="Location (X,Y) :";

	scenario.teams[team].bases[base].properties["radius"]=new Array();
	scenario.teams[team].bases[base].properties["radius"]["value"]=1;
	scenario.teams[team].bases[base].properties["radius"]["control"]="base_"+base+"_team_"+team+"_radius";
	scenario.teams[team].bases[base].properties["radius"]["info"]="A defined radius around the location specified above, within which friendly planes that land will be given a &#039;safe landing&#039;. If planes land outside this radius, they will be counted as having ditched, and points will be awarded to the enemy.";
	scenario.teams[team].bases[base].properties["radius"]["text"]="Radius (km) :";
}

// create all bases according to num_bases of team i
function create_bases(team){
	for(base=0;base<scenario.teams[team].properties["num_bases"]["value"];base++){
		create_base(team,base);		
	}
}

// create all victories according to num_victory for team i
function create_victories(team){
	for(victory=0;victory<scenario.teams[team].properties["num_victory"]["value"];victory++){
		create_victory(team,victory);
	}
}

// create the specified victory j for team i
function create_victory(team,victory){
	scenario.teams[team].victories[victory]=new Object();
	scenario.teams[team].victories[victory].properties=new Array();

	scenario.teams[team].victories[victory].properties["margin"]=new Array();
	scenario.teams[team].victories[victory].properties["margin"]["value"]=1;
	scenario.teams[team].victories[victory].properties["margin"]["control"]="victory_"+victory+"_team_"+team+"_margin";
	scenario.teams[team].victories[victory].properties["margin"]["info"]="The teams total victory points must be at least margin times the other teams total victory points to acheive this level of victory. For example: 1.5 means if the enemy team has 6 vp, this team must have at least 9 vp (1.5 * 6) for this victory level.  If you win the victory level with the highest margin you&#039;ve acheived is the one you go with.";
	scenario.teams[team].victories[victory].properties["margin"]["text"]="Margin :";

	scenario.teams[team].victories[victory].properties["message"]=new Array();
	scenario.teams[team].victories[victory].properties["message"]["value"]="";
	scenario.teams[team].victories[victory].properties["message"]["control"]="victory_"+victory+"_team_"+team+"_message";
	scenario.teams[team].victories[victory].properties["message"]["info"]="Message displayed in the UI when Team "+(team+1)+" wins.  For example: &#039;The UN has won.&#039;";
	scenario.teams[team].victories[victory].properties["message"]["text"]="Message :";

	scenario.teams[team].victories[victory].properties["next_scenario"]=new Array();
	scenario.teams[team].victories[victory].properties["next_scenario"]["value"]="";
	scenario.teams[team].victories[victory].properties["next_scenario"]["control"]="victory_"+victory+"_team_"+team+"_next_scenario";
	scenario.teams[team].victories[victory].properties["next_scenario"]["info"]="The scenario that will begin next as a consequence of Team 1 Victory Conditions in the Team Unit Settings.  You can use the next_scenario setting to create a branching network of scenarios.  This creates a Campaign.";
	scenario.teams[team].victories[victory].properties["next_scenario"]["text"]="Next scenario :";
}

function create_mission(team,mission){
	scenario.teams[team].missions[mission]=new Object();
	scenario.teams[team].missions[mission].properties=new Array();

	scenario.teams[team].missions[mission].properties["name"]=new Array();
	scenario.teams[team].missions[mission].properties["name"]["value"]="Mission "+(mission+1);
	scenario.teams[team].missions[mission].properties["name"]["control"]="mission_"+mission+"_team_"+team+"_name";
	scenario.teams[team].missions[mission].properties["name"]["info"]="Name of the Mission as it will appear in the list of missions for a scenario.";
	scenario.teams[team].missions[mission].properties["name"]["text"]="Name :";

	scenario.teams[team].missions[mission].properties["player_threshold"]=new Array();
	scenario.teams[team].missions[mission].properties["player_threshold"]["value"]=0;
	scenario.teams[team].missions[mission].properties["player_threshold"]["control"]="mission_"+mission+"_team_"+team+"_player_threshold";
	scenario.teams[team].missions[mission].properties["player_threshold"]["info"]="The minimum number of players that need to join this mission, before the next mission becomes available for selection. If set to 0, the next mission will be selectable as soon as this mission is. On scenarios with multiple missions, this setting can be used to keep a limited player pool from being spread too thin.";
	scenario.teams[team].missions[mission].properties["player_threshold"]["text"]="Player threshold :";

	scenario.teams[team].missions[mission].properties["player_cap"]=new Array();
	scenario.teams[team].missions[mission].properties["player_cap"]["value"]=0;
	scenario.teams[team].missions[mission].properties["player_cap"]["control"]="mission_"+mission+"_team_"+team+"_player_cap";
	scenario.teams[team].missions[mission].properties["player_cap"]["info"]="The maximum number of players that can join this mission before it closes. Must be higher than the threshold number, unless it&#039;s zero, in which case there is no limit to the number of players that can join the mission.";
	scenario.teams[team].missions[mission].properties["player_cap"]["text"]="Player cap :";

	scenario.teams[team].missions[mission].properties["info"]=new Array();
	scenario.teams[team].missions[mission].properties["info"]["value"]="";
	scenario.teams[team].missions[mission].properties["info"]["control"]="mission_"+mission+"_team_"+team+"_info";
	scenario.teams[team].missions[mission].properties["info"]["info"]="Filename and path of a text file that gives an overview of the mission. This information will be displayed when a player selects &#039;Mission Briefing&#039; from the menu. Optional";
	scenario.teams[team].missions[mission].properties["info"]["text"]="Info file name :"

	scenario.teams[team].missions[mission].properties["image"]=new Array();
	scenario.teams[team].missions[mission].properties["image"]["value"]="";
	scenario.teams[team].missions[mission].properties["image"]["control"]="mission_"+mission+"_team_"+team+"_image";
	scenario.teams[team].missions[mission].properties["image"]["info"]="Filename and path of a graphics file (JPG or TGA) that you want displayed in a window on the screen when the player selects Mission Briefing from the In-Game menu, then  &#039;Visual Briefing &#039;. Could be a map with objectives circled, could be a checklist of mission objectives, etc. Should be 64x64, 128x128, 256x256, or 512x512. Optional";
	scenario.teams[team].missions[mission].properties["image"]["text"]="Image file name :";

	scenario.teams[team].missions[mission].properties["location"]=new Array();
	scenario.teams[team].missions[mission].properties["location"]["value"]="0,0";
	scenario.teams[team].missions[mission].properties["location"]["control"]="mission_"+mission+"_team_"+team+"_location";
	scenario.teams[team].missions[mission].properties["location"]["info"]="This defines the location of the mission within the designated terrain.  The values are X, Y coordinates in kilometers. These coordinates are the distance from the lower left corner of the terrain (X increases to the East, Y increases to the North).";
	scenario.teams[team].missions[mission].properties["location"]["text"]="Location (X,Y) :";

	scenario.teams[team].missions[mission].properties["location_var"]=new Array();
	scenario.teams[team].missions[mission].properties["location_var"]["value"]="0,0";
	scenario.teams[team].missions[mission].properties["location_var"]["control"]="mission_"+mission+"_team_"+team+"_location_var";
	scenario.teams[team].missions[mission].properties["location_var"]["info"]="These values can be used to add randomness to the mission location. Example:  50, 50 means that each time the scenario runs, the actual mission location will be chosen by picking a random location in a 50 km by 50 km box around the &#039;location&#039; specified above. The base settings are defined in the Team Unit section.";
	scenario.teams[team].missions[mission].properties["location_var"]["text"]="Location var (X,Y) :";

	scenario.teams[team].missions[mission].properties["viewpoint"]=new Array();
	scenario.teams[team].missions[mission].properties["viewpoint"]["value"]="0,0,0";
	scenario.teams[team].missions[mission].properties["viewpoint"]["control"]="mission_"+mission+"_team_"+team+"_viewpoint";
	scenario.teams[team].missions[mission].properties["viewpoint"]["info"]="Positions the view when the mission loads for those who haven&#039;t picked a unit.";
	scenario.teams[team].missions[mission].properties["viewpoint"]["text"]="View point (X,Y,Z) :";

	scenario.teams[team].missions[mission].properties["heading"]=new Array();
	scenario.teams[team].missions[mission].properties["heading"]["value"]=0;
	scenario.teams[team].missions[mission].properties["heading"]["control"]="mission_"+mission+"_team_"+team+"_heading";
	scenario.teams[team].missions[mission].properties["heading"]["info"]="These work like viewpoint and heading from the [Scenario] section above, only it is the viewpoint you have when you&#039;ve selected this mission, but have not yet selected a unit.";
	scenario.teams[team].missions[mission].properties["heading"]["text"]="Heading (degrees) :";

	scenario.teams[team].missions[mission].properties["disengage_dist"]=new Array();
	scenario.teams[team].missions[mission].properties["disengage_dist"]["value"]=0;
	scenario.teams[team].missions[mission].properties["disengage_dist"]["control"]="mission_"+mission+"_team_"+team+"_disengage_dist";
	scenario.teams[team].missions[mission].properties["disengage_dist"]["info"]="The distance from the mission start point (defined at location) at which a player will be ruled as having &#039;disengaged&#039;. A disengaged player has left the combat area and is counted as having safely returned to base (unless he used too much fuel, and is judged to have failed to return to base). Having disengaged, a player can select a new airplane, and rejoin the fight.  If this setting is set to 0, players must crash, bail, ditch, or land before they can get a new airplane.  The mission area is defined by a circle of disengage_dist radius around the mission start point.";
	scenario.teams[team].missions[mission].properties["disengage_dist"]["text"]="Disengage distance (km) :";

	scenario.teams[team].missions[mission].properties["enemy_dist"]=new Array();
	scenario.teams[team].missions[mission].properties["enemy_dist"]["value"]=0;
	scenario.teams[team].missions[mission].properties["enemy_dist"]["control"]="mission_"+mission+"_team_"+team+"_enemy_dist";
	scenario.teams[team].missions[mission].properties["enemy_dist"]["info"]="This setting only comes into play if you are already disengage_dist kilometers from the mission start point, but there are enemy planes in your immediate vicinity. This setting prevents players from disengaging from a fight unless they are a safe distance from any enemy aircraft. Can be set to 0.";
	scenario.teams[team].missions[mission].properties["enemy_dist"]["text"]="Enemy distance (km) :";

	scenario.teams[team].missions[mission].properties["num_units"]=new Array();
	scenario.teams[team].missions[mission].properties["num_units"]["value"]=1;
	scenario.teams[team].missions[mission].properties["num_units"]["control"]="mission_"+mission+"_team_"+team+"_num_units";
	scenario.teams[team].missions[mission].properties["num_units"]["info"]="The total number of aircraft Units on the Team, each to be described in separate Unit sections.";
	scenario.teams[team].missions[mission].properties["num_units"]["text"]="Number of units :";

	scenario.teams[team].missions[mission].properties["num_targets"]=new Array();
	scenario.teams[team].missions[mission].properties["num_targets"]["value"]=1;
	scenario.teams[team].missions[mission].properties["num_targets"]["control"]="mission_"+mission+"_team_"+team+"_num_targets";
	scenario.teams[team].missions[mission].properties["num_targets"]["info"]="The total number of ground/sea Targets owned by the Team, each to be described in separate Target sections.";
	scenario.teams[team].missions[mission].properties["num_targets"]["text"]="Number of targets :";

	// Units array for mission #j of team #i
	scenario.teams[team].missions[mission].units=new Array();

	// targets array for mission #j of team #i
	scenario.teams[team].missions[mission].targets=new Array();

	// Units array initialization
	create_units(team,mission);

	// Targets array initialization
	create_targets(team,mission);
}

// create all missions according to num_missions
function create_missions(team){
	for(mission=0;mission<scenario.teams[team].properties["num_missions"]["value"];mission++){
		create_mission(team,mission);
	}
}

// create unit for team #i mission #j
function create_units(i,j){
	for(k=0;k<scenario.teams[i].missions[j].properties["num_units"]["value"];k++){
		create_unit(i,j,k);
	}
}

// Create unit k for mission j and team i
function create_unit(i,j,k){
	scenario.teams[i].missions[j].units[k]=new Object();
	scenario.teams[i].missions[j].units[k].properties=new Array();
	
	scenario.teams[i].missions[j].units[k].properties["name"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["name"]["value"]="Unit "+(k+1);
	scenario.teams[i].missions[j].units[k].properties["name"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_name";
	scenario.teams[i].missions[j].units[k].properties["name"]["info"]="Name of the unit as it will appear in the user interface.  For example: &#039;336th > FS (F-86F-30)&#039;.  It is helpful to indicate here the type of aircraft flown by the unit.";
	scenario.teams[i].missions[j].units[k].properties["name"]["text"]="Name :";

	scenario.teams[i].missions[j].units[k].properties["info"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["info"]["value"]="";
	scenario.teams[i].missions[j].units[k].properties["info"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_info";
	scenario.teams[i].missions[j].units[k].properties["info"]["info"]="Filename and path of a text file that gives information on the unit and it&#039;s objectives. This briefing will be displayed when a player selects &#039;Unit Briefing&#039; from the menu";
	scenario.teams[i].missions[j].units[k].properties["info"]["text"]="Info file name (full path) :";

	scenario.teams[i].missions[j].units[k].properties["image"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["image"]["value"]="";
	scenario.teams[i].missions[j].units[k].properties["image"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_image";
	scenario.teams[i].missions[j].units[k].properties["image"]["info"]="Filename and path of a graphics file (JPG or TGA) that you want displayed in a window on the screen when the player selects Unit Briefing from the In-Game menu, then &#039;Visual Briefing&#039;. Could be a map with targets circled, a checklist of mission objectives, etc. Should be 64x64, 128x128, 256x256, or 512x512. Optional";
	scenario.teams[i].missions[j].units[k].properties["image"]["text"]="Image file name :";

	scenario.teams[i].missions[j].units[k].properties["file"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["file"]["value"]="";
	scenario.teams[i].missions[j].units[k].properties["file"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_file";
	scenario.teams[i].missions[j].units[k].properties["file"]["info"]="The .acm file of the aircraft and path.  For example: &#039;/tk/planes/f86f30.acm&#039;.";
	scenario.teams[i].missions[j].units[k].properties["file"]["text"]=".acm file (full path) :";

	scenario.teams[i].missions[j].units[k].properties["skin"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["skin"]["value"]="";
	scenario.teams[i].missions[j].units[k].properties["skin"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_skin";
	scenario.teams[i].missions[j].units[k].properties["skin"]["info"]="The starting skin for the unit. No entry will select the default skin.";
	scenario.teams[i].missions[j].units[k].properties["skin"]["text"]="Default skin file name :";

	scenario.teams[i].missions[j].units[k].properties["change_skin"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["change_skin"]["value"]=1;
	scenario.teams[i].missions[j].units[k].properties["change_skin"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_change_skin";
	scenario.teams[i].missions[j].units[k].properties["change_skin"]["info"]="If Off (0) you&#039;re stuck with whatever skin is above (which may be the default). If On (1) you can use any skin you want, including ones not on the server. Other players who have that skin will see it.  Players who do not have the skin will see the default skin.";
	scenario.teams[i].missions[j].units[k].properties["change_skin"]["text"]="Change skin (0/1) :";

	scenario.teams[i].missions[j].units[k].properties["options"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["options"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["options"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_options";
	scenario.teams[i].missions[j].units[k].properties["options"]["info"]="The numbers of the loadout option available to the aircraft in the unit. Loadout options are specified in the aircraft&#039;s .acm file.";
	scenario.teams[i].missions[j].units[k].properties["options"]["text"]="Options :";

	scenario.teams[i].missions[j].units[k].properties["change_opts"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["change_opts"]["value"]=1;
	scenario.teams[i].missions[j].units[k].properties["change_opts"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_change_opts";
	scenario.teams[i].missions[j].units[k].properties["change_opts"]["info"]="Ability of players to modify default loadout options of aircraft in the unit.";
	scenario.teams[i].missions[j].units[k].properties["change_opts"]["text"]="Change options (0/1) :";


	scenario.teams[i].missions[j].units[k].properties["points"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["points"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["points"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_points";
	scenario.teams[i].missions[j].units[k].properties["points"]["info"]="Victory points one of these units is worth to another team if destroyed.";
	scenario.teams[i].missions[j].units[k].properties["points"]["text"]="Points :";

	scenario.teams[i].missions[j].units[k].properties["players"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["players"]["value"]=1;
	scenario.teams[i].missions[j].units[k].properties["players"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_players";
	scenario.teams[i].missions[j].units[k].properties["players"]["info"]="Percentage of players on this team that can choose this unit. 0 = 0%, 1 = 100%.  Note that, like teams, these do not have to total 1.0 for all the units on a side.";
	scenario.teams[i].missions[j].units[k].properties["players"]["text"]="Players (%) :";

	scenario.teams[i].missions[j].units[k].properties["start_time"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["start_time"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["start_time"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_start_time";
	scenario.teams[i].missions[j].units[k].properties["start_time"]["info"]="This unit cannot start flight until this many seconds after the mission has begun.";
	scenario.teams[i].missions[j].units[k].properties["start_time"]["text"]="Start time (seconds) :";

	scenario.teams[i].missions[j].units[k].properties["start_cutoff"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["start_cutoff"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["start_cutoff"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_start_cutoff";
	scenario.teams[i].missions[j].units[k].properties["start_cutoff"]["info"]="If 0, players will be able to launch aircraft any time after flight operations are enabled for this unit (as long as they have lives left). If a number &#039;n&#039; is specified, flight operations for the unit will be shut down &#039;n&#039; seconds after the unit&#039;s start time. For example, putting in &#039;300&#039; would enable new flights for only 5 minutes, thereafter, players in flight could keep flying, but new flights could not be launched.";
	scenario.teams[i].missions[j].units[k].properties["start_cutoff"]["text"]="Start cutoff (seconds) :";

	scenario.teams[i].missions[j].units[k].properties["lives"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["lives"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["lives"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_lives";
	scenario.teams[i].missions[j].units[k].properties["lives"]["info"]="You can only fly this unit if you have died less than this number of times. Set to &#039;0&#039; to enable unlimited lives.";
	scenario.teams[i].missions[j].units[k].properties["lives"]["text"]="Number of lives :";

	scenario.teams[i].missions[j].units[k].properties["base"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["base"]["value"]="0,0";
	scenario.teams[i].missions[j].units[k].properties["base"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_base";
	scenario.teams[i].missions[j].units[k].properties["base"]["info"]="Where you start from and have to return to, fuel wise. This determines how much fuel you have when you start the scenario, and how much fuel you will need to get home.";
	scenario.teams[i].missions[j].units[k].properties["base"]["text"]="Base (X,Y in km) :";

	scenario.teams[i].missions[j].units[k].properties["location"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["location"]["value"]="0,0,0";
	scenario.teams[i].missions[j].units[k].properties["location"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_location";
	scenario.teams[i].missions[j].units[k].properties["location"]["info"]="Where members of this unit will start flying. If location_abs is set to 0, then this location will be relative to the mission location.";
	scenario.teams[i].missions[j].units[k].properties["location"]["text"]="Location (X,Y,Z) :";

	scenario.teams[i].missions[j].units[k].properties["location_abs"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["location_abs"]["value"]=1;
	scenario.teams[i].missions[j].units[k].properties["location_abs"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_location_abs";
	scenario.teams[i].missions[j].units[k].properties["location_abs"]["info"]="If (1) location for the unit is relative to the lower left (SW) corner of the terrain map. If (0), then the unit location is relative to the mission location.";
	scenario.teams[i].missions[j].units[k].properties["location_abs"]["text"]="Abs. location (0/1) :";

	scenario.teams[i].missions[j].units[k].properties["location_var"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["location_var"]["value"]="0,0,0";
	scenario.teams[i].missions[j].units[k].properties["location_var"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_location_var";
	scenario.teams[i].missions[j].units[k].properties["location_var"]["info"]="Just as with the mission location, a unit can have a variable starting location.";
	scenario.teams[i].missions[j].units[k].properties["location_var"]["text"]="Location var. (X,Y,Z) :";

	scenario.teams[i].missions[j].units[k].properties["bearing_var"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["bearing_var"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["bearing_var"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_bearing_var";
	scenario.teams[i].missions[j].units[k].properties["bearing_var"]["info"]="A second way of adding variation to the starting location of a unit, when combined with range_var. First, the unit&#039;s location and location_var are calculated. Next, the heading of the unit is taken, and a the bearing_var is applied to it. For example, if a unit&#039;s heading was 0 degrees (due north), and the bearing_var was 30 degrees, the unit heading would be between 330 degrees and 30 degrees. Next, the range_var is applied, which moves the unit back or forward along it&#039;s heading. For example, a range_var of 20 km would mean that a unit could be anywhere along a 40 km line along the line of flight calculated by heading and bearing_var.";
	scenario.teams[i].missions[j].units[k].properties["bearing_var"]["text"]="Bearing var. (degrees) :";

	scenario.teams[i].missions[j].units[k].properties["range_var"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["range_var"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["range_var"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_range_var";
	scenario.teams[i].missions[j].units[k].properties["range_var"]["info"]="See bearing_var above.";
	scenario.teams[i].missions[j].units[k].properties["range_var"]["text"]="Range var. (km) :";

	scenario.teams[i].missions[j].units[k].properties["heading"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["heading"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["heading"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_heading";
	scenario.teams[i].missions[j].units[k].properties["heading"]["info"]="Initial heading of the unit.";
	scenario.teams[i].missions[j].units[k].properties["heading"]["text"]="Heading (degrees) :";

	scenario.teams[i].missions[j].units[k].properties["speed"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["speed"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["speed"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_speed";
	scenario.teams[i].missions[j].units[k].properties["speed"]["info"]="Initial speed of all aircraft in the unit. If 0, the aircraft will start with gear down and engine shut off.";
	scenario.teams[i].missions[j].units[k].properties["speed"]["text"]="Speed (kph) :";

	scenario.teams[i].missions[j].units[k].properties["formation"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["formation"]["value"]="Trail";
	scenario.teams[i].missions[j].units[k].properties["formation"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_formation";
	scenario.teams[i].missions[j].units[k].properties["formation"]["info"]="Starting formation of aircraft, e.g., &#039;fingerfour&#039;. See <a class=\\\"red_link\\\" href=\\\"http://www.targetware.net/devguide/scenarios/1_formations.html\\\" target=\\\"_NEW\\\">Targetware Formations Reference</a> for available formations and diagrams.";
	scenario.teams[i].missions[j].units[k].properties["formation"]["text"]="Formation name :";

	scenario.teams[i].missions[j].units[k].properties["spacing"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["spacing"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["spacing"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_spacing";
	scenario.teams[i].missions[j].units[k].properties["spacing"]["info"]="Left/right spacing for aircraft within the formation.  Can have negative values.";
	scenario.teams[i].missions[j].units[k].properties["spacing"]["text"]="Spacing (meters) :";

	scenario.teams[i].missions[j].units[k].properties["trail"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["trail"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["trail"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_trail";
	scenario.teams[i].missions[j].units[k].properties["trail"]["info"]="Forward/aft spacing for aircraft within the formation.  Can have negative values. If unspecified, will use value give for spacing above.";
	scenario.teams[i].missions[j].units[k].properties["trail"]["text"]="Trail (meters) :";

	scenario.teams[i].missions[j].units[k].properties["step"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["step"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["step"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_step";
	scenario.teams[i].missions[j].units[k].properties["step"]["info"]="Vertical spacing for aircraft within the formation.  Can have negative values.";
	scenario.teams[i].missions[j].units[k].properties["step"]["text"]="Step (meters) :";

	scenario.teams[i].missions[j].units[k].properties["wrap_position"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["wrap_position"]["value"]=1;
	scenario.teams[i].missions[j].units[k].properties["wrap_position"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_wrap_position";
	scenario.teams[i].missions[j].units[k].properties["wrap_position"]["info"]="This setting determines how many formation positions will be filled before succeeding aircraft begin to wrap, and start over from the beginning of the formation. If 0, aircraft will never wrap. If 1, all aircraft will be drawn on the same spot. If 10, the first ten aircraft will be drawn in formation, then every aircraft after that will wrap to those 10 spots, as necessary.";
	scenario.teams[i].missions[j].units[k].properties["wrap_position"]["text"]="Wrap position :";

	scenario.teams[i].missions[j].units[k].properties["wave_timer"]=new Array();
	scenario.teams[i].missions[j].units[k].properties["wave_timer"]["value"]=0;
	scenario.teams[i].missions[j].units[k].properties["wave_timer"]["control"]="unit_"+k+"_mission_"+j+"_team_"+i+"_wave_timer";
	scenario.teams[i].missions[j].units[k].properties["wave_timer"]["info"]="Waves are disabled by default. To enable waves, set this value to anything but 0. If waves are enabled, a player will only be able to launch once during each wave. If a player has already died/ditched/bailed during the current wave, he will have to wait for the next wave before flying again. Players that land safely will be able to launch again with no restrictions. The wave interval is counted from the unit start time. So if a unit has a start time of T+4, and a wave timer of 300 seconds (5 minutes), then the first wave will start at T+4, the second at T+9, the third at T+14, etc.";
	scenario.teams[i].missions[j].units[k].properties["wave_timer"]["text"]="Wave timer (seconds) :";
}

// create target for team #i mission #j
function create_targets(i,j){
	for(k=0;k<scenario.teams[i].missions[j].properties["num_targets"]["value"];k++){
		create_target(i,j,k);
	}
}

// Create the target k for mission j for the team i
function create_target(i,j,k){
	scenario.teams[i].missions[j].targets[k]=new Object();
	scenario.teams[i].missions[j].targets[k].properties=new Array();

	scenario.teams[i].missions[j].targets[k].properties["name"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["name"]["value"]=scenario.teams[i].missions[j].properties["name"]+" Target "+(k+1);
	scenario.teams[i].missions[j].targets[k].properties["name"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_name";
	scenario.teams[i].missions[j].targets[k].properties["name"]["info"]="Name of the target.  For example: &#039;Cargo Truck&#039;.  If the object is destroyed or damaged, this name will be used to identify it in the damage log and text buffer.";
	scenario.teams[i].missions[j].targets[k].properties["name"]["text"]="Name :";

	scenario.teams[i].missions[j].targets[k].properties["file"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["file"]["value"]="";
	scenario.teams[i].missions[j].targets[k].properties["file"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_file";
	scenario.teams[i].missions[j].targets[k].properties["file"]["info"]="The .acm file of the target object.  For example: &#039;/tk/objects/vehicles/zis5.acm&#039;.";
	scenario.teams[i].missions[j].targets[k].properties["file"]["text"]=".acm file name :";

	scenario.teams[i].missions[j].targets[k].properties["skin"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["skin"]["value"]="";
	scenario.teams[i].missions[j].targets[k].properties["skin"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_skin";
	scenario.teams[i].missions[j].targets[k].properties["skin"]["info"]="The starting skin for the target.  A blank entry will select the default texture.";
	scenario.teams[i].missions[j].targets[k].properties["skin"]["text"]="Skin file name :";

	scenario.teams[i].missions[j].targets[k].properties["options"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["options"]["value"]=0;
	scenario.teams[i].missions[j].targets[k].properties["options"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_options";
	scenario.teams[i].missions[j].targets[k].properties["options"]["info"]="The numbers of the loadout option available to the target object.  Loadout options are specified in the object&#039;s .acm file.";
	scenario.teams[i].missions[j].targets[k].properties["options"]["text"]="Options :";

	scenario.teams[i].missions[j].targets[k].properties["count"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["count"]["value"]=1;
	scenario.teams[i].missions[j].targets[k].properties["count"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_count";
	scenario.teams[i].missions[j].targets[k].properties["count"]["info"]="A target can specify any number of copies of the original object, all of which are valid targets. Location of objects 2 and higher is determined by the formation and spacing settings below.";
	scenario.teams[i].missions[j].targets[k].properties["count"]["text"]="Count :";

	scenario.teams[i].missions[j].targets[k].properties["points"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["points"]["value"]=0;
	scenario.teams[i].missions[j].targets[k].properties["points"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_points";
	scenario.teams[i].missions[j].targets[k].properties["points"]["info"]="The number of victory points given to the enemy team each time one of these targets is destroyed. If the target has more than one object (count is greater than 1), then this many points will be awarded for each object destroyed, and not spread out among the objects. For example, a tank target with a count of 4 could yield a total of 100 points if all 4 tanks are destroyed.";
	scenario.teams[i].missions[j].targets[k].properties["points"]["text"]="Points :";

	scenario.teams[i].missions[j].targets[k].properties["kill_message"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["kill_message"]["value"]=1;
	scenario.teams[i].missions[j].targets[k].properties["kill_message"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_kill_message";
	scenario.teams[i].missions[j].targets[k].properties["kill_message"]["info"]="If &#039;0&#039;, this will prevent a target destruction credit being given in the radio buffer. If &#039;1&#039;, when the target is destroyed, the player who did the most damage to it will be given credit for the kill in the radio buffer. If &#039;0&#039;, no killed message will be sent, and nothing will be recorded in the server log. Defaults to &#039;1&#039; (ON).";
	scenario.teams[i].missions[j].targets[k].properties["kill_message"]["text"]="Kill message (0/1) :";

	scenario.teams[i].missions[j].targets[k].properties["location"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["location"]["value"]="0,0";
	scenario.teams[i].missions[j].targets[k].properties["location"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_location";
	scenario.teams[i].missions[j].targets[k].properties["location"]["info"]="Where this target will be placed on the terrain. If location_abs is 1, then positioning will be relative to the lower left (SW) corner of the terrain map. If location_abs is 0, then the target&#039;s position will be relative to the mission location. Target objects are placed at ground level by default.";
	scenario.teams[i].missions[j].targets[k].properties["location"]["text"]="Location (X,Y) in km :"

	scenario.teams[i].missions[j].targets[k].properties["location_abs"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["location_abs"]["value"]=1;
	scenario.teams[i].missions[j].targets[k].properties["location_abs"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_location_abs";
	scenario.teams[i].missions[j].targets[k].properties["location_abs"]["info"]="If 1 location for the target is absolute, not relative to the mission location.";
	scenario.teams[i].missions[j].targets[k].properties["location_abs"]["text"]="Abs. location (0/1) :";

	scenario.teams[i].missions[j].targets[k].properties["location_var"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["location_var"]["value"]="0,0";
	scenario.teams[i].missions[j].targets[k].properties["location_var"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_location_var";
	scenario.teams[i].missions[j].targets[k].properties["location_var"]["info"]="See the unit section for an explanation.";
	scenario.teams[i].missions[j].targets[k].properties["location_var"]["text"]="Location var. (X,Y) in km :"

	scenario.teams[i].missions[j].targets[k].properties["bearing_var"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["bearing_var"]["value"]=0;
	scenario.teams[i].missions[j].targets[k].properties["bearing_var"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_bearing_var";
	scenario.teams[i].missions[j].targets[k].properties["bearing_var"]["info"]="See the explanation of bearing_var in the Unit section.";
	scenario.teams[i].missions[j].targets[k].properties["bearing_var"]["text"]="Bearing var. (degrees) :";

	scenario.teams[i].missions[j].targets[k].properties["range_var"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["range_var"]["value"]=0;
	scenario.teams[i].missions[j].targets[k].properties["range_var"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_range_var";
	scenario.teams[i].missions[j].targets[k].properties["range_var"]["info"]="See the explanation of bearing_var in the Unit section.";
	scenario.teams[i].missions[j].targets[k].properties["range_var"]["text"]="Range var. (km) :";

	scenario.teams[i].missions[j].targets[k].properties["heading"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["heading"]["value"]=0;
	scenario.teams[i].missions[j].targets[k].properties["heading"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_heading";
	scenario.teams[i].missions[j].targets[k].properties["heading"]["info"]="Initial heading of the target.";
	scenario.teams[i].missions[j].targets[k].properties["heading"]["text"]="Heading (degrees) :";

	scenario.teams[i].missions[j].targets[k].properties["speed"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["speed"]["value"]=0;
	scenario.teams[i].missions[j].targets[k].properties["speed"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_speed";
	scenario.teams[i].missions[j].targets[k].properties["speed"]["info"]="Initial speed of the target. Buildings and stationary vehicles should have speed of 0. Note: Target AI is not yet functional in the Targetware Engine, so this setting is ignored.";
	scenario.teams[i].missions[j].targets[k].properties["speed"]["text"]="Speed (kph) :";

	scenario.teams[i].missions[j].targets[k].properties["formation"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["formation"]["value"]="Trail";
	scenario.teams[i].missions[j].targets[k].properties["formation"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_formation";
	scenario.teams[i].missions[j].targets[k].properties["formation"]["info"]="Starting formation of target objects. See <a class=\\\"red_link\\\" href=\\\"http://www.targetware.net/devguide/scenarios/1_formations.html\\\" target=\\\"_NEW\\\">Targetware Formations Reference</a> for available formations and diagrams.";
	scenario.teams[i].missions[j].targets[k].properties["formation"]["text"]="Formation (formation name) :";

	scenario.teams[i].missions[j].targets[k].properties["spacing"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["spacing"]["value"]=0;
	scenario.teams[i].missions[j].targets[k].properties["spacing"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_spacing";
	scenario.teams[i].missions[j].targets[k].properties["spacing"]["info"]="Left/right spacing for targets within the formation.  Can have negative values.";
	scenario.teams[i].missions[j].targets[k].properties["spacing"]["text"]="Spacing (meters) :";

	scenario.teams[i].missions[j].targets[k].properties["trail"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["trail"]["value"]=0;
	scenario.teams[i].missions[j].targets[k].properties["trail"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_trail";
	scenario.teams[i].missions[j].targets[k].properties["trail"]["info"]="Forward/aft spacing for targets within the formation.  Can have negative values. If unspecified, will use value give for spacing above.";
	scenario.teams[i].missions[j].targets[k].properties["trail"]["text"]="Trail (meters) :";

	scenario.teams[i].missions[j].targets[k].properties["step"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["step"]["value"]=0;
	scenario.teams[i].missions[j].targets[k].properties["step"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_step";
	scenario.teams[i].missions[j].targets[k].properties["step"]["info"]="Vertical spacing for targets within the formation.  Can have negative values.";
	scenario.teams[i].missions[j].targets[k].properties["step"]["text"]="Step (meters) :";

	scenario.teams[i].missions[j].targets[k].properties["wrap_position"]=new Array();
	scenario.teams[i].missions[j].targets[k].properties["wrap_position"]["value"]=0;
	scenario.teams[i].missions[j].targets[k].properties["wrap_position"]["control"]="target_"+k+"_mission_"+j+"_team_"+i+"_wrap_position";
	scenario.teams[i].missions[j].targets[k].properties["wrap_position"]["info"]="This setting determines how many formation positions will be filled before succeeding targets begin to wrap, and start over from the beginning of the formation. If 0, units will never wrap. If 1, all objects will be drawn on the same spot. If 10, the first ten objects will be drawn in formation, then every object after that will wrap to those 10 spots as necessary.";
	scenario.teams[i].missions[j].targets[k].properties["wrap_position"]["text"]="Wrap position :";
}


