// -- AUTHOR: Filippo Spadaro
// -- PROGRAMMER: Filippo Spadaro
// -- LASTREVIEW: 3 agosto 2003
// -- SITE URL: http://utenti.lycos.it/nienteperniente

// -- rmbr: sostituire **test.js nelle importazioni JScript dei file HTML
// ##9
path = "19test.html";
// ##9
path_fine = "19test_fine.html";


// -- definizioni array --
var t = new Array();

var txtA = new Array();
var txtB = new Array();
var txtC = new Array();
var txtD = new Array();
var txtE = new Array();
var txtF = new Array();
var txtG = new Array();

var r = new Array();
var esatta = new Array();
commento = new Array();

// -- NB: l'utente deve riempire solo i campi:
// -- txt*[*], t[*], r[*], p*[*]

// -- NB: le prime 2 risposte A - B sono obbligatorie, 
// -- mentre  C - D - E - F - G si possono omettere, basta 
// -- inserire un campo vuoto txt*[*]=""; nella prima delle 
// -- cinque che non si vorrà visualizzare.

// -- * --
txtA[0]="<B>&nbsp;pagare&nbsp;&nbsp;</B>";
txtB[0]="<B>&nbsp;incollare&nbsp;&nbsp;</B>";
txtC[0]="<B>&nbsp;leggere&nbsp;&nbsp;</B>";
txtD[0]="<B>&nbsp;rubare&nbsp;&nbsp;</B>";
txtE[0]="<B>&nbsp;attaccare&nbsp;&nbsp;</B><BR>";
txtF[0]="<B>&nbsp;comprare&nbsp;&nbsp;</B>";
txtG[0]="<B>&nbsp;vangare&nbsp;&nbsp;</B>";
t[0]="Individua la parola da scartare:<BR>";
esatta[0] = "C";
commento[0] = ", è l'unico verbo di seconda coniugazione.";


// -- * --
txtA[1]="34&nbsp;&nbsp;&nbsp;";
txtB[1]="38&nbsp;&nbsp;&nbsp;";
txtC[1]="53&nbsp;&nbsp;&nbsp;";
txtD[1]="113&nbsp;&nbsp;&nbsp;";
txtE[1]="133&nbsp;&nbsp;&nbsp;";
txtF[1]="";
txtG[1]="";
t[1]="Inserisci il numero che completa la serie:<BR><B>2 - 3 - 7 - 13 - 27 - ...</B><BR><BR>";
esatta[1] = "C";
commento[1] = ", ogni numero è il doppio del precedente a cui si somma -1 o +1 in modo alterno.";

// -- * --
txtA[2]="<img src='19_02_c_domanda.gif' align=middle height=100>";
txtB[2]="<img src='19_02_f_domanda.gif' align=middle width=100>";
txtC[2]="<img src='19_02_e_domanda.gif' align=middle width=110><BR>";
txtD[2]="<img src='19_02_d_domanda.gif' align=middle height=100>";
txtE[2]="<img src='19_02_b_domanda.gif' align=middle width=100>";
txtF[2]="<img src='19_02_a_domanda.gif' align=middle height=100>";
txtG[2]="";
t[2]= "Se <img src='19_02_a_domanda.gif' width=100 align=middle> sta a <img src='19_02_b_domanda.gif' width=100 align=middle> allora <img src='19_02_c_domanda.gif' width=100 align=middle> sta a:<BR><BR>";
esatta[2] = "B";
commento[2] = "<BR>Nel passaggio dalla prima alla seconda figura la pallina rimane sempre nella stessa posizione e idem deve essere nel passaggio dalla terza alla quarta posizione; inoltre nella seconda figura ci sono due quadrati anneriti.";

// -- * --
txtA[3]="87-155-121&nbsp;";
txtB[3]="89-155-121&nbsp;";
txtC[3]="87-153-121&nbsp;";
txtD[3]="89-153-121&nbsp;";
txtE[3]="88-153-120&nbsp;";
txtF[3]="";
txtG[3]="";
t[3]= "Inserisci la terna di numeri mancanti nelle caselle vuote:<BR><img src='19_04_domanda.gif' width=420><BR><BR>";
esatta[3] = "D";
commento[3] = ", ogni numero su ogni riga è il doppio del precedente +1, +2, +3, +4, +5.";

// -- * --
txtA[4]="<img src='19_1130sport10.jpg' width=400><BR>";
txtB[4]="<img src='19_1130sport17.jpg' width=400><BR>";
txtC[4]="<img src='19_1130sport22.jpg' width=400><BR>";
txtD[4]="<img src='19_1203user13.jpg' width=400><BR>";
txtE[4]="<img src='19_1130sport20.jpg' width=400><BR>";
txtF[4]="";
txtG[4]="";
t[4]= "Quale delle seguenti immagini è l'intrusa?<BR>";
esatta[4] = "D";
commento[4] = "Le altre immagini riguardano tutte soggetti sportivi.";

// -- * --
txtA[5]="<img src='19fd00976a.gif' width=100>";  
txtB[5]="<img src='19fd00977a.gif' width=100>";  
txtC[5]="<img src='19fd00978a.gif' width=100>";  
txtD[5]="<img src='19fd00979a.gif' width=100>";  
txtE[5]="<img src='19fd00980a.gif' width=100>";  
txtF[5]="";  
txtG[5]="";  
t[5]= "Quale delle seguenti immagini è l'intrusa?<BR>";
esatta[5] = "A";
commento[5] = "<BR>Le altre immagini raffigurano alimenti, mentre la tazzina è un contenitore per alimenti.";


