// Funtion to update the base & max of skills
function set_skill_base( )
{
  var total, i;
  var level = validate_number(document.getElementById("level").value, 2, 150);
  var chari = validate_number(document.getElementById("stat0").value, 0, 80);
  var coord = validate_number(document.getElementById("stat1").value, 0, 80);
  var dexte = validate_number(document.getElementById("stat2").value, 0, 80);
  var endur = validate_number(document.getElementById("stat3").value, 0, 80);
  var intel = validate_number(document.getElementById("stat4").value, 0, 80);
  var perce = validate_number(document.getElementById("stat5").value, 0, 80);
  var stren = validate_number(document.getElementById("stat6").value, 0, 80);
  var willp = validate_number(document.getElementById("stat7").value, 0, 80);
  
  var min = 10 + level;
  
  total = Math.round((coord * .5) + (endur * .5)) // Armor Use
  document.getElementById("sk_base0").value = min + total; 
  document.getElementById("sk_max0").value = (min + total) * 2;
  total = Math.round((endur * .75) + (coord * .25)); // Athletics 
  document.getElementById("sk_base1").value = min + total;
  document.getElementById("sk_max1").value = (min + total) * 2
  total = Math.round((coord * .75) + (perce * .25)); // Dodge 
  document.getElementById("sk_base2").value = min + total;
  document.getElementById("sk_max2").value = (min + total) * 2
  total = Math.round((intel * .75) + (perce * .25)); // First Aid 
  document.getElementById("sk_base3").value = min + total;
  document.getElementById("sk_max3").value = (min + total) * 2
  total = Math.round((chari * .75) + (perce * .25)); // Group Tactics 
  document.getElementById("sk_base4").value = min + total;
  document.getElementById("sk_max4").value = (min + total) * 2
  total = Math.round((stren * .75) + (coord * .25)); // Melee 
  document.getElementById("sk_base5").value = min + total;
  document.getElementById("sk_max5").value = (min + total) * 2
  total = Math.round((dexte * .75) + (perce * .25)); // Pistol
  document.getElementById("sk_base6").value = min + total;
  document.getElementById("sk_max6").value = (min + total) * 2
  total = Math.round((dexte * .75) + (perce * .25)); // Rifle 
  document.getElementById("sk_base7").value = min + total;
  document.getElementById("sk_max7").value = (min + total) * 2
  total = Math.round((chari * .75) + (perce * .25)); // Social 
  document.getElementById("sk_base8").value = min + total;
  document.getElementById("sk_max8").value = (min + total) * 2
}
// Funtion to perform the calculation for skill values
// Triggered from skill edit box changes
function calc_skill(loop)
{
  var stat, min, max;
  var i;
  
  for (i = 0; i < 9; i++)
  {
    stat = parseInt(validate_number(document.getElementById("skill" + i).value, 0, 240));
    document.getElementById("skill" + i).value = stat;
    
    min = parseInt(document.getElementById("sk_base" + i).value);
    max = parseInt(document.getElementById("sk_max" + i).value);
    
    if ((stat + min) > max)
    {
      document.getElementById("sk_actual" + i).style.backgroundColor = "#FF0000";
    }
    else
    {
      document.getElementById("sk_actual" + i).style.backgroundColor = "#008000";
    }
    
    document.getElementById("sk_actual" + i).value = stat + min;
  } // for i
  
  if (loop == 0)
  {
    calc_ap( ); // Spend AP
  }
}
// Decrease a skill by 1
function skilldown(i)
{
  var stat = validate_number(document.getElementById("skill" + i).value, 0, 240);
  
  if (stat > 0) stat--; 
  
  document.getElementById("skill" + i).value = stat;
  
  calc_skill(0);
}
// Increase a skill by 1
function skillup(i)
{
  var stat = validate_number(document.getElementById("skill" + i).value, 0, 240);
  
  if (stat < 240) stat++; 
  
  document.getElementById("skill" + i).value = stat;
  
  calc_skill(0);
}
// Display the hint text for the selected skill
function skill_selected(i)
{
  mutation_popup_close( );
  
  switch(i)
  {
    case 0:
      prepare_hint("Armor Use");
      hint_text("Allows the character to wear better armor and improves the effectiveness of your armor. Armor Use is based on 50% coordination and 50% endurance."); 
      hint_add_skill("Buckle Down", 1, "This ability increases your armor rating versus weapon damage by 50. Lasts 30 seconds. Uses 16 Stamina. Cannot be used again for 1 minute.");
      hint_add_skill("Buckle Down", 2, "This ability increases your armor rating versus weapon damage by 150. Lasts 30 seconds. Uses 29 Stamina. Cannot be used again for 1 minute."); 
      hint_add_skill("Dreadnought", 1, "This Armor Use ability increases your Dodge, Melee Defense, and Armor Use skills by 3 and decreases your Speed by 10%. Stance lasts until toggled. Only one stance can be used at a time.");
      hint_add_skill("Dreadnought", 2, "This Armor Use ability increases your Dodge, Melee Defense, and Armor Use skills by 4 and decreases your Speed by 10%. Stance lasts until toggled. Only one stance can be used at a time."); 
      hint_add_skill("Efficiency and Equilibrium", 1, "This Armor Use ability uses Tech training to increase your armor rating versus weapon damage by 200 and Speed by 5% and to decrease your Melee skill by 23. Stance lasts until toggled. Only one stance can be used at a time.."); 
      hint_add_skill("Evasive Maneuvers", 1, "This Armor Use ability uses Enforcer training to increase your Dodge and Melee Defense skills by 23. Lasts 30 seconds. Uses 44 Stamina. Cannot be used again for 2 minutes."); 
      hint_add_skill("Knockdown", 1, "This Armor Use ability knocks down your opponent. Lasts 2 seconds. Uses 25 Stamina. 5 meter range. Cannot be used again for 30 seconds.");
      hint_add_skill("Knockdown", 2, "This Armor Use ability knocks down your opponent. Lasts 2 seconds. Uses 40 Stamina. 5 meter range. Cannot be used again for 30 seconds. ");
      hint_add_skill("Pain Sponge", 1, "This Armor Use ability uses CHOTA training to increase your armor rating versus weapon damage by 200 and increase your Dodge, Melee Defense, and Melee skills by 12. Lasts 1 minute. Uses 50 Stamina. Cannot be used again for 4 minutes."); 
      hint_add_skill("Pinpoint Vulnerability", 1, "This Armor Use ability decreases your opponent's armor rating versus weapon damage by 100. Lasts 30 seconds. Uses 17 Stamina. 10 meter range. Cannot be used again for 20 seconds.");
      hint_add_skill("Pinpoint Vulnerability", 2, "This Armor Use ability decreases your opponent's armor rating versus weapon damage by 250. Lasts 30 seconds. Uses 30 Stamina. 10 meter range. Cannot be used again for 20 seconds. ");
      hint_add_skill("Soak Elements", 1, "This Armor Use ability increases your armor rating versus elemental damage by 120 and decreases your armor rating versus weapon damage by 60. Stance lasts until toggled. Only one stance can be used at a time.");
      hint_add_skill("Soak Elements", 2, "This Armor Use ability increases your armor rating versus elemental damage by 300 and decreases your armor rating versus weapon damage by 130. Stance lasts until toggled. Only one stance can be used at a time. ");
      hint_add_skill("Unstoppable", 1, "This Armor Use ability increases your armor rating versus weapon damage by 500, Melee skill by 15, and Speed by 12%. Lasts 20 seconds. Uses 50 Stamina. Cannot by used again for 10 minutes."); 
      break;
    case 1:
      prepare_hint("Athletics");
      hint_text("Your ability to push your body and perform physical feats. Athletics is based on 75% endurance and 25% coordination.");
      hint_add_skill("Body Toughening", 1, "This Athletics ability increases your Endurance attribute by 2. Lasts 1 hour. Uses 13 Stamina. Cannot by used again for 10 seconds.");
      hint_add_skill("Body Toughening", 2, "This Athletics ability increases your Endurance attribute by 3. Lasts 1 hour. Uses 24 Stamina. Cannot by used again for 10 seconds. ");
      hint_add_skill("Dash", 1, "This Athletics ability increases your Speed by 50% and decreases you Melee, Pistol, and Rifle skills by 13. Lasts 6 seconds. Uses 12 Stamina. Cannot be used again for 5 minutes."); 
      hint_add_skill("Fitness", 1, "This Athletics ability uses CHOTA training to increase your Coordination, Dexterity, Endurance, and Strength attributes by 3. Lasts 30 minutes. Uses 15 Stamina. Cannot be used again for 9 minutes.");
      hint_add_skill("Fitness", 2, "This Athletics ability uses CHOTA training to increase your Coordination, Dexterity attributes by 3 and your Endurance, and Strength attributes by 4. Lasts 30 minutes. Uses 29 Stamina. Cannot be used again for 9 minutes."); 
      hint_add_skill("Marathon", 1, "This Athletics ability increases your Speed by 3% and decreases your Dodge, Melee Defense, Melee, Pistol, and Rifle skills by 5. Stance lasts until toggled. Uses 1 Stamina every 6 seconds while active. Only one stance can be used at a time.");
      hint_add_skill("Marathon", 2, "This Athletics ability increases your Speed by 6% and decreases your Dodge, Melee Defense, Melee, Pistol, and Rifle skills by 9. Stance lasts until toggled. Uses 3 Stamina every 6 seconds while active. Only one stance can be used at a time. ");
      hint_add_skill("Reflexes", 1, "This Athletics ability increases your Dexterity attribute by 2. Lasts 1 hour. Uses 13 Stamina. Cannot be used again for 10 seconds.");
      hint_add_skill("Reflexes", 2, "This Athletics ability increases your Dexterity attribute by 3. Lasts 1 hour. Uses 24 Stamina. Cannot be used again for 10 seconds. ");
      hint_add_skill("Roll with the Punches", 1, "This Athletics ability increases your Body, Mind, and Reflex resistances by 80%. Lasts 1 minute. Uses 24 Stamina. Cannot be used again for 3 minutes.");
      hint_add_skill("Roll with the Punches", 2, "This Athletics ability increases your Body, Mind, and Reflex resistances by 105%. Lasts 1 minute. Uses 37 Stamina. Cannot be used again for 3 minutes. ");
      hint_add_skill("Second Wind", 1, "This Athletics ability restores your Stamina by 50 every 6 seconds, decreases your Dodge and Melee Defense skills by 75%, and prevents movement. Lasts 12 seconds. Cannot be used again for 3 minutes.");
      hint_add_skill("Second Wind", 2, "This Athletics ability restores your Stamina by 75 every 6 seconds, decreases your Dodge and Melee Defense skills by 75%, and prevents movement. Lasts 12 seconds. Cannot be used again for 3 minutes. ");
      hint_add_skill("Shake it Off", 1, "This Athletics ability removes weapon and disease effects from you. Uses 35 Stamina. Cannot be used again for 2 minutes.");
      hint_add_skill("Shake it Off", 2, "This Athletics ability removes weapon and disease effects from you. Uses 48 Stamina. Cannot be used again for 2 minutes. ");
      hint_add_skill("Survivor", 1, "This Athletics ability uses Vista training to increase your resistance versus cold, disease, poison, and radiation damage by 150. Stance lasts until toggled. Only one stance can be used at a time."); 
      hint_add_skill("Vigor", 1, "This Athletics ability increases your Strength attribute by 2. Lasts 1 hour. Uses 13 Stamina. Cannot be used again for 10 seconds.");
      hint_add_skill("Vigor", 2, "This Athletics ability increases your Strength attribute by 3. Lasts 1 hour. Uses 24 Stamina. Cannot be used again for 10 seconds. ");
       break;
    case 2:
      prepare_hint("Dodge");
      hint_text("Your ability to avoid ranged & melee attacks. Dodge is determined by 75% coordination and 25% perception. ");
      hint_add_skill("Autumn Leaves", 1, "This Dodge ability uses Lightbearer training to increase your Dodge skill by 35 and Speed by 10%. Lasts 30 seconds. Uses 47 Stamina. Cannot be used again for 1 minute."); 
      hint_add_skill("Duck and Weave", 1, "This Dodge ability increases your Dodge skill by 10 and decreases Melee Defense skill by 10. Stance lasts until toggled. Only one stance can be used at a time.");
      hint_add_skill("Duck and Weave", 2, "This Dodge ability increases your Dodge skill by 14 and decreases Melee Defense skill by 14. Stance lasts until toggled. Only one stance can be used at a time. ");
      hint_add_skill("Escape", 1, "This Dodge ability increases your Dodge skill by 10 and Speed by 12%. Lasts 10 seconds. Uses 20 Stamina. Cannot be used again for 1 minute.");
      hint_add_skill("Escape", 2, "This Dodge ability increases your Dodge skill by 15 and Speed by 14%. Lasts 10 seconds. Uses 30 Stamina. Cannot be used again for 1 minute. ");
      hint_add_skill("Low Profile", 1, "This Dodge ability increases your Dodge skill by 25 and decreases your threat. Lasts 10 seconds. Uses 34 Stamina. Cannot be used again for 3 minutes.");
      hint_add_skill("Low Profile", 2, "This Dodge ability increases your Dodge skill by 32 and decreases your threat. Lasts 10 seconds. Uses 48 Stamina. Cannot be used again for 3 minutes. ");
      hint_add_skill("Smoke Screen", 1, "This Dodge ability uses Enforcer training to increase your Dodge skill by 40 and Melee Defense skill by 20. Requires a Smoke Sphere. Lasts 20 seconds. Uses 54 Stamina. Cannot be used again for 90 seconds."); 
      break;
    case 3:
      prepare_hint("First Aid");
      hint_text("Allows the character to use a number of healing items and special abilities, such as recovering health over time, restoring stamina, or removing poison and disease effects. First Aid is based on 75% intelligence and 25% perception."); 
      hint_add_skill("Extended Care", 1, "This First Aid ability restores the target's Health by 9 every 6 seconds and instantly removes multiple damage effects. Lasts 1 hour. Uses 17 Stamina. 5 meter range. Cannot be used again for 3 minutes.");
      hint_add_skill("Extended Care", 2, "This First Aid ability restores the target's Health by 11 every 6 seconds and instantly removes multiple damage effects. Lasts 1 hour. Uses 40 Stamina. 5 meter range. Cannot be used again for 3 minutes. ");
      hint_add_skill("Fortify", 1, "This First Aid ability increases the target's Stamina by 7 every 6 seconds and increases the target's Dexterity and Endurance attributes by 2. Lasts 30 minutes. Uses 17 Stamina. 5 meter range. Cannot be used again for 3 minutes.");
      hint_add_skill("Fortify", 2, "This First Aid ability increases the target's Stamina by 9 every 6 seconds and increases the target's Dexterity and Endurance attributes by 3. Lasts 30 minutes. Uses 30 Stamina. 5 meter range. Cannot be used again for 3 minutes. ");
      hint_add_skill("Pressure Points", 1, "This First Aid ability decreases your opponent's Coordination and Strength attributes by 6. Lasts 30 seconds. Also stuns the target for 2 seconds. Uses 24 Stamina. 5 meter range. Cannot be used again for 3 minutes.");
      hint_add_skill("Pressure Points", 2, "This First Aid ability decreases your opponent's Coordination and Strength attributes by 8. Lasts 30 seconds. Also stuns the target for 2 seconds. Uses 36 Stamina. 5 meter range. Cannot be used again for 3 minutes. ");
      hint_add_skill("Refresh", 1, "This First Aid ability restores the target's Stamina by 57 every 6 seconds. Lasts 18 seconds. Uses 19 Stamina. 5 meter range. Cannot be used again for 3 minutes.");
      hint_add_skill("Refresh", 2, "This First Aid ability restores the target's Stamina by 73 every 6 seconds. Lasts 18 seconds. Uses 31 Stamina. 5 meter range. Cannot be used again for 3 minutes. ");
      hint_add_skill("Resuscitation", 1, "This First Aid ability revives the target with 50 Health. Uses 30 Stamina. 5 meter range. Cannot be used again for 3 minutes. ");
      hint_add_skill("Sand and Stone", 1, "This First Aid ability uses Lightbearer training to increase the target's armor versus natural damage effects by 400. Also restores 42 Health to the target. Lasts 1 hour. Uses 38 Stamina. 5 meter range. Cannot be used again for 3 minutes."); 
      hint_add_skill("Stanch Wound", 1, "This First Aid ability removes bleed effects from the target. Also restores 20 Health every 6 seconds. Lasts 12 seconds. Uses 10 Stamina. 5 meter range. Cannot be used again for 30 seconds.");
      hint_add_skill("Stanch Wound", 2, "This First Aid ability removes bleed effects from the target. Also restores 25 Health every 6 seconds. Lasts 12 seconds. Uses 22 Stamina. 5 meter range. Cannot be used again for 30 seconds.");
      hint_add_skill("Stanch Wound", 3, "This First Aid ability removes bleed effects from the target. Also restores 30 Health every 6 seconds. Lasts 12 seconds. Uses 34 Stamina. 5 meter range. Cannot be used again for 30 seconds. ");
      hint_add_skill("Suck it Up", 1, "This First Aid ability removes weapon damage effects from the target. Uses 14 Stamina. 5 meter range. Cannot be used again for 1 minute.");
      hint_add_skill("Suck it Up", 2, "This First Aid ability removes weapon damage effects from the target. Uses 24 Stamina. 5 meter range. Cannot be used again for 1 minute. ");
      hint_add_skill("Treat Disease", 1, "This First Aid ability removes disease effects from the target. Uses 10 Stamina. 5 meter range. Cannot be used again for 10 seconds.");
      hint_add_skill("Treat Disease", 2, "This First Aid ability removes disease effects from the target. Uses 19 Stamina. 5 meter range. Cannot be used again for 10 seconds. ");
      hint_add_skill("Treat Poison", 1, "This First Aid ability removes poison effects from the target. Uses 12 Stamina. 5 meter range. Cannot be used again for 10 seconds.");
      hint_add_skill("Treat Poison", 2, "This First Aid ability removes poison effects from the target. Uses 21 Stamina. 5 meter range. Cannot be used again for 10 seconds. ");
      break;
    case 4:
      prepare_hint("Group Tactics");
      hint_text("Allows use of special abilities that can increase your group's combat effectiveness. Group Tactics is based on 75% charisma and 25% perception. ");
      hint_add_skill("Defensive Coordination", 1, "This Group Tactics ability increases your group's Dodge and Melee Defense skills by 5. 20 meter range. Stance lasts until toggled. Only one stance can be used at a time.");
      hint_add_skill("Defensive Coordination", 2, "This Group Tactics ability increases your group's Dodge and Melee Defense skills by 8. 20 meter range. Stance lasts until toggled. Only one stance can be used at a time. ");
      hint_add_skill("Give 'em Hell", 1, "This Group Tactics ability increases your group's Melee, Pistol, and Rifle skills by 16. Lasts 30 seconds. Uses 31 Stamina. 10 meter range. Cannot be used again for 5 minutes. ");
      hint_add_skill("Hold the Line", 1, "This Group Tactics ability increases your group's Dodge and Melee Defense skills by 5, increases armor versus weapon damage by 300, and increases resistances by 3%. Lasts 1 minute. Uses 25 Stamina. 10 meter range. Cannot be used again for 5 minutes."); 
      hint_add_skill("Inspiration", 1, "This Group Tactics ability uses Enforcer training to increase your group's Dodge, Melee Defense, Melee, Pistol, and Rifle skills by 11 and increase resistances by 9%. Lasts 30 seconds. Uses 37 Stamina. 10 meter range. Cannot be used again for 5 minutes."); 
      hint_add_skill("Lead the Charge", 1, "This Group Tactics ability uses Enforcer training to increase your group's Dodge and Melee Defense skills by 7 and Speed by 10%, and to increase your threat. Lasts 10 seconds. Uses 37 Stamina. 10 meter range. Cannot be used again for 1 minute. ");
      hint_add_skill("Offensive Coordination", 1, "This Group Tactics ability increases your group's Melee, Pistol, and Rifle skills by 4. 20 meter range. Stance lasts until toggled. 20 meter range. Only one stance can be used at a time.");
      hint_add_skill("Offensive Coordination", 2, "This Group Tactics ability increases your group's Melee, Pistol, and Rifle skills by 6. 20 meter range. Stance lasts until toggled. 20 meter range. Only one stance can be used at a time. ");
      hint_add_skill("Organize", 1, "This Group Tactics ability increases your group's Speed by 5% and increases resistances by 5%. Stance lasts until toggled. 20 meter range. Only one stance can be used at a time. ");
      hint_add_skill("Overwhelm", 1, "This Group Tactics ability decreases your opponent's Dodge and Melee Defense skills by 11 and resistances by 7. Lasts 15 seconds. Uses 13 Stamina. 20 meter range. Cannot be used again for 45 seconds.");
      hint_add_skill("Overwhelm", 2, "This Group Tactics ability decreases your opponent's Dodge and Melee Defense skills by 22 and resistances by 8. Lasts 15 seconds. Uses 24 Stamina. 20 meter range. Cannot be used again for 45 seconds. ");
      hint_add_skill("Rally", 1, "This Group Tactics ability restores your group's Health and Stamina by 21 every 6 seconds. Lasts 12 seconds. Uses 18 Stamina. 20 meter range. Cannot be used again for 4 minutes.");
      hint_add_skill("Rally", 2, "This Group Tactics ability restores your group's Health and Stamina by 33 every 6 seconds. Lasts 12 seconds. Uses 29 Stamina. 20 meter range. Cannot be used again for 4 minutes. ");
      hint_add_skill("Suppressive Attack", 1, "This Group Tactics ability decreases your opponent's Melee, Pistol, and Rifle skills by 15. Lasts 30 seconds. Uses 18 Stamina. 20 meter range. Cannot be used again for 1 minute.");
      hint_add_skill("Suppressive Attack", 2, "This Group Tactics ability decreases your opponent's Melee, Pistol, and Rifle skills by 21. Lasts 30 seconds. Uses 30 Stamina. 20 meter range. Cannot be used again for 1 minute. ");
      break;
    case 5:
      prepare_hint("Melee");
      hint_text("Determines effectiveness of melee combat, including chance of critical hits, weapon selection, and special attacks. Melee is based on 75% strength and 25% coordination. ");
      hint_add_skill("Brutalize", 1, "This Melee ability uses CHOTA training to inflict 45 crushing damage, and decrease Melee Defense by 8 and armor versus weapons by 600. Lasts 10 seconds. Also causes 2 second knockback. Uses 45 Stamina. 5 meter range. Cannot be used again for 1 minute."); 
      hint_add_skill("Cripple", 1, "This Melee ability decreases your opponent's Speed by 25%. Lasts 10 seconds. Uses 17 Stamina. 5 meter range. Cannot be used again for 45 seconds.");
      hint_add_skill("Cripple", 2, "This Melee ability decreases your opponent's Speed by 30%. Lasts 10 seconds. Uses 28 Stamina. 5 meter range. Cannot be used again for 45 seconds. ");
      hint_add_skill("Defensive Fighting", 1, "This Melee ability increases your Dodge and Melee Defense skills by 8. Stance lasts until toggled. Only one stance can be used at a time.");
      hint_add_skill("Defensive Fighting", 2, "This Melee ability increases your Dodge and Melee Defense skills by 12. Stance lasts until toggled. Only one stance can be used at a time. ");
      hint_add_skill("Feint", 1, "This Melee ability decreases your opponent's Dodge and Melee Defense skills by 25 and armor versus weapon damage by 200. Lasts 10 seconds. Uses 25 Stamina. 5 meter range. Cannot be used again for 45 seconds.");
      hint_add_skill("Feint", 2, "This Melee ability decreases your opponent's Dodge and Melee Defense skills by 35 and armor versus weapon damage by 350. Lasts 10 seconds. Uses 35 Stamina. 5 meter range. Cannot be used again for 45 seconds. ");
      hint_add_skill("Lingering Wound", 1, "This Melee ability inflicts 4 points of slashing damage per second on your opponent. Lasts 15 seconds. Uses 25 Stamina. 5 meter range. Cannot be used again for 15 seconds.");
      hint_add_skill("Lingering Wound", 2, "This Melee ability inflicts 8 points of slashing damage per second on your opponent. Lasts 15 seconds. Uses 39 Stamina. 5 meter range. Cannot be used again for 15 seconds. ");
      hint_add_skill("Payback", 1, "This Melee ability decreases your opponent's Dodge and Melee Defense skills by 16 and inflicts 62 points of crushing damage. Lasts 10 seconds. Uses 28 Stamina. 5 meter range. Cannot be used again for 1 minute.");
      hint_add_skill("Payback", 2, "This Melee ability decreases your opponent's Dodge and Melee Defense skills by 20 and inflicts 82 points of crushing damage. Lasts 10 seconds. Uses 40 Stamina. 5 meter range. Cannot be used again for 1 minute. ");
      hint_add_skill("Pierce Armor", 1, "This Melee ability decreases your opponent's armor versus weapon damage by 140. Lasts 20 seconds. Uses 21 Stamina. 5 meter range. Cannot be used again for 10 seconds.");
      hint_add_skill("Pierce Armor", 2, "This Melee ability decreases your opponent's armor versus weapon damage by 330. Lasts 20 seconds. Uses 34 Stamina. 5 meter range. Cannot be used again for 10 seconds. ");
      hint_add_skill("Provoke", 1, "This Melee ability decreases your opponent's Dodge and Melee Defense skills by 10 and increases your threat. Lasts 10 seconds. Uses 16 Stamina. 15 meter range. Cannot be used again for 20 seconds.");
      hint_add_skill("Provoke", 2, "This Melee ability decreases your opponent's Dodge and Melee Defense skills by 15 and increases your threat. Lasts 10 seconds. Uses 35 Stamina. 15 meter range. Cannot be used again for 20 seconds. ");
      hint_add_skill("Rapid Advance", 1, "This Melee ability increases your Melee Defense skill by 10 and Speed by 5%. It also decreases your Dodge skill by 10 and armor versus weapon damage by 200. Stance lasts until toggled. Only one stance can be used at a time."); 
      hint_add_skill("Reckless Attacks", 1, "This Melee ability increases your Melee skill by 10 and decreases your Dodge and Melee Defense skills by 10. Stance lasts until toggled. Only one stance can be used at a time. ");
      hint_add_skill("Knife Hand Strike", 1, "This Melee ability uses Lightbearer training to decrease your opponent's Dodge and Melee Defense skills by 20. Lasts 15 seconds. Also stuns the target for 2 seconds. Uses 50 Stamina. 5 meter range. Cannot be used again for 1 minute."); 
      hint_add_skill("Smash", 1, "This Melee ability inflicts 32 points of crushing damage to your opponent and stuns the target for 2 seconds. Uses 3 Stamina. 5 meter range. Cannot be used again for 15 seconds.");
      hint_add_skill("Smash", 2, "This Melee ability inflicts 58 points of crushing damage to your opponent and stuns the target for 2 seconds. Uses 26 Stamina. 5 meter range. Cannot be used again for 15 seconds.");
      hint_add_skill("Smash", 3, "This Melee ability inflicts 82 points of crushing damage to your opponent and stuns the target for 2 seconds. Uses 39 Stamina. 5 meter range. Cannot be used again for 15 seconds. ");
      break;
    case 6:
      prepare_hint("Pistol");
      hint_text("Determines effectiveness of pistols in combat, including chance of critical hits, weapon selection, and special attacks. Pistol is based on 75% dexterity and 25% perception."); 
      hint_add("Pistols don’t have the range of rifles, but can be used in close combat without penalty. Note that submachine guns and zip guns are included in this skill.");
      hint_add_skill("Desperado", 1, "This Pistol ability increases your Pistol skill by 64 and decreases your Dodge skill by 9 and Melee Defense skill by 21. Lasts 30 seconds. Uses 28 Stamina. Cannot be used again for 5 minutes."); 
      hint_add_skill("Gun to a Knife Fight", 1, "This Pistol ability uses Traveler training to increase your Pistol skill by 45 and increase resistances by 45%. Lasts 10 seconds. Uses 38 Stamina. Cannot be used again for 30 seconds."); 
      hint_add_skill("Gunfighter", 1, "This Pistol ability increases your Pistol skill by 6 and Dodge skill by 3, and decreases Melee Defense skill by 18. Stance lasts until toggled. Only one stance can be used at a time. ");
      hint_add_skill("Perforate", 1, "This Pistol ability uses Tech training to inflict 90 points of piercing damage to your opponent. Also drains 45 points of Stamina every 6 seconds. Lasts 12 seconds. Uses 45 Stamina. 30 meter range. Cannot be used again for 1 minute."); 
      hint_add_skill("Pistol Whip", 1, "This Pistol ability inflicts 20 points of crushing damage to your opponent and stuns the target. Lasts 3 seconds. Uses 14 Stamina. 5 meter range. Cannot be used again for 15 seconds.");
      hint_add_skill("Pistol Whip", 2, "This Pistol ability inflicts 49 points of crushing damage to your opponent and stuns the target. Lasts 3 seconds. Uses 33 Stamina. 5 meter range. Cannot be used again for 15 seconds. ");
      hint_add_skill("Smoking Sabot Round", 1, "This Pistol ability uses Tech training to decrease the target's Perception by 28. Also inflicts 2 piercing damage and 3 fire damage per second. Requires a Smoke Sphere. Lasts 10 seconds. Uses 38 Stamina. 40 meter range. Cannot be used again for 45 seconds."); 
      hint_add_skill("Staggering Shot", 1, "This Pistol ability decreases your opponent's Speed by 38% and inflicts 48 points of piercing damage. Lasts for 5 seconds. Uses 36 Stamina. 35 meter range. Cannot be used again for 10 seconds. ");
      break;
    case 7:
      prepare_hint("Rifle");
      hint_text("Determines effectiveness of rifles in combat, including chance of critical hits, weapon selection, and special attacks. Rifle is based on 75% dexerity and 25% perception."); 
      hint_add("Note that shotguns and crossbows are included in this skill.");
      hint_add_skill("Puncture", 1, "This Rifle ability inflicts 30 points of piercing damage. Also inflicts 2 points of slashing damage per second. Lasts 15 seconds. Uses 24 Stamina. 40 meter range. Cannot be used again for 30 seconds.");
      hint_add_skill("Puncture", 1, "This Rifle ability inflicts 50 points of piercing damage to your opponent. Also inflicts 3 points of slashing damage per second. Lasts 15 seconds. Uses 37 Stamina. 40 meter range. Cannot be used again for 30 seconds."); 
      hint_add_skill("One Shot, One Kill", 1, "This Rifle ability uses Vista training to inflict 60 piercing damage. Also inflicts 4 piercing per second and decreases the target's Stamina by 55 every 6 seconds. Lasts 12 seconds. Uses 44 Stamina. 55 meter range. Cannot be used again for 2 minutes."); 
      hint_add_skill("Precise Aim", 1, "This Rifle ability increases your Rifle skill by 9, and decreases your Dodge skill by 6 and Melee Defense skill by 12. Stance lasts until toggled. Only one stance can be used at a time.");
      hint_add_skill("Precise Aim", 2, "This Rifle ability increases your Rifle skill by 18, decreases your Dodge skill by 12 and Melee Defense skill by 24. Stance lasts until toggled. Only one stance can be used at a time. ");
      hint_add_skill("Rifle Smash", 1, "This Rifle ability uses Enforcer training to decrease your opponent's Speed by 25% and inflict 66 points of crushing damage. Lasts 30 seconds. Also stuns the target for 2 seconds. Uses 44 Stamina. 5 meter range. Cannot be used again for 1 minute."); 
      hint_add_skill("Unbreakable Focus", 1, "This Rifle ability increases your Rifle skill by 41 and decreases your Dodge skill by 24. Lasts 30 seconds. Uses 25 Stamina. Cannot be used again for 2 minutes.");
      hint_add_skill("Unbreakable Focus", 2, "This Rifle ability increases your Rifle skill by 58 and decreases your Dodge skill by 36. Lasts 30 seconds. Uses 37 Stamina. Cannot be used again for 2 minutes. ");
      break;
    case 8:
      prepare_hint("Social");
      hint_text("Allows a PC to get better deals from merchants and to have special abilities to conceal their faction. Social is based on 75% charisma and 25% perception."); 
      hint_add_skill("Boisterous Boast", 1, "");
      hint_add_skill("Flag of Truce", 1, "");
      hint_add_skill("Inconspicuous", 1, "");
      hint_add_skill("Infuriate", 1, "");
      hint_add_skill("Laughable Offence", 1, "");
      hint_add_skill("Mockery of Impotence", 1, "");
      hint_add_skill("Pathetic Defence", 1, "");      
      hint_add_skill("Pathetic Defence", 2, "");      
      break;
    default:
      break;
  }
}
function highlight_skill(i)
{
  document.getElementById("skill" + i).select( );
}