// -- AUTHOR: Filippo Spadaro
// -- PROGRAMMER: Filippo Spadaro
// -- LASTREVIEW: 12 ottobre 2002
// -- SITE URL: http://utenti.lycos.it/nienteperniente

// -- rmbr: sostituire **test.js nelle importazioni JScript dei file HTML
// ##9
path = "07test.html";
// ##9
path_fine = "07test_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 r = new Array();
var esatta = new Array();
commento = new Array();



// -- NB: l'utente deve riempire solo i campi:
// -- txt*[*], t[*], r[*], p*[*]
// -- * --
txtA[0]="i migliori piedi del campionato";
txtB[0]="il miglior golfista della jet-society";
txtC[0]="la prima forchetta dell'entourage";
txtD[0]="la miglior mazza della nazionale di baseball";
t[0]="Quali tra le seguenti espressioni non è una sineddoche:<BR>";
esatta[0] = "B";
commento[0] = "Per sineddoche si intende una figura retorica che consiste nell'esprimere un'idea con una parola adoperata normalmente per indicare un'idea diversa ma avente con la prima un rapporto di quantità";


// -- * --
txtA[1]="ATM";
txtB[1]="ABS";
txtC[1]="ABM";
txtD[1]="BBS";
t[1]="Dispositivo di sicurezza, che attraverso sensori sui freni dei veicoli a motore, impedisce il bloccaggio delle ruote e quindi consente il controllo del mezzo in frenata:<BR>";
esatta[1] = "B";
commento[1] = " (Anti Blockier System), sistema antibloccaggio";

// -- * --
txtA[2]="net";
txtB[2]="ace";
txtC[2]="jam";
txtD[2]="set";
t[2]= "Nel tennis, battuta vincente:<BR>";
esatta[2] = "B";
commento[2] = "";

// -- * --
txtA[3]="commando";
txtB[3]="cast";
txtC[3]="embargo";
txtD[3]="truppa";
t[3]= "Un reparto (solitamente non molto numeroso) di soldati scelti per operazioni speciali particolarmente rischiose:<BR>";
esatta[3] = "A";
commento[3] = "";

// -- * --
txtA[4]="meat";
txtB[4]="cheap";
txtC[4]="spam";
txtD[4]="shit";
t[4]= "Di scarso valore, privo di classe:<BR>";
esatta[4] = "B";
commento[4] = "";

// -- * --
txtA[5]="utente";
txtB[5]="appassionato";
txtC[5]="aficionado";
txtD[5]="spettatore";
t[5]= "Assiduo frequentatore o tifoso:<BR>";
esatta[5] = "C";
commento[5] = "";

// -- * --
txtA[6]="gotha";
txtB[6]="cast";
txtC[6]="kermesse";
txtD[6]="fun club";
t[6]= "Cerchia ristretta di persone che emerge per qualità superiori:<BR>";
esatta[6] = "A";
commento[6] = "";

// -- * --
txtA[7]="jet-society";
txtB[7]="cast";
txtC[7]="elite";
txtD[7]="entourage";
t[7]= "Gruppo di persone che si distingue per cultura, ceto sociale, potere politico o economico:<BR>";
esatta[7] = "C";
commento[7] = "";

// -- * --
txtA[8]="exploit";
txtB[8]="chance";
txtC[8]="escamotage";
txtD[8]="fair play";
t[8]= "Un espediente che si mette in atto per eludere una difficoltà o per risolvere una situazione in modo abile e astuto:<BR>";
esatta[8] = "C";
commento[8] = "";

// -- * --
txtA[9]="niente affatto contento";
txtB[9]="affatto contento";
txtC[9]="affatto affatto contento";
txtD[9]="tutt'affatto contento";
t[9]= "Per nulla contento:<BR>";
esatta[9] = "A";
commento[9] = ". Affatto è un rafforzativo dell'aggettivo e vuol dire: interamente, del tutto, in tutto, per tutto; ma al negativo ha la stessa accezione di: nulla, per nulla, no, mai.";


// -- 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");
}

