// Define global variables and arrays
var questionIndex_step1	= 0;
var categoryIndex_step1	= 0;
var checker_step1 = true;
var keeper_step1 = new Array();
var correctAnswers_step1 = 0;
var preventer_step1 = 1;
var preventer2_step1 = 1;
var spawn_step1;
var questionIndex2_step1 = 0;
var categoryIndex2_step1 = 0;
var checker2_step1 	= true;
var	keeper2_step1 = new Array();
var categoryAnswers_step1 = 0;

//var baseCats_step1 = new Array ("BS", "IMM", "BIO", "MICRO", "BIOST", "ANAT", "CELL", "PATH", "BESCI", "PAPHYS","PHARM", "GROSS", "PHYSIO", "HISTO", "GEN", "RENAL", "MULTI", "REPRO", "CV", "RESP", "ENDO", "S/C", "GI", ""HEME\LYMPH"", "MUS", "NEURO");

var BS_step1 = 0;
var BS_i_step1 = 0;

var IMM_step1 = 0;
var IMM_i_step1 = 0;

var BIO_step1 = 0;
var BIO_i_step1 = 0;

var MICRO_step1 = 0;
var MICRO_i_step1 = 0;

var BIOST_step1 = 0;
var BIOST_i_step1 = 0;

var ANA_step1 = 0;
var ANA_i_step1 = 0;

var CELL_step1 = 0;
var CELL_i_step1 = 0;

var PATH_step1 = 0;
var PATH_i_step1 = 0;

var BESCI_step1 = 0;
var BESCI_i_step1 = 0;

var PAPHYS_step1 = 0;
var PAPHYS_i_step1 = 0;

var PHARM_step1 = 0;
var PHARM_i_step1 = 0;

var GROSS_step1 = 0;
var GROSS_i_step1 = 0;

var PHYSIO_step1 = 0;
var PHYSIO_i_step1 = 0;

var HISTO_step1 = 0;
var HISTO_i_step1 = 0;

var GEN_step1 = 0;
var GEN_i_step1 = 0;

var GEN_ORG_step1 = 0;
var GEN_ORG_i_step1 = 0;

var RENAL_step1 = 0;
var RENAL_i_step1 = 0;

var MULTI_step1 = 0;
var MULTI_i_step1 = 0;

var REP_step1 = 0;
var REP_i_step1 = 0;

var CV_step1 = 0;
var CV_i_step1 = 0;

var RES_step1 = 0;
var RES_i_step1 = 0;

var EN_step1 = 0;
var EN_i_step1 = 0;

var S_C_step1 = 0;
var S_C_i_step1 = 0;

var GI_step1 = 0;
var GI_i_step1 = 0;

var H_L_step1 = 0;
var H_L_i_step1 = 0;

var MUS_step1 = 0;
var MUS_i_step1 = 0;

var NER_step1 = 0;
var NER_i_step1 = 0;

var DIG_step1 = 0;
var DIG_i_step1 = 0;

// For resetting all variables and arrays for a retake
function itemReset_step1() {
	questionIndex_step1 = 0;
	categoryIndex_step1	= 0;
	keeper_step1 = new Array();
	correctAnswers_step1 = 0;
	preventer_step1	= 1;
	
	}
	
	
// Administer the test and record the answers
function startQuiz_step1(openStatus_step1, whetherOrNot_step1) {
	checker_step1 = openStatus_step1;
	if (whetherOrNot_step1 < questionIndex2_step1) { busted_step1(); return; }
	if (checker_step1) { 
		spawn_step1 = open('','','width=762,height=500,scrollbars=yes, status=1'); 
		!checker_step1;
		}
	reviewQuiz_step1(true, 1, 0)
	}
	

function listTest_step1(review_step1) {
	// Increment the variables for the last time
	if (review_step1 == 0) {questionIndex_step1++;preventer_step1++;printList_step1();}
	else {questionIndex2_step1++;preventer2_step1++;printList_step1();};
	}

