function check(ad)
{
	var ch=ad.value;
	if(isNaN(ch))
	{
		var df=ch.substring(0,(ch.length-1))
		ad.value=df;
	}	
}

function calc()
{
	var o = document.wind.opt1.value;
	var o2 = document.wind.opt2.value;
	var t = document.wind.t.value;
	var w = document.wind.w.value;
	if(w<5){
		alert("Wind speeds of less than 5 MPH have no wind chill");
	}
	else{
		if(o=="c")
			t = (212-32)/100 * t + 32; //celsius to fahrenheit
		if(o2=="n")
			s = (1.15077945) * w;
		else if(o2=="k")
			var s = (0.621371192237334) * w;
		else
			s = w;
		var r1 = eval(Math.round(35.74+0.6215*t-35.75*Math.pow(s,0.16)+0.4275*t*Math.pow(s,0.16)));
		var r2 = eval(Math.round(100/(212-32) * ((35.74+0.6215*t-35.75*Math.pow(s,0.16)+0.4275*t*Math.pow(s,0.16))-32)));
		document.wind.r1.value = r1;
		document.wind.r2.value = r2;
	}
}



