	var F,G,O,T,W;

	function toFixed(getal,aantalCijfers) {
    		var pow=Math.pow(10,aantalCijfers);
    		return (Math.round(getal*pow))/pow;
	}

	function haalEigenschappen(profielNaam) {
		
  		switch(profielNaam) {
  			case "AZ 12":  	F=670;  G=66.1;  	O=1.65;	 T=18140;	W=1200;  break;  		
  			case "AZ 12-770": F=770;  G=72.6;  	O=1.85;	 T=21430;	W=1245;  break;
  			case "AZ 13":  	F=670;  G=72.0;  	O=1.65;	 T=19700;	W=1300;  break;
  			case "AZ 13-770": F=770;  G=76.1;  	O=1.85;	 T=22360;	W=1300;  break;
  			case "AZ 13-10":  F=670;  G=75.2;  	O=1.65;	 T=20480;	W=1350;  break;
  			case "AZ 14-770": F=770;  G=79.5;  	O=1.85;	 T=23300;	W=1355;  break;
  			case "AZ 14":  	F=670;  G=78.3;  	O=1.65;	 T=21300;	W=1400;  break;
  			case "AZ 14-770-10":  	F=770;  G=82.9;  	O=1.85;	 T=24240;	W=1405;  break;
  			case "AZ 17":  	F=630;  G=68.4;  	O=1.71;	 T=31580;	W=1665;  break;
			case "AZ 17-700": F=700;  G=73.1;  	O=1.86;	 T=36230;	W=1730;  break;
			case "AZ 18":  	F=630;  G=74.4;  	O=1.71;	 T=34200;	W=1800;  break;
			case "AZ 18-700": F=700;  G=76.5;  	O=1.86;	 T=37800;	W=1800;  break;
			case "AZ 18-10":  F=630;  G=77.8;  	O=1.71;	 T=35540;	W=1870;  break;
			case "AZ 19":  	F=630;  G=81.0;  	O=1.71;	 T=36980;	W=1940;  break;
			case "AZ 19-700": F=700;  G=80.0;  	O=1.86;	 T=39380;	W=1870;  break;
			case "AZ 20-700": F=700;  G=83.5;  	O=1.86;	 T=40960;	W=1945;  break;
			case "AZ 24-700": F=700;  G=95.7;  	O=1.93;	 T=55820;	W=2430;  break;
   		case "AZ 25":  	F=630;  G=91.5;  	O=1.78;	 T=52250;	W=2455;  break;
			case "AZ 26":  	F=630;  G=97.8;  	O=1.78;	 T=55510;	W=2600;  break;
			case "AZ 26-700": F=700;  G=102.9;  O=1.93;	 T=59720;	W=2600;  break;
			case "AZ 28":  	F=630;  G=104.4;  O=1.78;	 T=58940;	W=2755;  break;
			case "AZ 28-700": F=700;  G=110;  	O=1.93;	 T=63620;	W=2760;  break;
			case "AZ 37-700": F=700;  G=124.2;  O=2.04;	 T=92400;	W=3705;  break;
			case "AZ 39-700": F=700;  G=131.9;  O=2.04;	 T=97500;	W=3900;  break;
			case "AZ 41-700": F=700;  G=139.5;  O=2.04;	 T=102610;	W=4095;  break;
			case "AZ 46":  	F=580;  G=132.6;  O=1.89;	 T=110450;	W=4595;  break;
			case "AZ 48":  	F=580;  G=139.6;  O=1.89;	 T=115670;	W=4800;  break;
			case "AZ 50":  	F=580;  G=146.7;  O=1.89;	 T=121060;	W=5015;  break;

			case "AU 14":  	F=750;  G=77.9;  	O=1.91;	 T=28680;	W=1405;  break;
			case "AU 16":  	F=750;  G=86.3;  	O=1.91;	 T=32850;	W=1600;  break;
			case "AU 17":  	F=750;  G=89.0;  	O=1.91;	 T=34270;	W=1665;  break;
			case "AU 18":  	F=750;  G=88.5;  	O=2.00;	 T=39300;	W=1780;  break;
			case "AU 20":  	F=750;  G=96.9;  	O=2.00;	 T=44440;	W=2000;  break;
			case "AU 21":  	F=750;  G=99.7;  	O=2.00;	 T=46180;	W=2075;  break;
			case "AU 23":  	F=750;  G=102.1;  O=2.04;	 T=50700;	W=2270;  break;
			case "AU 25":  	F=750;  G=110.4;  O=2.04;	 T=56240;	W=2500;  break;
			case "AU 26":  	F=750;  G=113.2;  O=2.04;	 T=58140;	W=2580;  break;
			
			case "PU 6R":  	F=600;  G=42.2;  	O=1.51;	 T=8940;	   W=640;   break;
			case "PU 7R":  	F=600;  G=44.3;  	O=1.51;	 T=9580;	   W=685;   break;
			case "PU 8R":  	F=600;  G=48.7;  	O=1.51;	 T=10830;	W=775;   break;
			case "PU 9R":  	F=600;  G=49.5;  	O=1.62;	 T=16930;	W=940;   break;
			case "PU 10R":  	F=600;  G=53.8;  	O=1.62;	 T=18960;	W=1055;  break;
			case "PU 11R":  	F=600;  G=58.1;  	O=1.62;	 T=20960;	W=1165;  break;
			case "PU 13R":  	F=675;  G=65.6;  	O=1.78;	 T=25690;	W=1285;  break;
			case "PU 14R":  	F=675;  G=70.5;  	O=1.78;	 T=28000;	W=1400;  break;
			case "PU 15R":  	F=675;  G=75.4;  	O=1.78;	 T=30290;	W=1515;  break;
			
			case "PU 12":  	F=600;  G=66.1;  	O=1.59;	 T=21600;	W=1200;  break;
			case "PU 12-10":  F=600;  G=69.6;  	O=1.59;	 T=22580;	W=1255;  break;
			case "PU 18":  	F=600;  G=76.9;  	O=1.72;	 T=38650;	W=1800;  break;
			case "PU 22":  	F=600;  G=86.1;  	O=1.79;	 T=49460;	W=2200;  break;
			case "PU 28":  	F=600;  G=101.8;  O=1.85;	 T=64460;	W=2840;  break;
			case "PU 32":  	F=600;  G=114.1;  O=1.83;	 T=72320;	W=3200;  break;
			
			case "GU 6N":     F=600;  G=41.9;  	O=1.51;	 T=9670;	   W=625;   break;
			case "GU 7N":     F=600;  G=44.1;  	O=1.51;	 T=10450;	W=675;   break;
			case "GU 7S":  	F=600;  G=46.2;  	O=1.51;	 T=11540;	W=740;   break;
			case "GU 8N":  	F=600;  G=48.5;  	O=1.51;	 T=12010;	W=770;   break;
			case "GU 12-500": F=500;  G=56.6;  	O=1.44;	 T=19640;	W=1155;  break;
			case "GU 13-500": F=500;  G=60.8;  	O=1.44;	 T=21390;	W=1260;  break;
			case "GU 15-500": F=500;  G=69.3;  	O=1.44;	 T=24810;	W=1460;  break;
			case "GU 16-400": F=400;  G=62.0;  	O=1.28;	 T=22580;	W=1560;  break;
			case "GU 18-400": F=400;  G=69.3;  	O=1.28;	 T=26090;	W=1785;  break;
   		}   		
  	}
  	
  	function bereken3() {
		var L=parseFloat(document.formulier3.L.value.replace(/\,/,"."));
		var H=parseFloat(document.formulier3.H.value.replace(/\,/,"."));
		
  		var sel = document.formulier3.profiel.selectedIndex;
  		var profiel=document.formulier3.profiel.options[sel].text;
   		haalEigenschappen(profiel);

  		var GW=(L/F)*G*H;
   		document.formulier3.GW.value=(toFixed(GW,3)+"");   		
   		var AD=L*1000/(F*2);
   		document.formulier3.AD.value=(toFixed(AD,2)+"");
 		var AE=L*1000/F;
  		document.formulier3.AE.value=(toFixed(AE,2)+"");
		return false; 
  	}  	
  	
	function bereken1() {
		var A=parseFloat(document.formulier1.A.value.replace(/\,/,"."));
		var B=parseFloat(document.formulier1.B.value.replace(/\,/,"."));
		var H=parseFloat(document.formulier1.H.value.replace(/\,/,"."));	
		
  		var sel = document.formulier1.profiel.selectedIndex;
  		var profiel=document.formulier1.profiel.options[sel].text;
  		haalEigenschappen(profiel); 		
   		
   		var L=(A*2+B)*F/1000;
  		document.formulier1.L.value=(toFixed(L,2)+"");
   		var D=L*H;
  		document.formulier1.D.value=(toFixed(D,2)+"");
  		var K=(A*2+B)*G*H/1000;
  		document.formulier1.K.value=(toFixed(K,3)+"");
		return false; 
  	}
  	
  	function bereken2() {
		var A=parseFloat(document.formulier2.A.value.replace(/\,/,"."));
		var B=parseFloat(document.formulier2.B.value.replace(/\,/,"."));
		var H1=parseFloat(document.formulier2.H1.value.replace(/\,/,"."));
		var H2=parseFloat(document.formulier2.H2.value.replace(/\,/,"."));	
		
  		var sel = document.formulier2.profiel.selectedIndex;
  		var profiel=document.formulier2.profiel.options[sel].text;
   		haalEigenschappen(profiel);
   		
  		var C1=(A+B/2)*O*H1;
   		document.formulier2.C1.value=(toFixed(C1,2)+"");
   		var C2=(A+B/2)*O*H2;
   		document.formulier2.C2.value=(toFixed(C2,2)+"");
 		var CT=C1+C2;
  		document.formulier2.CT.value=(toFixed(CT,3)+"");
		return false; 
  	}
  	
  	function bereken4() {
  		var sel = document.formulier4.profiel.selectedIndex;
  		var profiel=document.formulier4.profiel.options[sel].text;
   		haalEigenschappen(profiel);

  		document.formulier4.T.value=(toFixed(T,2)+"");
  		document.formulier4.W.value=(toFixed(W,2)+"");
  		
  		var sel = document.formulier4.nuance.selectedIndex;
  		var nuance=document.formulier4.nuance.options[sel].text;
   		var R;
  		switch(nuance) {
  			case "S 240 GP":  R=240;  	break;
  			case "S 270 GP":  R=270;  	break;
  			case "S 320 GP":  R=320;  	break;
  			case "S 355 GP":  R=355;  	break;
  			case "S 390 GP":  R=390;  	break;
  			case "S 430 GP":  R=430;  	break;
  			case "S 460 AP":  R=460;  	break;
  		}
  		moment=W*R/1000;
  		document.formulier4.moment.value=(Math.round(moment)+"");
		return false; 
  	} 
