function toPSI(form) {
	form.prBAR.value = chK(form.prBAR.value);
	form.prPSI.value=Math.round(form.prBAR.value*14532.6)/1000;
	checkTotalEffect();
}
function toBAR(form) {
	form.prPSI.value = chK(form.prPSI.value);
	form.prBAR.value=Math.round(form.prPSI.value/14.5326);
	checkTotalEffect();
}
function toGALus(form) {
	form.qUSg.value = chK(form.qUSg.value);
	form.qUKg.value=Math.round(form.qUSg.value*8.497)/10;
	form.qLit.value=Math.round(100*form.qUSg.value*3.785)/100;
	checkTotalEffect();
}
function toGALuk(form) {
	form.qUKg.value = chK(form.qUKg.value);
	form.qUSg.value=Math.round(form.qUKg.value*11.769)/10;
	form.qLit.value=Math.round(100*form.qUKg.value*4.546)/100;
	checkTotalEffect();
}
function toLit(form) {
	form.qLit.value = chK(form.qLit.value);
	form.qUSg.value=Math.round(100*form.qLit.value/3.785)/100;
	form.qUKg.value=Math.round(100*form.qLit.value/4.546)/100;
	checkTotalEffect();
}
function toKW(form) {
	form.effHP.value = chK(form.effHP.value);
	form.effKW.value=Math.round(form.effHP.value*7.477)/10;
}
function toHP(form) {
	form.effKW.value = chK(form.effKW.value);
	form.effHP.value=Math.round(form.effKW.value*13.359)/10;
}
function checkTotalEffect(form) {
	if (document.conv.qLit.value==0) { quit(); }
	if (document.conv.prBAR.value==0) { quit(); }
	document.conv.effKW.value=Math.round((document.conv.qLit.value*document.conv.prBAR.value)/600);
	document.conv.effHP.value=Math.round((document.conv.qUSg.value*document.conv.prPSI.value)/1400);
}
// 2002-08-21 
// tillägg efter mötet
function fromM(form) {
	form.lengthM.value = chK(form.lengthM.value);
	form.lengthFT.value=Math.round(1000*(form.lengthM.value*0.3280839895))/100;
	form.lengthYARD.value=Math.round(1000*(form.lengthM.value*0.10936))/100;
}
function fromFT(form) {
	form.lengthFT.value = chK(form.lengthFT.value);
	form.lengthM.value=Math.round(1000*(form.lengthFT.value*0.0304803706))/100;
	form.lengthYARD.value=Math.round(1000*(form.lengthFT.value/33))/100;
}
function fromYARD(form) {
	form.lengthYARD.value = chK(form.lengthYARD.value);
	form.lengthM.value=Math.round(1000*(form.lengthYARD.value*0.09144))/100;
	form.lengthFT.value=Math.round(1000*(form.lengthYARD.value*3))/100;
}
function fromM2(form) {
	form.areaM2.value = chK(form.areaM2.value);
	form.areaFT2.value=Math.round(1000*(form.areaM2.value*1.0764))/100;
	form.areaYARD.value=Math.round(1000*(form.areaM2.value*.1196))/100;
}
function fromFT2(form) {
	form.areaFT2.value = chK(form.areaFT2.value);
	form.areaM2.value=Math.round(1000*(form.areaFT2.value*0.00929))/100;
	form.areaYARD.value=Math.round(1000*(form.areaFT2.value*.01111))/100;
}
function fromYARD2(form) {
	form.areaYARD.value = chK(form.areaYARD.value);
	form.areaM2.value=Math.round(1000*(form.areaYARD.value*0.08361))/100;
	form.areaFT2.value=Math.round(1000*(form.areaYARD.value*.9))/100;
}
function fromM3(form) {
	form.volM3.value = chK(form.volM3.value);
	form.volFT3.value=Math.round(1000*(form.volM3.value*3.5316))/100;
	form.volYARD.value=Math.round(1000*(form.volM3.value*.13080))/100;
}
function fromFT3(form) {
	form.volFT3.value = chK(form.volFT3.value);
	form.volM3.value=Math.round(1000*(form.volFT3.value*0.00283))/100;
	form.volYARD.value=Math.round(1000*(form.volFT3.value*0.00370383))/100;
}
function fromYARD3(form) {
	form.volYARD.value = chK(form.volYARD.value);
	form.volM3.value=Math.round(1000*(form.volYARD.value*.0764526))/100;
	form.volFT3.value=Math.round(1000*(form.volYARD.value*2.6999082))/100;
}
function toPN(form) {
	form.weightKG.value = chK(form.weightKG.value);
	form.weightPN.value=Math.round(1000*(form.weightKG.value*0.22046))/100;
}
function toKG(form) {
	form.weightPN.value = chK(form.weightPN.value);
	form.weightKG.value=Math.round(1000*(form.weightPN.value*0.04536))/100;
}
function toFTLBF(form) {
	form.torqNM.value = chK(form.torqNM.value);
	form.torqFT.value=Math.round(1000*(form.torqNM.value*0.0738))/100;
}
function toNM(form) {
	form.torqFT.value = chK(form.torqFT.value);
	form.torqNM.value=Math.round(1000*(form.torqFT.value*0.1356))/100;
}
function quit() {
	;
}
// 2002-10-24 22:22
// rensa ur komma o ersätt med punkt
function chK(varde) {
	komma = ","; punkt = "."; temp = "" + varde; 
	while (temp.indexOf(komma)>-1) {
		pos = temp.indexOf(komma);
		temp = "" + (temp.substring(0, pos) + punkt + temp.substring((pos + komma.length), temp.length));
		}
	return temp;
}


