function RJyears(){
	var today = new Date();
	Year = takeYear(today);
	document.write(Year);
}	
function takeYear(theDate)
{
	x = theDate.getYear();
	var y = x % 100;
	y += (y < 38) ? 2000 : 1900;
	return y;
}
var factors1 = new Array(1, 0.01, 0.039370,0.003280,0.0010936);
var factors2 = new Array(10, 1,0.39370,0.03280,0.010936);
var factors3 = new Array(25.4, 2.54, 1, 0.08333, 0.027777);
var factors4 = new Array(304.8, 30.48, 12, 1,0.33333);
var factors5 = new Array(914.4, 91.44, 36,3,1);
var factors = new Array(factors1,factors2,factors3,factors4,factors5);
function convert_unit(){
		from_index = document.length_con.from_unit.selectedIndex;
		to_index = document.length_con.to_unit.selectedIndex;
		factor = factors[from_index][to_index];
		//document.getElementById("formula").innerHTML = "1 "+document.length_con.from_unit.options[document.length_con.from_unit.selectedIndex].text + " = " + factor + " " + document.length_con.to_unit.options[document.length_con.to_unit.selectedIndex].text;
		if(isNaN(document.length_con.from_value.value))
			document.getElementById("to_value").innerHTML = "Not a valid number.";
		else
			var converted = factor * document.length_con.from_value.value;
			document.getElementById("to_value").innerHTML = document.length_con.from_value.value+" "+document.length_con.from_unit.options[document.length_con.from_unit.selectedIndex].text + " = " + Math.round(converted*100)/100 + " " + document.length_con.to_unit.options[document.length_con.to_unit.selectedIndex].text;
}