// -- * --
txtA[6]="<img src='19_07_c_domanda.gif' align=middle height=100>";     
txtB[6]="<img src='19_07_f_domanda.gif' align=middle width=100>";      
txtC[6]="<img src='19_07_e_domanda.gif' align=middle width=110><BR>";      
txtD[6]="<img src='19_07_d_domanda.gif' align=middle height=100>";     
txtE[6]="<img src='19_07_b_domanda.gif' align=middle width=100>";  
txtF[6]="<img src='19_07_a_domanda.gif' align=middle height=100>";     
txtG[6]="";  
t[6]= "Se <img src='19_07_a_domanda.gif' width=100 align=middle> sta a <img src='19_07_b_domanda.gif' width=100 align=middle> allora <img src='19_07_c_domanda.gif' width=100 align=middle> sta a:<BR><BR><BR>";
esatta[6] = "D";
commento[6] = "<BR>Nei primi due termini della proporzione si nota che, mentre lo spicchio nero si sposta in senso antiorario di 1/4 di giro, la pallina si sposta di 1/2 giro.";

// -- * --
txtA[7]="<img src='19_08_bs00012a.gif' width=100>"; 
txtB[7]="<img src='19_08_bs00831a.gif' width=100>";  
txtC[7]="<img src='19_08_en00512a.gif' width=100>";  
txtD[7]="<img src='19_08_hh01479a.gif' width=100>";  
txtE[7]="<img src='19_08_s00838a.gif' width=100>";  
txtF[7]="";  
txtG[7]="";  
t[7]= "Quale delle seguenti immagini è l'intrusa?<BR><BR>";
esatta[7] = "B";
commento[7] = "<BR>La calcolatrice non è un mezzo di comunicazione.";

// -- * --
txtA[8]="Lucia";
txtB[8]="Donatella";
txtC[8]="Patrizia";
txtD[8]="Daniela";
txtE[8]="Stefania";
txtF[8]="";
txtG[8]="";
t[8]= "Lucia è più alta di Donatella, ma non della sua amica Patrizia. Stefania, sorella di Donatella, è più bassa di Daniela, ma più alta di sua mamma Patrizia.<BR>Chi è la più bassa?<BR>";
esatta[8] = "B";
commento[8] = "";

// -- * --
txtA[9]="il manicomio, come veniva chiamato nel Medioevo e nelle epoche successive<BR><BR>";
txtB[9]="opera fortificata in muratura, con fenditure per il tiro delle artiglierie sistemate all'interno<BR><BR>";
txtC[9]="grande casa popolare, composta di numerosi appartamenti, tale da sembrare un labirinto";
txtD[9]="";
txtE[9]="";
txtF[9]="";
txtG[9]="";
t[9]= "La casamatta è:<BR>";
esatta[9] = "B";
commento[9] = "";


// -- funzioni --
function createTempCookie(name, value) {
  	document.cookie=name + "=" + value + ";";
}


function extractCookieValue(val) {
	if ((endOfCookie = document.cookie.indexOf(";", val)) == -1) {
		endOfCookie = document.cookie.length;
	}
  return unescape(document.cookie.substring(val,endOfCookie));
}


function ReadCookie(cookiename) {
	var numOfCookies = document.cookie.length;
	var nameOfCookie = cookiename + "=";
	var cookieLen = nameOfCookie.length;
	var x = 0;
	while (x <= numOfCookies) {
		var y = (x + cookieLen);
		if (document.cookie.substring(x, y) == nameOfCookie)
			return (extractCookieValue(y));
			x = document.cookie.indexOf(" ", x) + 1;
			if (x == 0)
				break;
  		}
	return (null);
}


function getData(i) {
	separatore = "#"
	var VecchioValore = ReadCookie("ordine");
	var NuovoValore = VecchioValore + separatore + document.forms[0].elements[i].name;
	test = parseInt(NuovoValore.charAt(0));
	if ((test > 0) && (test < 9))
	test = parseInt(NuovoValore.charAt(0)) + 1;
	else if (test == 9)
	test = 0;
	else if (test == 0)
	test = "X";
	createTempCookie("ordine", test + NuovoValore);
	//userCookie = ReadCookie("ordine");
}


function leggiDati() {
	userCookie = ReadCookie("ordine");
	var u = 1;
	var bool = 0;
	var totale = 0;
	var numero = new Array();
     	while (bool == 0) {
		if (userCookie.charAt(u) == "") 
			bool = 1;
		if (userCookie.charAt(u) == "#") {	 
			document.write("&nbsp;");
			u+=1;
		}
		if (userCookie.charAt(u) == "£") {
				u+=1;	
				totale = totale 
				+ parseInt(userCookie.charAt(u))*1000
				+ parseInt(userCookie.charAt(u+1))*100
				+ parseInt(userCookie.charAt(u+2))*10
				+ parseInt(userCookie.charAt(u+3));
		}
		u+=1;
	}
	document.write("<BR><FONT SIZE=4 FACE=\x22 courier new\x22 color=Maroon><B>Punteggio parziale: </B></FONT>" 
			+ "<FONT SIZE=5 FACE=\x22 courier new\x22 color=Navy><B>" 
			+ totale + "</B></FONT>");
}


function NuovoOrdine() {	
	createTempCookie("ordine", "1");
}


