function unhideHint(hintField) {
  document.getElementById(hintField).style.visibility = "visible";
}

function hideHint(hintField) {
  document.getElementById(hintField).style.visibility = "hidden";
}

function validateWeight(weight, low, high, decimal) {
  var errfound = 0;
  if(weight == '') {
    alert("Please enter a weight.");
    errfound++;
  } else if(isNaN(weight)) {
    alert("Please enter a numeric weight.");
    errfound++;
  } else if(weight < low || weight > high) {
    var ans = confirm("The weight you entered, "+weight+" is outside the range of "+low+" to "+high+". Click Ok to accept this weight, click Cancel to re-enter the weight.");
    if(!ans) errfound++;
  } else if(weight.indexOf(".") == -1 && decimal == 1) {
    var ans = confirm("The weight you entered does not contain a decimal. Click Ok to accept this weight, click Cancel to re-enter the weight to include a decimal.");
    if(!ans) errfound++;
  }
  if(errfound != 0) {
    var w = document.getElementById('weight');
    w.value = '';
    window.focus();
    w.focus();
    window.focus();
  }
}