function gradeTest_step1() {
	// Increment the variables for the last time
	questionIndex_step1++;
	preventer_step1++;
	
	// Compare student answers with correct answers
	for (var i = 0; i < killers_step1.length; i++) {
		if (keeper_step1[i] == answers_step1[i]) {
			correctAnswers_step1++;
			if (correctAnswers_step1) {
			
			if (cate_step1[i] == "BS")
				{BS_step1++;}
				
			if (cate_step1[i] == "IMM")
				{IMM_step1++;}

			if (cate_step1[i] == "BIO")
				{BIO_step1++;}
								
			if (cate_step1[i] == "MICRO")
				{MICRO_step1++;}				

			if (cate_step1[i] == "BIOST")
				{BIOST_step1++;}

			if (cate_step1[i] == "ANAT")
				{ANA_step1++;}

			if (cate_step1[i] == "CELL")
				{CELL_step1++;}
				
			if (cate_step1[i] == "PATH")
				{PATH_step1++;}
				
			if (cate_step1[i] == "BESCI")
				{BESCI_step1++;}
				
			if (cate_step1[i] == "PAPHYS")
				{PAPHYS_step1++;}
				
			if (cate_step1[i] == "PHARM")
				{PHARM_step1++;}
				
			if (cate_step1[i] == "GROSS")
				{GROSS_step1++;}
				
			if (cate_step1[i] == "PHYSIO")
				{PHYSIO_step1++;}
				
			if (cate_step1[i] == "HISTO")
				{HISTO_step1++;}
				
			if (cate_step1[i] == "GEN")
				{GEN_step1++;}

			if (cateSub_step1[i] == "GP")
				{GEN_ORG_step1++;}				
				
			if (cateSub_step1[i] == "RENAL")
				{RENAL_step1++;}
				
			if (cateSub_step1[i] == "MULTI")
				{MULTI_step1++;}
				
			if (cateSub_step1[i] == "REPRO")
				{REP_step1++;}
				
			if (cateSub_step1[i] == "CV")
				{CV_step1++;}
				
			if (cateSub_step1[i] == "RESP")
				{RES_step1++;}
				
			if (cateSub_step1[i] == "ENDO")
				{EN_step1++;}
				
			if (cateSub_step1[i] == "S/C")
				{S_C_step1++;}				
				
			if (cateSub_step1[i] == "GI")
				{GI_step1++;}
								
			if (cateSub_step1[i] == "HEME/LYMPH")
				{H_L_step1++;}
				
			if (cateSub_step1[i] == "MUS")
				{MUS_step1++;}				
				
			if (cateSub_step1[i] == "NEURO")
				{NER_step1++;}		
				
			if (cateSub_step1[i] == "DIG")
				{DIG_step1++;}								
					}
			}
			else {
			
						
			if (cate_step1[i] == "BS")
				{BS_i_step1++;}
				
			if (cate_step1[i] == "IMM")
				{IMM_i_step1++;}

			if (cate_step1[i] == "BIO")
				{BIO_i_step1++;}
								
			if (cate_step1[i] == "MICRO")
				{MICRO_i_step1++;}				

			if (cate_step1[i] == "BIOST")
				{BIOST_i_step1++;}

			if (cate_step1[i] == "ANAT")
				{ANA_i_step1++;}

			if (cate_step1[i] == "CELL")
				{CELL_i_step1++;}
				
			if (cate_step1[i] == "PATH")
				{PATH_i_step1++;}
				
			if (cate_step1[i] == "BESCI")
				{BESCI_i_step1++;}
				
			if (cate_step1[i] == "PAPHYS")
				{PAPHYS_i_step1++;}
				
			if (cate_step1[i] == "PHARM")
				{PHARM_i_step1++;}
				
			if (cate_step1[i] == "GROSS")
				{GROSS_i_step1++;}
				
			if (cate_step1[i] == "PHYSIO")
				{PHYSIO_i_step1++;}
				
			if (cate_step1[i] == "HISTO")
				{HISTO_i_step1++;}
				
			if (cate_step1[i] == "GEN")
				{GEN_i_step1++;}

			if (cateSub_step1[i] == "GP")
				{GEN_ORG_i_step1++;}		
				
			if (cateSub_step1[i] == "RENAL")
				{RENAL_i_step1++;}
				
			if (cateSub_step1[i] == "MULTI")
				{MULTI_i_step1++;}
				
			if (cateSub_step1[i] == "REPRO")
				{REP_i_step1++;}
				
			if (cateSub_step1[i] == "CV")
				{CV_i_step1++;}
				
			if (cateSub_step1[i] == "RESP")
				{RES_i_step1++;}
				
			if (cateSub_step1[i] == "ENDO")
				{EN_i_step1++;}
				
			if (cateSub_step1[i] == "S/C")
				{S_C_i_step1++;}				
				
			if (cateSub_step1[i] == "GI")
				{GI_i_step1++;}
								
			if (cateSub_step1[i] == "HEME/LYMPH")
				{H_L_i_step1++;}
				
			if (cateSub_step1[i] == "MUS")
				{MUS_i_step1++;}				
				
			if (cateSub_step1[i] == "NEURO")
				{NER_i_step1++;}	
				
			if (cateSub_step1[i] == "DIG")
				{DIG_i_step1++;}	
			
			}
			
		}

	
	// Determine a ranking according to number of corrrect answers
	//jsAbility = performance[Math.ceil((correctAnswers/killers_step1.length) * performance.length - 1)];

	// Print the test results
	printResults_step1();
	}
