rem: debug.trace("Character is encumbered."); var maxDexMod = 99; 
add: debug.trace("Character is encumbered."); var maxDexMod = 99; 
context: function CalcWeight(){  if (disable_autocalc())    return;  var total = 0.0;  var slots = document.getElementById("gear").rows.length - 3;  for (var i = 1; i <= slots; i++)  {    var num = parseFloat(sheet()["Gear" + FormatNumber(i) + "W"].value);    if (isNaN(num))      num = 0.0;    total += num;  }  document.getElementById("bagWeight").innerHTML = total.toFixed(1);  // Add the armor weight.  for ( var i = 1; i <= 4; i++ )  {     // If the armor is flagged as not carried, then don't add it to the weight.     if ( !sheet()["Armor" + i + "Carried"].checked )	     continue;     var num = parseFloat(sheet()["Armor" + i + "Weight"].value);     if (isNaN(num))        num = 0.0;     total += num;  }  // Add the weapon weight  for ( var i = 1; i <= 4; i++ )  {    if ( sheet()[ "Weapon" + i + "Carried" ].checked )	 {      var num = parseFloat(sheet()["Weapon" + i + "Weight"].value);      if (isNaN(num))         num = 0.0;      total += num;	 }  }  sheet().TotalWeight.value = total.toFixed(1);  // Check to see if the character is encumbered.  If so, then set the background  // color of "Total Weight", Speed, and DexMod input fields to red.  if ( Clean( sheet().TotalWeight.value ) > Clean( sheet().LightLoad.value ) )  {	 debug.trace("Character is encumbered.");					  	 var maxDexMod = 99;    if ( Clean( sheet().TotalWeight.value ) > Clean( sheet().MediumLoad.value ) )	 {           maxDexMod = 1;           sheet().TotalWeight.title = "Check penalty of -6 while encumbered";	 }	 else	 {           maxDexMod = 3;           sheet().TotalWeight.title = "Check penalty of -3 while encumbered";	 }	 debug.trace("MaxDexMod = " + maxDexMod + " DexMod = " + Clean( sheet().DexMod.value ) );	 if ( Clean( sheet().DexMod.value ) > maxDexMod )	 {           sheet().DexMod.title = "Max dex bonus to AC is +" + maxDexMod + " while encumbered.";           sheet().DexMod.style.color           = "white";           sheet().DexMod.style.backgroundColor = "red";	 }	 else	 {           sheet().DexMod.title = sheet().DexMod.value;           sheet().DexMod.style.color           = "black";	   sheet().DexMod.style.backgroundColor = "white";	 }    sheet().TotalWeight.style.color           = "white";    sheet().TotalWeight.style.backgroundColor = "red";    sheet().Speed.title = "Max speed is reduced by roughly 1/3 due to encumbrance";    sheet().Speed.style.color           = "white";    sheet().Speed.style.backgroundColor = "red";    ACCheckMaxDex(); // Check if the dex bonus to AC should be reduced.  }  else  {    sheet().TotalWeight.title 					 = sheet().TotalWeight.value;    sheet().TotalWeight.style.color           = "black";	 sheet().TotalWeight.style.backgroundColor = "white";    sheet().DexMod.title      			  = sheet().DexMod.value;    sheet().DexMod.style.color           = "black";	 sheet().DexMod.style.backgroundColor = "white";    sheet().Speed.title 					 = sheet().Speed.value;    sheet().Speed.style.color           = "black";	 sheet().Speed.style.backgroundColor = "white";  }  SkillsUpdateCheckPen();  debug.trace("Calculated total weight.");}
meta: 8354	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8354/d72fdfbf37aa1d233635af773bc09628b7ebc13f/gear.js/buggy/public_profiler/v3.5-DD/gear.js