
emptyFrame="";
function calc() {
var currentOffset="";
var currentWidth,newWidth,newOffset,currentInsideWidth,newInsideWidth,currentOutsideWidth,newOutsideWidth;
with (document.kereketkalkulator) {
currentWidth=CWW.value*25.4;
newWidth=NWW.value*25.4;
currentOffset=CWO.value;
newOffset=NWO.value;
}	
currentInsideWidth =(currentWidth/2) + parseInt(currentOffset);
currentOutsideWidth=(currentWidth/2) - parseInt(currentOffset);
newInsideWidth =(newWidth/2) + parseInt(newOffset);
newOutsideWidth=(newWidth/2) - parseInt(newOffset);
distance= (currentInsideWidth-newInsideWidth);
if (Math.round(distance)<0) {
out = "beljebb lesz ";
out += Math.round(Math.abs(distance));
out += " mm-el";
}
else if (Math.round(distance)>0) {
out = "beljebb lesz ";
out += Math.round(Math.abs(distance));
out += " mm-el";
}
else {
out ="NEM VÁLTOZIK";
}
if (Math.round(newOutsideWidth-currentOutsideWidth)>0) {
out2 = "kijjebb lesz ";		
out2 +=Math.round(Math.abs(newOutsideWidth-currentOutsideWidth));
out2 +=" mm-el";
}
else if (Math.round(newOutsideWidth-currentOutsideWidth)<0) {
out2 = "beljebb lesz ";
out2 +=Math.round(Math.abs(newOutsideWidth-currentOutsideWidth));
out2 +=" mm-el";
}
else {
out2 = "NEM VÁLTOZIK";
}
with (document) {
document.kereketkalkulator.strut.value = out;
document.kereketkalkulator.wheeloutside.value = out2;		
}
}
function COL() {
with (document.kereketkalkulator) {
CWO.value=CWO.value-1;
}
calc();
}
function COR() {
with (document.kereketkalkulator) {
CWO.value=parseInt(CWO.value)+1;
}
calc();
}
function NOL() {
with (document.kereketkalkulator) {
NWO.value=NWO.value-1;
}
calc();
}
function NOR() {
with (document.kereketkalkulator) {
NWO.value=parseInt(NWO.value)+1;
}
calc();
}
