// -- AUTHOR: Filippo Spadaro
// -- PROGRAMMER: Filippo Spadaro
// -- LASTREVIEW: 12 maggio 2001 
// -- SITE URL: http://www.geocities.com/nienteperniente

// -- rmbr: sostituire **test.js nelle importazioni JScript dei file HTML
path = "03test.html";
path_fine = "03test_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 pA = new Array();
var pB = new Array();
var pC = new Array();
var pD = new Array();


// -- NB: l'utente deve riempire solo i campi:
// -- txt*[*], t[*], r[*], p*[*]
// -- * --
txtA[0]="consuetudine";
txtB[0]="staticitą";
txtC[0]="sinteticitą";
txtD[0]="teoria";
t[0]="Quale tra le seguenti parole ha un significato che maggiormente si avvicina al contrario di \x22pratica\x22:<BR>" + txtA[0] + ", " + txtB[0] + ", " + txtC[0] + ", " + txtD[0] + "?";
r[0]=txtA[0];
pA[0]=0;pB[0]=0;pC[0]=0;pD[0]=1;

// -- * --
txtA[1]="levigatezza";
txtB[1]="ruvidezza";
txtC[1]="differenza";
txtD[1]="aviditą";
t[1]="Quale tra le seguenti parole ha un significato che maggiormente si avvicina a \x22ruviditą\x22:<BR>" + txtA[1] + ", " + txtB[1] + ", " + txtC[1] + ", " + txtD[1] + "?";
r[1]=txtB[1];
pA[1]=0;pB[1]=1;pC[1]=0;pD[1]=0;

// -- * --
txtA[2]="pestare";
txtB[2]="nitrire";
txtC[2]="ingannare";
txtD[2]="abbaiare";
t[2]= "Quali tra le seguenti parole č sinonimo di \x22irretire\x22:<BR>" + txtA[2] + ", " + txtB[2] + ", " + txtC[2] + ", " + txtD[2] + "?";
r[2]=txtC[2];
pA[2]=0;pB[2]=0;pC[2]=1;pD[2]=0;

// -- * --
txtA[3]="avvenente";
txtB[3]="nullatenente";
txtC[3]="adatto";
txtD[3]="inadeguato";
t[3]= "Quale tra le seguenti parole ha un significato che maggiormente si avvicina a \x22conveniente\x22:<BR>" + txtA[3] + ", " + txtB[3] + ", " + txtC[3] + ", " + txtD[3] + "?";
r[3]=txtC[3];
pA[3]=0;pB[3]=0;pC[3]=1;pD[3]=0;

// -- * --
txtA[4]="denigrare";
txtB[4]="rimanere";
txtC[4]="maturare";
txtD[4]="emigrare";
t[4]= "Quale tra le seguenti parole ha un significato che maggiormente si avvicina a \x22migrare\x22:<BR>" + txtA[4] + ", " + txtB[4] + ", " + txtC[4] + ", " + txtD[4] + "?";
r[4]= txtD[4];
pA[4]=0;pB[4]=0;pC[4]=0;pD[4]=1;

// -- * --
txtA[5]="progresso";
txtB[5]="deterioramento";
txtC[5]="regresso";
txtD[5]="accampamento";
t[5]= "Quale tra le seguenti parole ha un significato che maggiormente si avvicina a \x22miglioramento\x22:<BR>" + txtA[5] + ", " + txtB[5] + ", " + txtC[5] + ", " + txtD[5] + "?";
r[5]= txtA[5];
pA[5]=1;pB[5]=0;pC[5]=0;pD[5]=0;

// -- * --
txtA[6]="rampante";
txtB[6]="imponente";
txtC[6]="offuscato";
txtD[6]="luminoso";
t[6]= "Quale tra le seguenti parole ha un significato che maggiormente si avvicina al contrario di \x22lampante\x22:<BR>" + txtA[6] + ", " + txtB[6] + ", " + txtC[6] + ", " + txtD[6] + "?";
r[6]= txtC[6];
pA[6]=0;pB[6]=0;pC[6]=1;pD[6]=0;

// -- * --
txtA[7]="efficacia";
txtB[7]="auspicio";
txtC[7]="ottusitą";
txtD[7]="intelligenza";
t[7]= "Quale tra le seguenti parole ha un significato che maggiormente si avvicina a \x22perspicacia\x22:<BR>" + txtA[7] + ", " + txtB[7] + ", " + txtC[7] + ", " + txtD[7] + "?";
r[7]= txtD[7];
pA[7]=0;pB[7]=0;pC[7]=0;pD[7]=1;

// -- * --
txtA[8]="innovatore";
txtB[8]="capo";
txtC[8]="moderatore";
txtD[8]="ottimista";
t[8]= "Quali tra le seguenti parole č sinonimo di \x22coordinatore\x22:<BR>" + txtA[8] + ", " + txtB[8] + ", " + txtC[8] + ", " + txtD[8] + "?";
r[8]= txtC[8];
pA[8]=0;pB[8]=0;pC[8]=1;pD[8]=0;

// -- * --
txtA[9]="alleanza";
txtB[9]="prevalenza";
txtC[9]="inferioritą";
txtD[9]="compiacenza";
t[9]= "Quale tra le seguenti parole ha un significato che maggiormente si avvicina al contrario di \x22preponderanza\x22:<BR>" + txtA[9] + ", " + txtB[9] + ", " + txtC[9] + ", " + txtD[9] + "?";
r[9]= txtC[9];
pA[9]=0;pB[9]=0;pC[9]=1;pD[9]=0;


// -- 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[i].elements[0].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");
}

