var risF =new Array('A', 'C', 'B', 'C', 'C', 'B', 'A', 'A');
var risI =new Array('A', 'C', 'B', 'C', 'C', 'B', 'A', 'A');
var risT =new Array('A', 'C', 'B', 'C', 'C', 'B', 'A', 'A');
var vetRisp =new Array();

var vetLingua =new Array();

vetLinguaRF =new Array();
vetLinguaRF[0] ="Tu es un très mauvais citoyen Européen parce que tu ne connais pas l'Europe. Tu dois étudier!!!";
vetLinguaRF[1] ="Tu es un bon citoyen Européen, mais tu dois mieux te renseigner.";
vetLinguaRF[2] ="Tu es un parfait citoyen Européen. Sincères félicitations.";

vetLinguaRI =new Array();
vetLinguaRI[0] ="You are a very bad European Citizen because you don’t know the Europe, study!!!";
vetLinguaRI[1] ="You are a good European Citizen, but you have to get more information about Europe.";
vetLinguaRI[2] ="You are a perfect European Citizen, congratulations!!";


vetLinguaRT =new Array();
vetLinguaRT[0] ="Du bist ein schlechter Europabuerger, weil du nicht gut Europa kennst. Lerne!!! ";
vetLinguaRT[1] ="Du bist ein guter Europaer, aber du musst dir mehr Informationen ueber Europa besorgen!!!";
vetLinguaRT[2] ="Du bist ein perfekter Europabuerger, wir gratulieren!!";

vetLingua["F"] =vetLinguaRF;
vetLingua["I"] =vetLinguaRI;
vetLingua["T"] =vetLinguaRT;

var vetLinguaPunti =new Array();
vetLinguaPunti["F"] ="<p>UN POINT POUR CHAQUE RÉPONSE EXACTE! <br>";
vetLinguaPunti["I"] ="<p>ONE POINT FOR EACH CORRECT ANSWER! <br>";
vetLinguaPunti["T"] ="<p>EIN PUNKT FUER JEDE RICHTIGE ANTWORT! <br>";
var vetLinguaTotale =new Array();
vetLinguaTotale["F"] ="Point(s) ";
vetLinguaTotale["I"] ="Total Point(s) ";
vetLinguaTotale["T"] ="Totale Punkte ";
vetLinguaSoluzione =new Array();
vetLinguaSoluzione["F"] ="SOLUTION <p>";
vetLinguaSoluzione["I"] ="SOLUTION <p>";
vetLinguaSoluzione["T"] ="LÖSUNG <p>";


//vetLinguaInvia["F"] ="Envoyer - Effacer - Fermer -  selectionner les questions";

vetLinguaInvia =new Array();
vetLinguaInvia["F"] ="Envoyer";
vetLinguaInvia["I"] ="Submit";
vetLinguaInvia["T"] ="Sende";

vetLinguaSelezioneCompleta =new Array();
vetLinguaSelezioneCompleta["F"] ="Selectionner les questions!";
vetLinguaSelezioneCompleta["I"] ="Select all questions!";
vetLinguaSelezioneCompleta["T"] ="Wähle alle Fragen aus!";

vetLinguaChiudi =new Array();
vetLinguaChiudi["F"] ="Fermer";
vetLinguaChiudi["I"] ="Close";
vetLinguaChiudi["T"] ="Schliess";


function vR(m, tip)
{
       var selePunti =0;
       var j =0;
       for (x =0; x <m.length; x++)
       {
            if (m.elements[x].type =="radio")
            {
                   if (m.elements[x].checked)
                        vetRisp[j++] =m.elements[x].value;
            }
       }
       if (j <8)
            alert(vetLinguaSelezioneCompleta[tip]);
       else
       {
             var punti =0;
             for (j =0; j <8; j++)
             {
                      switch(tip)
                      {
                          case "F" : if (risF[j] ===vetRisp[j])
                                         punti++;
                                     break;

                          case "I" : if (risI[j] ===vetRisp[j])
                                         punti++;
                                     break;

                          case "T" : if (risT[j] ===vetRisp[j])
                                         punti++;
                                     break;
                     }
             }
             switch(punti)
             {
                  case 0 :
                  case 1 :
                  case 2 : selePunti =0; break;
                  case 3 :
                  case 4 :
                  case 5 :
                  case 6 : selePunti =1; break;
                  default : selePunti =2;
             }
             var soluzione =new Array();
             switch(tip)           
             {
                    case "F" : soluzione =risF; break;
                    case "I" : soluzione =risI; break;
                    case "T" : soluzione =risT; break;
             }
             var str ="";
             for (x =0; x<8; x++)
             {
                   str +=(x+1)+" "+soluzione[x]+",";
             }
             
             var solVet =new Array('A', 'B', 'C');
             str ="<table border =1><tr>";
             for (j =0; j <soluzione.length +1; j++)
             {
                   str +="<td>"+(j !=0 ? j : "")+"</td>";
             }
             str +="</tr>";
             for (x =0; x <solVet.length; x++)
             {
                  str +="<tr><td>"+solVet[x]+"</td>";
                  for (j =0; j <soluzione.length; j++)
                  {
                        str +="<td>"+(solVet[x] ==soluzione[j] ? "X" : "&nbsp;")+"</td>";
                  }
                  str +="</tr>";
             }
             str +="</table>";             

 
             var risultato ="<center>"+vetLinguaSoluzione[tip]+str+"<p>"+vetLinguaPunti[tip]+"<br>"+vetLinguaTotale[tip]+punti+"</center>   "+vetLingua[tip][selePunti];
          
             var txt =document.getElementById("desBoxWin");
             txt.innerHTML =risultato;

             document.helpBoxWin.chiudiHelpWin.value =vetLinguaChiudi[tip];

             var box =document.getElementById("helpwinbox");
             box.style.visibility="visible";
       }
}

function chiudiHelpBoxWin()
{
   var box =document.getElementById("helpwinbox");
   box.style.visibility="hidden";
}