/*-- scripts by Thomas Schmidt & Daniel Schötz */

<!-- ---------------------by-EL-ZORRO---------------------------------------------------------------- 
 
 var  
     MyAnzahl  = 105;                           <!-- Anzahl der Fragen multiplizerit mit 5 A/B/C/D/E -->  
     MyFinal   = new Array( 0,0,0,1,0,
							0,0,1,0,0,
							0,1,0,0,0,
							0,0,0,0,1,
							0,0,1,0,0,
							0,0,0,0,1,
							0,1,0,0,0,
							1,0,0,0,0,
							0,0,0,0,1,
							0,0,1,0,0,
							0,0,0,1,0,
							0,0,0,0,1,
							0,1,0,0,0,
							0,1,0,0,0,
							1,0,0,0,0,
							0,0,0,1,0,
							0,0,0,0,1,
							0,0,1,0,0,
							1,0,0,0,0,
							0,1,0,0,0,
							0,0,0,0,1); 
                                               <!-- Ergebnismatrix ---------------------  --> 
     MyTest    = new Array(MyAnzahl);          <!-- Teilnehmermatrix -------------------- --> 
     MyClose   = 0;
	 MyPunkte  = 21;
 
 
 function MyCheck()                            <!-- Einlesen der Teilnehmermatrix ------- -->  
  { 
    for(i = 0; i < MyAnzahl; i++) 
     { 
       if(document.MyForm.elements[i].checked == true)  
	   {
         MyTest[i]=1; 
	   }	 
       else 
         MyTest[i]=0; 
     } 
  } 
 
  
 function MyErgebnis()                         <!-- Vergleich mit Ergebnismatrix -------- --> 
  { 
    var j = 0; 
    MyPunkte = 21;       
    MyCheck(); 
    for(i = 0; i < MyAnzahl; i++) 
    { 
       if((MyFinal[i] == 1) && (MyTest[i] == MyFinal[i]))
	   {
	     if ((i >= 0) && (i < 35))
	       MyPunkte = MyPunkte +3;
		 if ((i >= 35) && (i < 70)) 
	       MyPunkte = MyPunkte +4;
		 if ((i >= 70) && (i < 105)) 
	       MyPunkte = MyPunkte +5;
	   } 
	   if((MyFinal[i] == 0) && (MyTest[i] != MyFinal[i]))
	   {
	      if ((i >= 0) && (i < 35))
	         MyPunkte = MyPunkte -0.75;
		 if ((i >= 35) && (i < 70)) 
	        MyPunkte = MyPunkte -1;
		 if ((i >= 70) && (i < 105)) 
	        MyPunkte = MyPunkte -1.25;
	   } 
     }
	Check = confirm("Dein Ergebnis: " + MyPunkte + " Punkte.\nMöchtest du jetzt dein Zertifikat bestellen?");
	if(Check == false) document.location.href = "#"; 
	if(Check == true){
		//document.location.href = "./zertifikat/formular3_4.htm#" + MyPunkte;
		//document.location.href = "./zertifikat/test.php#" + MyPunkte;
		document.MyForm.punkte.value = MyPunkte;
		document.MyForm.submit();
	}
  } 
 
/*-- ende --*/
