function roundit(which){
	return Math.round(which*1000)/1000;
}
 
function mmconvert(){
	with (document.cminch)
		{
			cm.value = roundit(mm.value*100);
			feet.value = roundit((mm.value*100)/30.48);
			inch.value = roundit((mm.value*100)/2.54);
		}
	}
 
function cmconvert(){
	with (document.cminch){
		feet.value = roundit(cm.value/30.48);
		inch.value = roundit(cm.value/2.54);
		mm.value = roundit(cm.value/100);
	}
}
 
function inchconvert(){
	with (document.cminch){
		cm.value = roundit(inch.value*2.54);
		feet.value=roundit(inch.value/12);
		mm.value=roundit(cm.value/100);
	}
}
 
function feetconvert(){
	with (document.cminch){
		cm.value=roundit(feet.value*30.48);
		inch.value=roundit(feet.value*12);
		mm.value = roundit(cm.value/100);
	}
}

