// Funtion to update the base & max of tradeskills
function set_tradeskill_base( )
{
  var intelligence,perception,total, i;
  var level = validate_number(document.getElementById("level").value, 2, 150);
  var intel = validate_number(document.getElementById("stat4").value, 0, 80);
  var perce = validate_number(document.getElementById("stat5").value, 0, 80);
  
  intelligence = 10 + level + intel;
  perception = 10 + level + perce;

  total = ((intelligence * .75) + (perception * .25)) * 2; // Tradeskills
  for (i = 0; i < 9; i++)
  {
 //   document.getElementById("tr_base" + i).value = min + total;
    document.getElementById("tr_max" + i).value = Math.round(total);
  } // for i
}
// Display the hint text for the selected tradeskill
function tradeskill_selected(i)
{
  mutation_popup_close( );

  switch(i)
  {
    case 0:
      prepare_hint("Armorcraft");
      hint_text("Making all manner of clothes and armor. ");
      hint_add("");
      hint_add("Note: Tradeskills are raised through use, and not by usind APs");
      break;
    case 1:
      prepare_hint("Ballistics");
      hint_text("Making rifles, pistols, crossbows, zip guns, submachine guns and assault rifles, and their associated ammunition. Note that these are not the only types of ranged weapon, but some of the known types. "); 
      hint_add("");
      hint_add("Note: Tradeskills are raised through use, and not by usind APs");
      break;
    case 2:
      prepare_hint("Cooking");
      hint_text("Creating food that can help increase player performance primarily through the recovery of hit points and stamina faster (characters who don't have some food in their gut and a quenched thirst are going to be able to act fine, but will find their time spent recovering from injuries or exhaustion much longer).");
      hint_add("");
      hint_add("Note: Tradeskills are raised through use, and not by usind APs");
      break;
    case 3:
      prepare_hint("Geology");
      hint_text("Allows the player to harvest minerals from mining nodes and to refine metals into higher-grade components. "); 
      hint_add("");
      hint_add("Note: Tradeskills are raised through use, and not by usind APs");
      break;
    case 4:
      prepare_hint("Medicine");
      hint_text("Making first aid kits, anti-venoms, radiation treatments, etc. ");
      hint_add("");
      hint_add("Note: Tradeskills are raised through use, and not by usind APs");
      break;
    case 5:
      prepare_hint("Mutanagenics");
      hint_text("Covers the creation of mutation injectors and other devices that support the use of mutations, such as gamma restorers. ");
      hint_add("");
      hint_add("Note: Tradeskills are raised through use, and not by usind APs");
      break;
    case 6:
      prepare_hint("Nature");
      hint_text("Making poisons, collecting materials from plants and animals, refining tradeskill components, etc. "); 
      hint_add("");
      hint_add("Note: Tradeskills are raised through use, and not by usind APs");
      break;
    case 7:
      prepare_hint("Weaponry");
      hint_text("Making clubs, knives, baseball bats, and other killing implements that are used up close and personal. "); 
      hint_add("");
      hint_add("Note: Tradeskills are raised through use, and not by usind APs");
      break;
    case 8:
      prepare_hint("Science");
      hint_text("Making acids, sniper scopes, batteries, cars, refining tradeskill components, etc. "); 
      hint_add("");
      hint_add("Note: Tradeskills are raised through use, and not by usind APs");
      break;
    default:
      break;
  }
}