//function putCorrect_step1()
//{
//the_Form.step1.value = Math.round(correctAnswers_step1 / killers_step1.length * 100) + '%';
//}
// Print the questions, answer options, and other info
function printList_step1() {
	spawn_step1.document.clear();
	spawn_step1.document.open();
	spawn_step1.document.writeln('<HTML><HEAD>');
	spawn_step1.document.writeln('<TITLE>KaplanMedical</TITLE>');
	spawn_step1.document.writeln('<BODY TOPMARGIN=0 LEFTMARGIN=0 BGCOLOR="\WHITE\">');
	//spawn_step1.document.writeln('<B>Ranking: ' + jsAbility + '</B><BR><BR><BR>');
	spawn_step1.document.writeln('<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>&nbsp;');
	spawn_step1.document.writeln('<FONT FACE=\"ARIAL\" SIZE=\"2\">');
	spawn_step1.document.writeln('<b>All Questions Answered</b></TD><TD width=50% align=center><FONT FACE=\"arial\" SIZE=\"2\" COLOR=336699><B>Kaplan Medical Sample Test</B></FONT></TD><TD ALIGN=RIGHT><FONT FACE=\"Arial\" SIZE=\"2\"><a href=\"javascript:opener.itemReview_step1();opener.reviewQuiz_step1(true, 1);\">Review</a> | <a href=\"javascript:opener.gradeTest_step1();\">Submit</a>&nbsp;&nbsp;</FONT></TD></TR>');
	spawn_step1.document.writeln('</TR><TD COLSPAN=3 BGCOLOR=333333><img src=images/spacer.gif width=1 height=1 border=0></TD></TR></TABLE>');
	spawn_step1.document.writeln('<TABLE CELLPADDING=5 CELLSPACING=0 BORDER=0 width=720><TR><TD width=440>');		
	spawn_step1.document.writeln('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 width=100%><TR><TD bgcolor=\"#999999\">');	
		spawn_step1.document.writeln('<TABLE CELLPADDING=5 CELLSPACING=1 BORDER=0 width=100%><TR><TD bgcolor=\"666666\"><FONT SIZE=\"1\" FACE=\"VERDANA\" COLOR=\"WHITE\"><img src=\"images/header_question.gif\" width=\"77\" height=\"24\" border=\"0\"></FONT></TD><TD bgcolor=\"666666\"><FONT SIZE=\"1\" FACE=\"VERDANA\" COLOR=\"WHITE\"><img src=\"images/header_youranswer.gif\" width=\"108\" height=\"24\" border=\"0\"></FONT></TD></TR>');
	for (var i = 0; i < killers_step1.length; i++) {
	if (keeper_step1[i] == null)
		{ 
		// Determine if the student answered
spawn_step1.document.writeln('<TR><TD bgcolor=\"FFFFFF\"><FONT SIZE=\"2\" FACE=\"VERDANA\"><B>' + (i + 1) + '.</B> '  + cate_step1[i] + '&nbsp;'   + cateSub_step1[i] + ' <a href=\"');
	if (i == 0)
		{ 
spawn_step1.document.writeln('javascript:opener.itemReview_step1();opener.reviewQuiz_step1(true, 1);');	
		} else {
spawn_step1.document.writeln('javascript:opener.reviewQuiz_step1(true, 1,' + i + ');');		
		}
spawn_step1.document.writeln('\">Review Question</a></FONT></TD><TD bgcolor=red><FONT COLOR=\"white\" SIZE=\"2\" FACE=\"VERDANA\">No Answer</TD></TR>');
		
		} else	{
		
spawn_step1.document.writeln('<TR><TD bgcolor=\"FFFFFF\"><FONT SIZE=\"2\" FACE=\"VERDANA\"><B>' + (i + 1) + '.</B> '  + cate_step1[i] + '&nbsp;'   + cateSub_step1[i] + ' <a href=\"');

	if (i == 0) { 
spawn_step1.document.writeln('javascript:opener.itemReview_step1();opener.reviewQuiz_step1(true, 1);');	
		} else {
		
spawn_step1.document.writeln('javascript:opener.reviewQuiz_step1(true, 1, ' + i + ');');
}
spawn_step1.document.writeln('\">Review Question</a></FONT></TD><TD bgcolor=\"FFFFFF\"><FONT SIZE=\"2\" FACE=\"VERDANA\">' + keeper_step1[i] + '\n</TD></TR>');


		}
		
		
		
		}	
	
// Add extra info about the ranking, questions, and application
		spawn_step1.document.writeln('</TABLE>');		
		spawn_step1.document.writeln('</TD></TR></TABLE>');		
		spawn_step1.document.writeln('</TD><TD VALIGN=\"TOP\" WIDTH=275><FONT SIZE=\"1\" FACE=\"VERDANA\"><img src=\"images/header_allquestions.gif\" width=\"273\" height=\"36\" border=\"0\" alt=\"All Questions Answered\"><br>What would you like to do now? <br><br><a href=\"javascript:opener.itemReview_step1();opener.reviewQuiz_step1(true, 1);\"><img src=\"images/button_review.gif\" alt=\"Review Your Answers\" width=\"131\" height=\"14\" border=\"0\"></a> or <a href=\"javascript:opener.gradeTest_step1();\"><img src=\"images/button_grade.gif\" alt=\"Grade the Test\" width=\"95\" height=\"14\" border=\"0\"></a></FONT></TD></TR></TABLE></BODY></HTML>');
	spawn_step1.document.close();
	}

	
function itemReview_step1() {
	questionIndex2_step1 	= 0;
	categoryIndex2_step1	= 0;
	preventer2_step1 = 1;

	}	
	
