var f      = document.invoerform;
function opnieuw() {
	f.stand.value             = '';
	f.vulmaasw.selectedIndex  = 1;
	f.vuld.selectedIndex      = 0;
	f.draagmaasw.selectedIndex= 0;
	f.draagd.selectedIndex    = 0;
	f.luchtd.value            = '';
}

function berekenen(wat) {
	if (f.stand.value<=0 || f.stand.value>=90 || f.stand.value!=Math.floor(f.stand.value)) { f.stand.value = stand = 50 }
	else                                                                                   { stand = f.stand.value      }
	if (f.luchtd.value<=0 || f.luchtd.value>=100                                         ) { f.luchtd.value = luchtd = 50 }
	else                                                                                   { luchtd = f.luchtd.value      }
	vulmaasw   = Math.round(f.vulmaasw.options[f.vulmaasw.selectedIndex].value*100)/100;
	vuld       = Math.floor(f.vuld.options[f.vuld.selectedIndex].value);
	draagmaasw = Math.round(f.draagmaasw.options[f.draagmaasw.selectedIndex].value*100)/100;
	draagd     = Math.floor(f.draagd.options[f.draagd.selectedIndex].value);
	stand_cos = Math.cos(stand*(Math.PI/180));

	if ( wat == 'S' ) {
		f.stand.value = stand = Math.round(Math.acos(((luchtd*vulmaasw*draagmaasw)/((draagmaasw-draagd)*100)+vuld)/vulmaasw)*(180/Math.PI));
		stand_cos = Math.cos(stand*(Math.PI/180));
		wat = 'L'; // hierna de luchtdoorlaat herberekenen....
	}
	if ( wat == 'L' ) {
		f.luchtd.value = Math.round(((stand_cos*vulmaasw-vuld)*(draagmaasw-draagd)*100)/(vulmaasw*draagmaasw)*100)/100;
	}
}
