/*-- scripts by Thomas Schmidt & Daniel Schötz*/

<!-- ---------------------by-EL-ZORRO---------------------------------------------------------------- 
 
 var  
     MyAnzahl  = 150;                           <!-- Anzahl der Fragen multiplizerit mit 5 A/B/C/D/E -->  
	 MyFinal   = new Array( 0,0,0,1,0,
							0,0,0,0,1,
							0,1,0,0,0,
							0,0,1,0,0,
							1,0,0,0,0,
							0,1,0,0,0,
							0,0,0,1,0,
							1,0,0,0,0,
							0,0,0,1,0,
							0,1,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,0,1,0,0,
							0,0,1,0,0,
							0,0,0,0,1,
							1,0,0,0,0,
							0,0,0,1,0,
							0,0,0,1,0,
							0,0,1,0,0,
							0,0,0,0,1,
							0,1,0,0,0,
							1,0,0,0,0,
							0,1,0,0,0,
							0,0,0,1,0,
							1,0,0,0,0,
							0,0,0,0,1,
							0,0,0,1,0); 
                                               <!-- Ergebnismatrix ---------------------  --> 
     MyTest    = new Array(MyAnzahl);          <!-- Teilnehmermatrix -------------------- --> 
     MyClose   = 0;
	 MyPunkte  = 30;
 
 
 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 = 30;       
    MyCheck(); 
    for(i = 0; i < MyAnzahl; i++) 
    { 
       if((MyFinal[i] == 1) && (MyTest[i] == MyFinal[i]))
	   {
	     if ((i >= 0) && (i < 50))
	       MyPunkte = MyPunkte +3;
		 if ((i >= 50) && (i < 100)) 
	       MyPunkte = MyPunkte +4;
		 if ((i >= 100) && (i < 150)) 
	       MyPunkte = MyPunkte +5;
	   } 
	   if((MyFinal[i] == 0) && (MyTest[i] != MyFinal[i]))
	   {
	      if ((i >= 0) && (i < 50))
	         MyPunkte = MyPunkte -0.75;
		 if ((i >= 50) && (i < 100)) 
	        MyPunkte = MyPunkte -1;
		 if ((i >= 100) && (i < 150)) 
	        MyPunkte = MyPunkte -1.25;
	   } 
     }
	 //alert(MyPunkte + " Punkte");
	 //document.location.href = "./zertifikat/formular5_6.htm#" + MyPunkte;
	 //document.MyForm.punkte.value = MyPunkte;
	 
	 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 --*/