// Administer the test and record the answers
function reviewQuiz_step1(openStatus_step1, whetherOrNot_step1, jumpto_step1) {

	checker2_step1 = openStatus_step1;
 	//if (whetherOrNot < questionIndex2) { busted(); return; }

	if (questionIndex2_step1 == killers_step1.length) { listTest_step1(1); return; }

	if (jumpto_step1 > 0)	{
	categoryIndex2_step1 = jumpto_step1;
	questionIndex2_step1 = jumpto_step1;
	}
	
	// Separate each array element to form the questions and answr options

	var question_step1 	= killers_step1[questionIndex2_step1].substring(0, killers_step1[questionIndex2_step1].indexOf('$$'));
	var categorical_step1	= cate_step1[categoryIndex2_step1].substring(0);		
	var categoricalSub_step1	= cateSub_step1[categoryIndex2_step1].substring(0);		
	var optionA_step1 	= killers_step1[questionIndex2_step1].substring(killers_step1[questionIndex2_step1].indexOf('$$') + 2, killers_step1[questionIndex2_step1].indexOf('%%'));
	var optionB_step1 	= killers_step1[questionIndex2_step1].substring(killers_step1[questionIndex2_step1].indexOf('%%') + 2, killers_step1[questionIndex2_step1].indexOf('^^'));
	var optionC_step1 	= killers_step1[questionIndex2_step1].substring(killers_step1[questionIndex2_step1].indexOf('^^') + 2, killers_step1[questionIndex2_step1].indexOf('&&'));
	var optionD_step1 	= killers_step1[questionIndex2_step1].substring(killers_step1[questionIndex2_step1].indexOf('&&') + 2, killers_step1[questionIndex2_step1].indexOf('##'));
	var optionE_step1 	= killers_step1[questionIndex2_step1].substring(killers_step1[questionIndex2_step1].indexOf('##') + 2, killers_step1[questionIndex2_step1].length);

	
	// Write the questons and answrs options to the new window
	spawn_step1.document.clear();
	spawn_step1.document.open();
	spawn_step1.document.writeln('<HTML><HEAD><TITLE>Kaplan Medical</TITLE></HEAD>');
	spawn_step1.document.writeln('<BODY TOPMARGIN=0 LEFTMARGIN=0 BGCOLOR="\WHITE\">');
	spawn_step1.document.writeln('<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>&nbsp;');
	spawn_step1.document.writeln('<FONT FACE=\"ARIAL\" SIZE=\"2\">');
	spawn_step1.document.writeln('<b>Item ' + (questionIndex2_step1 + 1) + '&nbsp; of &nbsp;' + killers_step1.length +  '</b>');
	spawn_step1.document.writeln('</TD><TD width=50% align=center><FONT FACE=\"arial\" SIZE=\"2\" COLOR=336699><B>Kaplan Medical Sample Test</B></FONT></TD><TD ALIGN=RIGHT><FONT FACE=\"Arial\" SIZE=\"2\"><b>category:</b> ' + categorical_step1 + '&nbsp; ' + categoricalSub_step1 + '&nbsp;</FONT> </TD></TR>');
	spawn_step1.document.writeln('</TR><TD COLSPAN=3 BGCOLOR=333333><img src=images/spacer.gif width=1 height=1 border=0></TD></TR></TABLE>');		
	spawn_step1.document.writeln('<FORM name=\"question1\"><input type=\"hidden\" name=\"category\" value=\"' + categorical_step1 + '\">');
	spawn_step1.document.writeln('<input type=\"hidden\" name=\"number\" value=\"' + (questionIndex2_step1 + 1) +  '\">');	
	spawn_step1.document.writeln('<CENTER><TABLE WIDTH=80%><TR><TD><FONT FACE=\"arial\" SIZE=\"2\">' + question_step1 + '<BR><BR>');
	if (keeper_step1[questionIndex2_step1] != null) 
		{
	spawn_step1.document.writeln('<img src=\"images/element_selected.gif\" width=10 height=10 border=0 ALIGN=ABSMIDDLE><FONT FACE=\"verdana\" SIZE=\"1\" STYLE=\"font-size:10;\"> = PREVIOUS SELECTION</FONT><br><br>');
		}	
		
		//if (keeper_step1[questionIndex2] == null) 
		//{
	//spawn_step1.document.writeln('<FONT COLOR=RED SIZE=\"1\">You did not previously choose an answer for this question</font><BR><BR>');
		//}	
		
	if (keeper_step1[questionIndex2_step1] == 'A') 
		{
	spawn_step1.document.writeln('<b style=\"background: yellow;\"><INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"A\" checked onClick="opener.keeper_step1[opener.questionIndex2_step1 - 1] = this.value;\"> <b>A.</b> ' + optionA_step1 + '</b><BR>');
		}
		else 
		{
	spawn_step1.document.writeln('<INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"A\" onClick="opener.keeper_step1[opener.questionIndex2_step1 - 1] = this.value;\"> <b>A.</b> ' + optionA_step1 + '<BR>');
		}
	if (keeper_step1[questionIndex2_step1] == 'B') 
		{
	spawn_step1.document.writeln('<b style=\"background: yellow;\"><INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"B\" checked onClick="opener.keeper_step1[opener.questionIndex2_step1 - 1] = this.value;\"> <b>B.</b> ' + optionB_step1 + '</b><BR>');
		}
		else 
		{
	spawn_step1.document.writeln('<INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"B\" onClick="opener.keeper_step1[opener.questionIndex2_step1 - 1] = this.value;\"> <b>B.</b> ' + optionB_step1 + '<BR>');		
		}
	if (keeper_step1[questionIndex2_step1] == 'C') 
		{	
	spawn_step1.document.writeln('<b style=\"background: yellow;\"><INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"C\" checked onClick="opener.keeper_step1[opener.questionIndex2_step1 - 1] = this.value;\"> <b>C.</b> ' + optionC_step1 + '</b><BR>');
		}
		else 
		{
spawn_step1.document.writeln('<INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"C\" onClick="opener.keeper_step1[opener.questionIndex2_step1 - 1] = this.value;\"> <b>C.</b> ' + optionC_step1 + '<BR>');
		}
		if (keeper_step1[questionIndex2_step1] == 'D') 
		{	
	spawn_step1.document.writeln('<b style=\"background: yellow;\"><INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"D\" checked onClick="opener.keeper_step1[opener.questionIndex2_step1 - 1] = this.value;\"> <b>D.</b> ' + optionD_step1 + '</b><BR>');
		}
		else 
		{
	spawn_step1.document.writeln('<INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"D\" onClick="opener.keeper_step1[opener.questionIndex2_step1 - 1] = this.value;\"> <b>D.</b> ' + optionD_step1 + '<BR>');
		}
		if (keeper_step1[questionIndex2_step1] == 'E') 
		{	
	spawn_step1.document.writeln('<b style=\"background: yellow;\"><INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"E\" checked onClick="opener.keeper_step1[opener.questionIndex2_step1 - 1] = this.value;\"> <b>E.</b> ' + optionE_step1 + '</b><BR>');
		}
		else 
		{
	spawn_step1.document.writeln('<INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"E\" onClick="opener.keeper_step1[opener.questionIndex2_step1 - 1] = this.value;\"> <b>E.</b> ' + optionE_step1 + '<BR>');
		}
		
	
		

	if (keeper_step1[questionIndex2_step1] != null) {
 	spawn_step1.document.writeln('<BR><input type=\"button\" value=\"Submit Answer\" onClick=\"opener.printList_step1(1);\">');
	} else {
		spawn_step1.document.writeln('<BR><input type=\"button\" value=\"Submit Answer\" onClick=\"opener.reviewQuiz_step1(false, ' + preventer2_step1 + ', ' + (questionIndex2_step1 + 1) +');\">');
	}
	
	
 	spawn_step1.document.writeln('</FORM></TD></TR></TABLE></CENTER></BODY></HTML>');	
	spawn_step1.document.close();
	
	// Increment variables for the next question
	questionIndex2_step1++;
	categoryIndex2_step1++;
	preventer2_step1++;
	}	
	
