﻿function showTestResult(testForm) {	if (testForm) {		var g1 = getCheckedRadio(testForm.g1);		var g2 = getCheckedRadio(testForm.g2);		var g3 = getCheckedRadio(testForm.g3);		var g4 = getCheckedRadio(testForm.g4);		var g5 = getCheckedRadio(testForm.g5);		var g6 = getCheckedRadio(testForm.g6);		var g7 = getCheckedRadio(testForm.g7);		var g8 = getCheckedRadio(testForm.g8);		// check form completion		if (g1 && g2 && g3 && g4 && g5 && g6 && g7 && g8) {			// sum points			var points = 0;			var map = [ 5,2,1,4,3 ];			points += map[g1];			var map = [ 1,4,5,3,2 ];			points += map[g2];			var map = [ 1,3,4,2,5 ];			points += map[g3];			var map = [ 2,4,3,1,5 ];			points += map[g4];			var map = [ 3,1,2,4,5 ];			points += map[g5];			var map = [ 4,5,3,2,1 ];			points += map[g6];			var map = [ 3,1,4,5,2 ];			points += map[g7];			var map = [ 3,2,5,1,4 ];			points += map[g8];			// check result			hideElement("formTest");			if (points <= 20) {				showElement("rr1");			} else if (points <= 28) {				showElement("rr2");			} else {				showElement("rr3");			}		} else {			alert("Devi completare il test prima di richiedere il risultato");		}	}	return false;}
