
			function decideConvert(temp, rh)
			{
				temp = parseFloat(document.Convert.Temp.value);
				rh = parseFloat(document.Convert.RelHum.value);
								
				if(rh > 100)
				{
					alert('A heat index value cannot be calculated for relative humidities greater than 100%.');
					document.Convert.Fahr.value="";
					document.Convert.Cels.value="";
					return 0;
				}
				
				if (document.Convert.tempunit[0].checked)
				{
					if (temp < 80)
					{
						alert('A heat index value cannot be calculated for temperatures less than 80 degrees Fahrenheit.');
						document.Convert.Fahr.value="";
						document.Convert.Cels.value="";
					}
					else
					{
						document.Convert.Fahr.value = roundOff(heatIndex(temp, rh));
						document.Convert.Cels.value = roundOff((convertFtoC(heatIndex(temp, rh))));
					}
				}

				if (document.Convert.tempunit[1].checked)
				{
					var F = convertCtoF(temp);
					
					if (F < 80)
					{
						alert('A heat index value cannot be calculated for temperatures less than 26.7 degrees Celsius.');
						document.Convert.Fahr.value="";
						document.Convert.Cels.value="";
					}
					else
					{
						document.Convert.Fahr.value = roundOff(heatIndex(F, rh));
						document.Convert.Cels.value = roundOff((convertFtoC(heatIndex(F, rh))));
					}
				}
			}
				
			function convertFtoC(Fahr)
			{
				var Celsius;
				Celsius= .55556 * (Fahr - 32);
				return Celsius;
			}

			function convertCtoF(Cels)
			{
				var Fahr;
				Fahr= 1.8 * Cels + 32;
				return Fahr;
			}

			function heatIndex(F, rh)
			{
				var Hindex;
				
				Hindex = -42.379 + 2.04901523*F + 10.14333127*rh 
					- 0.22475541*F*rh - 6.83783*Math.pow(10,-3)*F*F
					- 5.481717*Math.pow(10,-2)*rh*rh
					+ 1.22874*Math.pow(10,-3)*F*F*rh 
					+ 8.5282*Math.pow(10,-4)*F*rh*rh 
					- 1.99*Math.pow(10,-6)*F*F*rh*rh;
				return Hindex;
			}

			function getAns(temp)
			{
				return temp;
			}

			function roundOff(value)
			{
				value = Math.round(10*value)/10;
				return value;
			}

			function setToNull()
			{
				document.Convert.Fahr.value="";
				document.Convert.Cels.value="";
				document.Convert.RelHum.value="";
				document.Convert.Temp.value="";
			}
