function RH(humidity){
  var A = 8.1332;
  var B = 1762.39;
  var C = 235.66;
  var u1 = humidity.corf[0].checked;
  var u2 = humidity.corf[1].checked;
  var u3 = humidity.corf[2].checked;

 if (u1 == true) {

    var ta = parseInt((humidity.airtemp.value-32)/1.8);
    var td = parseInt((humidity.dewpoint.value-32)/1.8);
	} else {
	if (u3 == true) {
	  var ta = parseInt(humidity.airtemp.value-273.14);
	  var td = parseInt(humidity.dewpoint.value-273.14);
	} else {

	  var ta = parseInt(humidity.airtemp.value);
	  var td = parseInt(humidity.dewpoint.value);
    }
  }
  var pa1 = A - B/(ta + 235.66);
  var pa = Math.pow(10, pa1);
  var pd1 = A - B/(td + 235.66);
  var pd = Math.pow(10, pd1);
  if (ta < td){
      alert("Your dew point temperature cannot be higher than the air temperature.  Click on reset and try again!");
    }
    else{
    res = (pd/pa)*100;
    humidity.relativeh.value = Math.round(res) + "%";
    }
}
function clearhumidity(form){
form.relativeh.value = "";
form.airtemp.value = "";
form.dewpoint.value = "";
}