﻿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);		// check form completion		if (g1 && g2 && g3 && g4 && g5 && g6) {			// sum points			var ahrrr  = 0;			var points = 0;			var map = [ 1,2,3,4,4 ];			points += map[g1];			if (g1 == 5) ++ahrrr;			points += map[g2];			if (g2 == 5) ++ahrrr;			points += map[g3];			if (g3 == 5) ++ahrrr;			points += map[g4];			if (g4 == 5) ++ahrrr;			points += map[g5];			if (g5 == 5) ++ahrrr;			points += map[g6];			if (g6 == 5) ++ahrrr;			// check result			hideElement("formTest");			if (ahrrr >= 3) {				showElement("rr5");			} else if (points <= 11) {				showElement("rr1");			} else if (points <= 16) {				showElement("rr2");			} else if (points <= 20) {				showElement("rr3");			} else {				showElement("rr4");			}		} else {			alert("Devi completare il test prima di richiedere il risultato");		}	}	return false;}