// Print the questions, answer options, and other info
function printResults_step1() {
	//putCorrect_step1();
	spawn_step1.document.clear();
	spawn_step1.document.open();
	spawn_step1.document.writeln('<HTML><HEAD>');
	spawn_step1.document.writeln('<TITLE>Kaplan Medical</TITLE>');
	spawn_step1.document.writeln('</HEAD><BODY BGCOLOR=\"WHITE\">');				
	spawn_step1.document.writeln('<FONT FACE=\"arial\" size=2>');
	spawn_step1.document.writeln('<TABLE cellpadding=3 cellspacing=0 border=0 width=700><tr><td valign=bottom><FONT FACE=\"arial\" STYLE=\"font-size:15;weight:bold;\"><b>INDIVIDUAL TEST ANALYSIS</b></font></td><td align=right><img src=images/kapmed_logo.gif width=125 height=36 border=0 alt=""></td></tr></TABLE><img src=\"images/element_bluedot.gif\" width=700 height=2 border=0><br>');
	spawn_step1.document.writeln('<FONT FACE=\"arial\" STYLE=\"font-size:12;weight:bold;\"><b>OVERALL PERFORMANCE ANALYSIS<a href=\"javascript:opener.testDesc_step1();\"><img src=images/button_reviewthistest.gif width=116 height=20 border=0 align=\"absmiddle\" alt=Review this Test></a></font></b><br><img src=\"images/element_bluedot.gif\" width=700 height=2 border=0><br>');
	spawn_step1.document.writeln('<FONT FACE=\"arial\" size=2><b>Overall Correct: ' + Math.round(correctAnswers_step1 / killers_step1.length * 100) + '%</b></font><br><br>');
	spawn_step1.document.writeln('<TABLE CellSpacing=0 cellPadding=3 width=700 BORDER=0 height=105><TR><TD WIDTH=35>');
	spawn_step1.document.writeln('<TABLE cellSpacing=0 cellPadding=3 width=35 border=0 height=100%><TBODY><TR><TD vAlign=bottom align=middle bgColor=#ffcc99 height=' + (100 - (correctAnswers_step1 / killers_step1.length * 100)) + '><FONT color=#cc6633 size=1><b>' +  Math.round(correctAnswers_step1 / killers_step1.length * 100) + '%</b></FONT></TD></TR><TR><TD vAlign=top align=middle bgColor=#cc6633 height=' + correctAnswers_step1 / killers_step1.length * 100 + '><IMG height=1 src=\"images/spacer.gif\" width=1></TD></TR></TBODY></TABLE>');
	spawn_step1.document.writeln('</TD><TD VALIGN=BOTTOM NOWRAP><FONT FACE=\"arial\" size=1><FONT FACE=\"arial\" size=2>Correct: ' + correctAnswers_step1 + '<br>Incorrect: ' + (killers_step1.length - correctAnswers_step1) +'</TD></TR></TABLE><br><br>');

	spawn_step1.document.writeln('<img src=\"images/element_bluedot.gif\" width=700 height=2 border=0><br><FONT FACE=\"arial\" STYLE=\"font-size:12;weight:bold;\"><b>DISCIPLINE</font></b><br><img src=\"images/element_bluedot.gif\" width=700 height=2 border=0><br>');


//category STUFF

	spawn_step1.document.writeln('<br><TABLE CellSpacing=0 cellPadding=2 width=700 BORDER=0 height=155><TR>');
	for (var i = 0; i < baseCats_step1.length; i++) {
	
	spawn_step1.document.writeln('<TD ALIGN=CENTER><TABLE CellSpacing=0 cellPadding=0 width=25 BORDER=0 height=65%><TR>'); 

if (baseCats_step1[i] == "BS") {
		if (BS_step1 + BS_i_step1 == 0)
		{
		spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
		spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
		spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
		spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
		
		} else {
		
		var sum_step1 = (BS_step1 + BS_i_step1); 
		spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (BS_step1 / sum_step1 * 100)) + '%>');
		spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(BS_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
		spawn_step1.document.writeln(' align=center valign=bottom height=');
		spawn_step1.document.writeln(BS_step1 / sum_step1 * 100 + '>');
		spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
		spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
		spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + BS_step1 + '<br><b>Wrong:</b>' + BS_i_step1 + '</TD></TR></TABLE></TD>'); 
		}	
}

