var answer = new Array(15);
for (i = 0; i < 15; i++) {
	answer[i] = window.opener.document.problems.elements[i].value;
	if ((!answer[i]) ||(answer[i] <= 0) || (answer[i] > 15)) {answer[i] = 0;}
}

document.write('<TR><TD>Box matches</TD>\n');
document.write('<TD>No oxygen on Moon to sustain flame:  virtually worthless</TD>\n');
document.write('<TD ALIGN="CENTER">15</TD>\n');
var score = answer[0];
var difference = 15 - score;
if (score == 0) {score = "Blank"; }
var total = difference;
if (difference != 0) {
	document.write('<TD ALIGN="CENTER"><FONT COLOR="#FF0000">' + score);
	document.write('</FONT></TD>\n');
	document.write('<TD ALIGN="CENTER"><FONT COLOR="#FF0000">' + difference);
	document.write('</FONT></TR></TR>\n\n');
}
else {
	document.write('<TD ALIGN="CENTER">' + score + '</TD><\n>');
	document.write('<TD ALIGN="CENTER">' + difference + '</TD></TR>\n\n');
}

	document.write('<TR><TD>Food concentrate</TD>\n');
	document.write('<TD>Efficient means of supplying energy requirements</TD>\n');
	document.write('<TD ALIGN="center">4</TD>\n');
   score = answer[1];
   if (score <= 4) { difference = 4 - score; }
   else             { difference = score - 4; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>Eighteen meters of nylon rope</TD>\n');
	document.write('<TD>Useful in scaling cliffs and/or tying injured together</TD>\n');
	document.write('<TD ALIGN="center">6</TD>\n');
   score = answer[2];
   if (score <= 6) { difference = 6 - score; }
   else             { difference = score - 6; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>Parachute silk</TD>\n');
	document.write('<TD>Protection from the Sun\'s rays</TD>\n');
	document.write('<TD ALIGN="center">8</TD>\n');
   score = answer[3];
   if (score <= 8) { difference = 8 - score; }
   else             { difference = score - 8; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>Solar-powered heating unit</TD>\n');
	document.write('<TD>Not needed unless on dark side</TD>\n');
	document.write('<TD ALIGN="center">13</TD>\n');
   score = answer[4];
   if (score <= 13) { difference = 13 - score; }
   else              { difference = score - 13; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>Two .45 caliber pistols</TD>\n');
	document.write('<TD>Possible means of self-propulsion</TD>\n');
	document.write('<TD ALIGN="center">11</TD>\n');
   score = answer[5];
   if (score <= 11) { difference = 11 - score; }
   else              { difference = score - 11; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>One case of powdered milk</TD>\n');
	document.write('<TD>Bulkier duplication of food concentrate</TD>\n');
	document.write('<TD ALIGN="center">12</TD>\n');
   score = answer[6];
   if (score <= 12) { difference = 12 - score; }
   else              { difference = score - 12; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>Two tanks of oxygen</TD>\n');
	document.write('<TD>Most pressing survival need</TD>\n');
	document.write('<TD ALIGN="center">1</TD>\n');
   score = answer[7];
   if (score == 0) { score = 'Blank'; difference = 1; }
   else { difference = score - 1; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>Stellar map (of the Moon\'s constellations)</TD>\n');
	document.write('<TD>Primary means of navigation</TD>\n');
	document.write('<TD ALIGN="center">3</TD>\n');
   score = answer[8];
   if (score <= 3) { difference = 3 - score; }
   else             { difference = score - 3; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>Self-inflating life raft</TD>\n');
	document.write('<TD>CO<SUB>2</SUB> bottle in raft may be used for propulsion</TD>\n');
	document.write('<TD ALIGN="center">9</TD>\n');
   score = answer[9];
   if (score <= 9) { difference = 9 - score; }
   else             { difference = score - 9; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>Magnetic compass</TD>\n');
	document.write('<TD>Magnetic field on Moon is not polarized; worthless for navigation</TD>\n');
	document.write('<TD ALIGN="center">14</TD>\n');
   score = answer[10];
   if (score <= 14) { difference = 14 - score; }
   else              { difference = score - 14; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>Fifteen liters of water</TD>\n');
	document.write('<TD>Replacement for tremendous liquid loss on lighted side</TD>\n');
	document.write('<TD ALIGN="center">2</TD>\n');
   score = answer[11];
   if (score <= 2) { difference = 2 - score; }
   else             { difference = score - 2; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>Signal flares</TD>\n');
	document.write('<TD>Can be used as a distress signal</TD>\n');
	document.write('<TD ALIGN="center">10</TD>\n');
   score = answer[12];
   if (score <= 10) { difference = 10 - score; }
   else              { difference = score - 10; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>First-aid kit</TD>\n');
	document.write('<TD>Vitamins, medicines, <I>etc.</I> can be used to sustain health</TD>\n');
	document.write('<TD ALIGN="center">7</TD>\n');
   score = answer[13];
   if (score <= 7) { difference = 7 - score; }
   else             { difference = score - 7; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD>Solar-powered FM  Walkie Talkie</TD>\n');
	document.write('<TD>For communication with rescue party; but FM requires line-of-sight \n');
	document.write('    transmission and short ranges</TD>\n');
	document.write('<TD ALIGN="center">5</TD>\n');
   score = answer[14];
   if (score <= 5) { difference = 5 - score; }
   else             { difference = score - 5; }
   if (score == 0) { score = 'Blank'; }
   total += difference;
   if (difference != 0) { 
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + score + '</FONT></TD>\n');
    	document.write('<TD ALIGN="center"><FONT COLOR="#FF0000">' + difference + '</FONT></TD></TR>\n\n');
   }
   else {
    	document.write('<TD ALIGN="center">' + score + '</TD>\n');
    	document.write('<TD ALIGN="center">' + difference + '</TD></TR>\n\n');
   }
	document.write('<TR><TD COLSPAN=3>&nbsp;</TD><TD>Total</TD>');
	document.write('<TD ALIGN="center">' + total + '</TD>\n</TABLE><P>\n');
 
   if (total <= 25) { document.write('Excellent!<P>\n'); }
   else if (total <= 32) { document.write('Good!<P>\n'); }
   else if (total <= 45) { document.write('Average<P>\n'); }
   else if (total <= 55) { document.write('Fair<P>\n'); }
   else if (total <= 70) { document.write('Poor<P>\n'); }
   else { document.write('Very Poor (Suggests use of Earth-bound logic)<P>\n'); }
   document.close();
