// BACKGROUNDS
function Background( p_aParams )
{
	this.id = p_aParams["id"];
	this.name = p_aParams["name"];
	this.abilityModifiers = p_aParams["ability modifiers"]; // indexed on STR|DEX|CON|INT|WIS|CHA
	this.bonusSkills = ( p_aParams["bonus skills"] ? p_aParams["bonus skills"] : 0 );
	this.size = p_aParams["size"]; // medium | small
	
	if ( p_aParams["bonus feats"] )
		this.bonusFeats = p_aParams["bonus feats"];
	else
		this.bonusFeats = new Array();
	
	if ( p_aParams["favored feats"] )
		this.favoredFeats = p_aParams["favored feats"];
	else
		this.favoredFeats = new Array();
}

function fInitializeBackgrounds()
{
	Backgrounds = new Array();
	
	Backgrounds["dwarf"] = new Background
	({
		"id" : "dwarf",
		"name" : "Dwarf",
		"size" : "medium",
		"ability modifiers" : { "CON" : 1, "CHA" : -1 },
		"bonus feats" : new Choices
		({
			"num choices" : 3,
			"options" : new Array
			(
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption({ "id" : "great fortitude" })
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption({ "id" : "night vision" })
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "talented",
						"subtypes" : new Array( "Craft", "Search" ),
						"restriction" : "only involving stonework"
					})
				})
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption( { "id" : "diehard" } )
				}),
				new Option
				({
					"type" : "Choices",
					"object" : new Choices
					({
						"num choices" : 1,
						"options" : new Array
						(
							new Option
							({
								"type" : "FeatOption",
								"object" : new FeatOption
								({
									"id" : "favored opponent",
									"subtypes" : new Array( "goblins" )
								})
							}),
							new Option
							({
								"type" : "FeatOption",
								"object" : new FeatOption
								({
									"id" : "favored opponent",
									"subtypes" : new Array( "giants" )
								})
							})
						)
					})
				})
			)
		})
	});
	Backgrounds["elf"] = new Background
	({
		"id" : "elf",
		"name" : "Elf",
		"size" : "medium",
		"ability modifiers" : { "DEX" : 1, "CON" : -1 },
		"bonus feats" : new Choices
		({
			"num choices" : 3,
			"options" : new Array
			(
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption({ "id" : "weapon training" })
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption({ "id" : "night vision" })
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "talented",
						"subtypes" : new Array( "Notice", "Search" )
					})
				})
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 1,
			"options" : new Array
			(
				new Option({ "type" : "ChoiceFeatList", "object" : new ChoiceFeatList({ "feat lists" : new Array( "adept powers" ) }) })
			)
		})
	});
	Backgrounds["gnome"] = new Background
	({
		"id" : "gnome",
		"name" : "Gnome",
		"size" : "small",
		"ability modifiers" : { "CON" : 1, "STR" : -1 },
		"bonus feats" : new Choices
		({
			"num choices" : 3,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "iron will" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "night vision" }) }),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "talented",
						"subtypes" : new Array( "Craft (Chemical)", "Notice" )
					})
				})
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "fascinate" }) }),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "favored opponent",
						"subtypes" : new Array( "goblins" )
					})
				})
			)
		})
	});
	Backgrounds["half-elf"] = new Background
	({
		"id" : "half-elf",
		"name" : "Half-elf",
		"size" : "medium",
		"ability modifiers" : {},
		"bonus feats" : new Choices
		({
			"num choices" : 3,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "night vision" }) }),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "talented",
						"subtypes" : new Array( "Diplomacy", "Gather Information" )
					})
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "talented",
						"subtypes" : new Array( "Notice", "Search" )
					})
				})
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "ChoiceFeatList", "object" : new ChoiceFeatList({ "num times to display" : 2, "feat lists" : new Array( "adept", "expert", "warrior" ) }) })
			)
		})
	});
	Backgrounds["half-orc"] = new Background
	({
		"id" : "half-orc",
		"name" : "Half-orc",
		"size" : "medium",
		"ability modifiers" : { "STR" : 1, "INT" : -1 },
		"bonus skills" : 1,
		"bonus feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "night vision" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "weapon training" }) })
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "cleave" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "favored opponent" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "tough" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "rage" }) })
			)
		})
	});
	Backgrounds["halfling"] = new Background
	({
		"id" : "halfling",
		"name" : "Halfling",
		"size" : "small",
		"ability modifiers" : { "DEX" : 1, "STR" : -1 },
		"bonus feats" : new Choices
		({
			"num choices" : 3,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "lucky" }) }),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "talented",
						"subtypes" : new Array( "Climb", "Jump" )
					})
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "talented",
						"subtypes" : new Array( "Notice", "Stealth" )
					})
				})
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "evasion" }) }),
				new Option
				({
					"type" : "Choices",
					"object" : new Choices
					({
						"num choices" : 1,
						"options" : new Array
						(
							new Option
							({
								"type" : "FeatOption",
								"object" : new FeatOption
								({
									"id" : "attack specialization",
									"subtypes" : new Array( "thrown weapon" )
								})
							}),
							new Option
							({
								"type" : "FeatOption",
								"object" : new FeatOption
								({
									"id" : "attack specialization",
									"subtypes" : new Array( "sling" )
								})
							})
						)
					})
				})
			)
		})
	});
	Backgrounds["human"] = new Background
	({
		"id" : "human",
		"name" : "Human",
		"size" : "medium",
		"ability modifiers" : {},
		"bonus skills" : 1,
		"bonus feats" : new Choices
		({
			"num choices" : 1,
			"options" : new Array
			(
				new Option({ "type" : "ChoiceFeatList", "object" : new ChoiceFeatList({ "feat lists" : new Array( "general", "adept", "expert", "warrior" ) }) })
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "ChoiceFeatList", "object" : new ChoiceFeatList({ "num times to display" : 2, "feat lists" : new Array( "adept", "expert", "warrior" ) }) })
			)
		})
	});
	
	// BLOOD THRONE
	// Humans
	Backgrounds["daleian"] = new Background
	({
		"id" : "daleian",
		"name" : "Daleian (human)",
		"size" : "medium",
		"ability modifiers" : {},
		"bonus skills" : 1,
		"bonus feats" : new Choices
		({
			"num choices" : 1,
			"options" : new Array
			(
				new Option({ "type" : "ChoiceFeatList", "object" : new ChoiceFeatList({ "feat lists" : new Array( "general", "adept", "expert", "warrior" ) }) })
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "dedicated" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "eidetic memory" }) })
			)
		})
	});
	Backgrounds["narballan"] = new Background
	({
		"id" : "narballan",
		"name" : "Narballan (human)",
		"size" : "medium",
		"ability modifiers" : {},
		"bonus skills" : 1,
		"bonus feats" : new Choices
		({
			"num choices" : 1,
			"options" : new Array
			(
				new Option({ "type" : "ChoiceFeatList", "object" : new ChoiceFeatList({ "feat lists" : new Array( "general", "adept", "expert", "warrior" ) }) })
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "endurance" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "taunt" }) })
			)
		})
	});
	Backgrounds["narmrothan"] = new Background
	({
		"id" : "narmrothan",
		"name" : "Narmrothan (human)",
		"size" : "medium",
		"ability modifiers" : {},
		"bonus skills" : 1,
		"bonus feats" : new Choices
		({
			"num choices" : 1,
			"options" : new Array
			(
				new Option({ "type" : "ChoiceFeatList", "object" : new ChoiceFeatList({ "feat lists" : new Array( "general", "adept", "expert", "warrior" ) }) })
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "track" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "vehicular combat" }) })
			)
		})
	});
	Backgrounds["sargolian"] = new Background
	({
		"id" : "sargolian",
		"name" : "Sargolian (human)",
		"size" : "medium",
		"ability modifiers" : {},
		"bonus skills" : 1,
		"bonus feats" : new Choices
		({
			"num choices" : 1,
			"options" : new Array
			(
				new Option({ "type" : "ChoiceFeatList", "object" : new ChoiceFeatList({ "feat lists" : new Array( "general", "adept", "expert", "warrior" ) }) })
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "improved strike" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "point blank shot" }) })
			)
		})
	});
	Backgrounds["sudejan"] = new Background
	({
		"id" : "sudejan",
		"name" : "Sudejan (human)",
		"size" : "medium",
		"ability modifiers" : {},
		"bonus skills" : 1,
		"bonus feats" : new Choices
		({
			"num choices" : 1,
			"options" : new Array
			(
				new Option({ "type" : "ChoiceFeatList", "object" : new ChoiceFeatList({ "feat lists" : new Array( "general", "adept", "expert", "warrior" ) }) })
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "talented",
						"subtypes" : new Array( "Diplomacy", "Sense Motive" )
					})
				}),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "track" }) })
			)
		})
	});
	// Dwarves
	Backgrounds["shieldwall dwarf"] = new Background
	({
		"id" : "shieldwall dwarf",
		"name" : "Shieldwall Dwarf",
		"size" : "medium",
		"ability modifiers" : { "CON" : 1, "CHA" : -1 },
		"bonus feats" : new Choices
		({
			"num choices" : 3,
			"options" : new Array
			(
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption({ "id" : "great fortitude" })
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption({ "id" : "night vision" })
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "talented",
						"subtypes" : new Array( "Craft", "Search" ),
						"restriction" : "only involving stonework"
					})
				})
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption( { "id" : "diehard" } )
				}),
				new Option
				({
					"type" : "Choices",
					"object" : new Choices
					({
						"num choices" : 1,
						"options" : new Array
						(
							new Option
							({
								"type" : "FeatOption",
								"object" : new FeatOption
								({
									"id" : "favored opponent",
									"subtypes" : new Array( "mountain ogres" )
								})
							}),
							new Option
							({
								"type" : "FeatOption",
								"object" : new FeatOption
								({
									"id" : "favored opponent",
									"subtypes" : new Array( "gretchclaws" )
								})
							})
						)
					})
				})
			)
		})
	});
	Backgrounds["volagar"] = new Background
	({
		"id" : "volagar",
		"name" : "Volagar (dwarf)",
		"size" : "medium",
		"ability modifiers" : { "STR" : 1, "DEX" : -1, "CON" : 1, "CHA" : -1 },
		"bonus feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption({ "id" : "aspect of flame" })
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption({ "id" : "night vision" })
				})
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 1,
			"options" : new Array
			(
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "elemental resistance",
						"subtypes" : new Array( "fire" )
					})
				})
			)
		})
	});
	// Elves
	Backgrounds["thusparri"] = new Background
	({
		"id" : "thusparri",
		"name" : "Thusparri (elf)",
		"size" : "medium",
		"ability modifiers" : { "DEX" : 1, "CON" : -1 },
		"bonus feats" : new Choices
		({
			"num choices" : 3,
			"options" : new Array
			(
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption({ "id" : "animal empathy" })
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption({ "id" : "night vision" })
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "talented",
						"subtypes" : new Array( "Notice", "Search" )
					})
				})
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 1,
			"options" : new Array
			(
				new Option({ "type" : "ChoiceFeatList", "object" : new ChoiceFeatList({ "feat lists" : new Array( "adept powers" ) }) })
			)
		})
	});
	Backgrounds["volsparran"] = new Background
	({
		"id" : "volsparran",
		"name" : "Volsparran (elf)",
		"size" : "medium",
		"ability modifiers" : { "DEX" : 1, "CON" : -1 },
		"bonus feats" : new Choices
		({
			"num choices" : 3,
			"options" : new Array
			(
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption({ "id" : "weapon training" })
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption({ "id" : "night vision" })
				}),
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "talented",
						"subtypes" : new Array( "Notice", "Search" )
					})
				})
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 1,
			"options" : new Array
			(
				new Option({ "type" : "ChoiceFeatList", "object" : new ChoiceFeatList({ "feat lists" : new Array( "adept powers" ) }) })
			)
		})
	});
	// Gnomes
	Backgrounds["seguire"] = new Background
	({
		"id" : "seguire",
		"name" : "Seguire (gnome)",
		"size" : "small",
		"ability modifiers" : { "CON" : 1, "STR" : -1 },
		"bonus feats" : new Choices
		({
			"num choices" : 3,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "trailblazer" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "night vision" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "use mana shard" }) })
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 3,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "nature reading" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "tap mana well" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "use ascendant technology" }) })
			)
		})
	});
	Backgrounds["shek-tar"] = new Background
	({
		"id" : "shek-tar",
		"name" : "Shek-Tar (gnome)",
		"size" : "small",
		"ability modifiers" : { "DEX" : 1, "CON" : 1, "WIS" : -1, "CHA" : -1 },
		"bonus feats" : new Choices
		({
			"num choices" : 3,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "trailblazer" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "night vision" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "weapon training" }) })
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 1,
			"options" : new Array
			(
				new Option
				({
					"type" : "Choices",
					"object" : new Choices
					({
						"num choices" : 2,
						"options" : new Array
						(
							new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "fascinate" }) }),
							new Option
							({
								"type" : "Choices",
								"object" : new Choices
								({
									"num choices" : 1,
									"options" : new Array
									(
										new Option
										({
											"type" : "FeatOption",
											"object" : new FeatOption
											({
												"id" : "favored opponent",
												"subtypes" : new Array( "wyldlings" )
											})
										}),
										new Option
										({
											"type" : "FeatOption",
											"object" : new FeatOption
											({
												"id" : "favored opponent",
												"subtypes" : new Array( "seguire gnomes" )
											})
										})
									)
								})
							})
						)
					})
				}),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "summon spirit" }) })
			)
		})
	});
	// Half-Giant
	Backgrounds["kotarran"] = new Background
	({
		"id" : "kotarran",
		"name" : "Kotarran (half-giant)",
		"size" : "large",
		"ability modifiers" : { "STR" : 2, "CON" : 1, "INT" : -1, "WIS" : -1, "CHA" : -1 },
		"bonus skills" : 1,
		"bonus feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option
				({
					"type" : "FeatOption",
					"object" : new FeatOption
					({
						"id" : "favored opponent",
						"subtypes" : new Array( "sundaari" )
					})
				}),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "weapon training" }) })
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "all-out attack" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "rage" }) })
			)
		})
	});
	// Orc
	Backgrounds["saran-ghori"] = new Background
	({
		"id" : "saran-ghori",
		"name" : "Saran-ghori (orc)",
		"size" : "medium",
		"ability modifiers" : { "STR" : 2, "CON" : 1, "INT" : -1, "CHA" : -2 },
		"bonus skills" : 1,
		"bonus feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "night vision" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "weapon training" }) })
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "cleave" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "favored opponent" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "rage" }) })
			)
		})
	});
	// Shodonai
	Backgrounds["shodonai"] = new Background
	({
		"id" : "shodonai",
		"name" : "Shodonai",
		"size" : "medium",
		"ability modifiers" : { "STR" : -1, "CON" : 1, "WIS" : 1, "CHA" : -1 },
		"bonus feats" : new Choices
		({
			"num choices" : 2,
			"options" : new Array
			(
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "lightning reflexes" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "night vision" }) }),
				new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "resonance crystal" }) })
			)
		}),
		"favored feats" : new Choices
		({
			"num choices" : 1,
			"options" : new Array( new Option({ "type" : "FeatOption", "object" : new FeatOption({ "id" : "supernatural focus" }) }) )
		})
	});
}