if (baseCats_step1[i] == "IMM") {
	if (IMM_step1 + IMM_i_step1 == 0)
		{
		spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
		spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
		spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
		spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
		
		} else {
	
	var sum_step1 = (IMM_step1 + IMM_i_step1); 
	spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (IMM_step1 / sum_step1 * 100)) + '%>');
	spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(IMM_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
	spawn_step1.document.writeln(' align=center valign=bottom height=');
	spawn_step1.document.writeln(IMM_step1 / sum_step1 * 100 + '>');
	spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
	spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
	spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + IMM_step1 + '<br><b>Wrong:</b>' + IMM_i_step1 + '</TD></TR></TABLE></TD>');
	} 
}

if (baseCats_step1[i] == "BIO") {
	if (BIO_step1 + BIO_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (BIO_step1 + BIO_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (BIO_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(BIO_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(BIO_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + BIO_step1 + '<br><b>Wrong:</b>' + BIO_i_step1 + '</TD></TR></TABLE></TD>');
	}
}

if (baseCats_step1[i] == "MICRO") {
if (MICRO_step1 + MICRO_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (MICRO_step1 + MICRO_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (MICRO_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(MICRO_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(MICRO_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + MICRO_step1 + '<br><b>Wrong:</b>' + MICRO_i_step1 + '</TD></TR></TABLE></TD>'); 
	}
}

if (baseCats_step1[i] == "BIOST") {
if (BIOST_step1 + BIOST_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (BIOST_step1 + BIOST_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (BIOST_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(BIOST_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(BIOST_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + BIOST_step1 + '<br><b>Wrong:</b>' + BIOST_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseCats_step1[i] == "ANAT") {
if (ANA_step1 + ANA_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (ANA_step1 + ANA_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (ANA_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(ANA_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(ANA_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + ANA_step1 + '<br><b>Wrong:</b>' + ANA_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseCats_step1[i] == "CELL") {
if (CELL_step1 + CELL_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (CELL_step1 + CELL_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (CELL_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(CELL_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(CELL_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + CELL_step1 + '<br><b>Wrong:</b>' + CELL_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseCats_step1[i] == "PATH") {
if (PATH_step1 + PATH_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (PATH_step1 + PATH_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (PATH_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(PATH_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(PATH_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + PATH_step1 + '<br><b>Wrong:</b>' + PATH_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseCats_step1[i] == "BESCI") {
if (BESCI_step1 + BESCI_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (BESCI_step1 + BESCI_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (BESCI_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(BESCI_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(BESCI_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + BESCI_step1 + '<br><b>Wrong:</b>' + BESCI_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}


if (baseCats_step1[i] == "PAPHYS") {
if (PAPHYS_step1 + PAPHYS_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (PAPHYS_step1 + PAPHYS_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (PAPHYS_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(PAPHYS_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(PAPHYS_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + PAPHYS_step1 + '<br><b>Wrong:</b>' + PAPHYS_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}


if (baseCats_step1[i] == "PHARM") {
if (PHARM_step1 + PHARM_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (PHARM_step1 + PHARM_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (PHARM_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(PHARM_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(PHARM_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + PHARM_step1 + '<br><b>Wrong:</b>' + PHARM_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseCats_step1[i] == "GROSS") {
if (GROSS_step1 + GROSS_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (GROSS_step1 + GROSS_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (GROSS_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(GROSS_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(GROSS_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + GROSS_step1 + '<br><b>Wrong:</b>' + GROSS_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseCats_step1[i] == "PHYSIO") {
if (PHYSIO_step1 + PHYSIO_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (PHYSIO_step1 + PHYSIO_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (PHYSIO_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(PHYSIO_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(PHYSIO_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + PHYSIO_step1 + '<br><b>Wrong:</b>' + PHYSIO_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseCats_step1[i] == "HISTO") {
if (HISTO_step1 + HISTO_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (HISTO_step1 + HISTO_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (HISTO_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(HISTO_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(HISTO_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + HISTO_step1 + '<br><b>Wrong:</b>' + HISTO_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseCats_step1[i] == "GEN") {
if (GEN_step1 + GEN_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=666699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (GEN_step1 + GEN_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCFF height=' + Math.round(100 - (GEN_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=666699 size=1><b>' +  Math.round(GEN_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=666699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(GEN_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseCats_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + GEN_step1 + '<br><b>Wrong:</b>' + GEN_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}



}	

	spawn_step1.document.writeln('</TD></TR></TABLE>');

spawn_step1.document.writeln('<img src=\"images/element_bluedot.gif\" width=700 height=2 border=0><br><FONT FACE=\"arial\" STYLE=\"font-size:12;weight:bold;\"><b>ORGANS</font></b><br><img src=\"images/element_bluedot.gif\" width=700 height=2 border=0><br>');


//category STUFF

	spawn_step1.document.writeln('<br><TABLE CellSpacing=0 cellPadding=2 width=700 BORDER=0 height=155><TR>');
	for (var i = 0; i < baseOrgs_step1.length; i++) {
	
	spawn_step1.document.writeln('<TD ALIGN=CENTER><TABLE CellSpacing=0 cellPadding=0 width=25 BORDER=0 height=65%><TR>'); 
	
if (baseOrgs_step1[i] == "GP") {
if (GEN_ORG_step1 + GEN_ORG_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (GEN_ORG_step1 + GEN_ORG_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (GEN_ORG_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(GEN_ORG_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(GEN_ORG_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + GEN_ORG_step1 + '<br><b>Wrong:</b>' + GEN_ORG_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}
	
if (baseOrgs_step1[i] == "RENAL") {
if (RENAL_step1 + RENAL_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (RENAL_step1 + RENAL_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (RENAL_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(RENAL_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(RENAL_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + RENAL_step1 + '<br><b>Wrong:</b>' + RENAL_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseOrgs_step1[i] == "MULTI") {
if (MULTI_step1 + MULTI_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (MULTI_step1 + MULTI_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (MULTI_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(MULTI_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(MULTI_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + MULTI_step1 + '<br><b>Wrong:</b>' + MULTI_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseOrgs_step1[i] == "REPRO") {
if (REP_step1 + REP_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (REP_step1 + REP_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (REP_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(REP_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(REP_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + REP_step1 + '<br><b>Wrong:</b>' + REP_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}
if (baseOrgs_step1[i] == "CV") {
if (CV_step1 + CV_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (CV_step1 + CV_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (CV_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(CV_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(CV_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + CV_step1 + '<br><b>Wrong:</b>' + CV_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseOrgs_step1[i] == "RESP") {
if (RES_step1 + RES_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (RES_step1 + RES_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (RES_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(RES_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(RES_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + RES_step1 + '<br><b>Wrong:</b>' + RES_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseOrgs_step1[i] == "ENDO") {
if (EN_step1 + EN_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (EN_step1 + EN_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (EN_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(EN_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(EN_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + EN_step1 + '<br><b>Wrong:</b>' + EN_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseOrgs_step1[i] == "S/C") {
if (S_C_step1 + S_C_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (S_C_step1 + S_C_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (S_C_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(S_C_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(S_C_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + S_C_step1 + '<br><b>Wrong:</b>' + S_C_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseOrgs_step1[i] == "GI") {
if (GI_step1 + GI_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (GI_step1 + GI_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (GI_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(GI_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(GI_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + GI_step1 + '<br><b>Wrong:</b>' + GI_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseOrgs_step1[i] == "HEME/LYMPH") {
if (H_L_step1 + H_L_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (H_L_step1 + H_L_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (H_L_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(H_L_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(H_L_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.H_Lf\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + H_L_step1 + '<br><b>Wrong:</b>' + H_L_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseOrgs_step1[i] == "MUS") {
if (MUS_step1 + MUS_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (MUS_step1 + MUS_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (MUS_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(MUS_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(MUS_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + MUS_step1 + '<br><b>Wrong:</b>' + MUS_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}

if (baseOrgs_step1[i] == "NEURO") {
if (NER_step1 + NER_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (NER_step1 + NER_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (NER_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(NER_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(NER_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + NER_step1 + '<br><b>Wrong:</b>' + NER_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}
	
if (baseOrgs_step1[i] == "DIG") {
if (DIG_step1 + DIG_i_step1 == 0)
			{
			spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=CCCCCC height=100%>');
			spawn_step1.document.writeln('<FONT color=996699 size=1><b>&nbsp;&nbsp;</b></font>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CellSpacing=0 cellPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
			spawn_step1.document.writeln('</TD></TR></TABLE></TD>'); 
			
			} else {
var sum_step1 = (DIG_step1 + DIG_i_step1); 
spawn_step1.document.writeln('<TD WIDTH=25 VALIGN=BOTTOM ALIGN=CENTER BGCOLOR=FFCCFF height=' + Math.round(100 - (DIG_step1 / sum_step1 * 100)) + '%>');
spawn_step1.document.writeln('<FONT color=996699 size=1><b>' +  Math.round(DIG_step1 / sum_step1 * 100) + '</b></font></TD></TR><TR><TD WIDTH=25 BGCOLOR=996699'); 
spawn_step1.document.writeln(' align=center valign=bottom height=');
spawn_step1.document.writeln(DIG_step1 / sum_step1 * 100 + '>');
spawn_step1.document.writeln('<IMG height=1 src=\"images/spacer.gif\" width=1></td>');
spawn_step1.document.writeln('</TD></TR></TABLE><TABLE CELLSpacing=0 CELLPadding=2 BORDER=0><TR><TD><FONT FACE=\"ARIAL\" size=1>' + baseOrgs_step1[i] + '<br>'); 
spawn_step1.document.writeln('<b>Total:</b>' + sum_step1 + '<br><b>Right:</b>' + DIG_step1 + '<br><b>Wrong:</b>' + DIG_i_step1 + '</TD></TR></TABLE></TD>'); 
}
}
	
	
}	
	spawn_step1.document.writeln('</TD></TR></TABLE></BODY></HTML>');
}	



function testDesc_step1() {
	spawn_step1.document.clear();
	spawn_step1.document.open();
	spawn_step1.document.writeln('<HTML><HEAD>');
	spawn_step1.document.writeln('<TITLE>Kaplan Medical</TITLE>');
	spawn_step1.document.writeln('</HEAD><BODY BGCOLOR=\"WHITE\">');				
	spawn_step1.document.writeln('<FONT FACE=\"arial\" size=2>');
	spawn_step1.document.writeln('<TABLE cellpadding=3 cellspacing=0 border=0 width=700><tr><td valign=bottom><FONT FACE=\"arial\" STYLE=\"font-size:15;weight:bold;\"><b>INDIVIDUAL TEST ANALYSIS</b></font></td><td align=right><img src=images/kapmed_logo.gif width=125 height=36 border=0 alt=""></td></tr></TABLE><img src=\"images/element_bluedot.gif\" width=700 height=2 border=0><br>');
	spawn_step1.document.writeln('<FONT FACE=\"arial\" STYLE=\"font-size:12;weight:bold;\"><b>QUESTION ANALYSIS<a href=\"javascript:opener.printResults_step1();\"><img src=images/button_returntostats.gif width=146 height=20 border=0 align=\"absmiddle\" alt=Return to Statistacal View></a></font></b><br><img src=\"images/element_bluedot.gif\" width=700 height=2 border=0><br><br>');
spawn_step1.document.writeln('<CENTER><TABLE CellSpacing=0 cellPadding=4 BORDER=0 WIDTH=500><TR><TD>');

	for (var i = 0; i < killers_step1.length; i++) {
		spawn_step1.document.writeln('<FONT SIZE=\"2\">\n\n<B>Question ' + (i + 1) + ':\n' + cate_step1[i] + '&nbsp;'   + cateSub_step1[i] + '</B><BR><BR></FONT>');
		spawn_step1.document.writeln('<FONT SIZE=\"2\" FACE=\"arial\">' + killers_step1[i].substring(0, killers_step1[i].indexOf('$$')));
		spawn_step1.document.writeln('<BR><BR>\n<FONT SIZE=\"2\"><b>A.</b> ' + killers_step1[i].substring((killers_step1[i].indexOf('$$') + 2), killers_step1[i].indexOf('%%')) + '<BR>');
		spawn_step1.document.writeln('<b>B.</b> ' + killers_step1[i].substring(killers_step1[i].indexOf('%%') + 2, killers_step1[i].indexOf('^^')) + '<BR>');
		spawn_step1.document.writeln('<b>C.</b> ' + killers_step1[i].substring(killers_step1[i].indexOf('^^') + 2, killers_step1[i].indexOf('&&')) + '<BR>');
		spawn_step1.document.writeln('<b>D.</b> ' + killers_step1[i].substring(killers_step1[i].indexOf('&&') + 2, killers_step1[i].indexOf('##')) + '<BR>');		
		spawn_step1.document.writeln('<b>E.</b> ' + killers_step1[i].substring(killers_step1[i].indexOf('##') + 2, killers_step1[i].length) + '<BR></FONT>');

			// Determine if the student answered each question appropriately, and display accordingly
			if (keeper_step1[i] == answers_step1[i]) {
			//correct
			spawn_step1.document.writeln('<BR><B><I><FONT COLOR=\"GREEN\">Correct, you answered ' + keeper_step1[i] + '.</FONT></I></B><br><TABLE cellpadding=3 cellspacing=0 border=0 width=100% BGCOLOR=EEEEEE><tr><td><FONT SIZE=\"2\" FACE=\"arial\"><b>Description:</b><br>' + description_step1[i] + '</TD></TR></TABLE><BR><BR><HR NOSHADE SIZE=1>'); 
				}
			//incorrect			
			else { spawn_step1.document.writeln('<BR><B><I><FONT COLOR=\"RED\">You answered ' + keeper_step1[i] + '\. The correct answer is: ' + answers_step1[i] + '.</FONT></I></B><br><TABLE cellpadding=3 cellspacing=0 border=0 BGCOLOR=EEEEEE width=100% ><tr><td><FONT SIZE=\"2\" FACE=\"arial\"><b>Description:</b><br>' + description_step1[i] + '</TD></TR></TABLE><BR><BR><HR NOSHADE SIZE=1>'); 
				}
		}

	// Add extra info about the ranking, questions, and application
	spawn_step1.document.writeln('</TD></TR></TABLE></TD></TR></TABLE></BODY></HTML>');
	spawn_step1.document.close();
	
	}

	
//END category STUFF	
	
function busted_step1() {
	alert('Sorry, you only get one shot at each question.');
	spawn_step1.history.forward(); 
	spawn_step1.focus();
	}
