// Define global variables and arrays
var questionIndex_step2	= 0;
var categoryIndex_step2	= 0;
var checker_step2 = true;
var keeper_step2 = new Array();
var correctAnswers_step2 = 0;
var preventer_step2 = 1;
var preventer2_step2 = 1;
var spawn_step2;
var questionIndex2_step2 = 0;
var categoryIndex2_step2 = 0;
var checker2_step2 	= true;
var	keeper2_step2 = new Array();
var categoryAnswers_step2 = 0;

//var baseCats_step2 = new Array ("BS", "IMM", "BIO", "MICRO", "BIOST", "MOLB", "CELL", "PATH", "EMB", "PAPHYS","PHARM", "GROSS", "PHYSIO", "HISTO", "GEN", "R/U", "MULTI", "REP", "CV", "RES", "EN", "S/C", "GI", "H/L", "MUS", "NER");



//SPECIALTIES

var IM_step2 = 0;
var IM_i_step2 = 0;

var PED_step2 = 0;
var PED_i_step2 = 0;

var PSYCH_step2 = 0;
var PSYCH_i_step2 = 0;

var OBG_step2 = 0;
var OBG_i_step2 = 0;

var SURGERY_step2 = 0;
var SURGERY_i_step2 = 0;

//SUBSPECIALTIES

var MUL_step2 = 0;
var MUL_i_step2 = 0;

var GAS_step2 = 0;
var GAS_i_step2 = 0;

var HEM_step2 = 0;
var HEM_i_step2 = 0;

var NEP_step2 = 0;
var NEP_i_step2 = 0;

var NEU_step2 = 0;
var NEU_i_step2 = 0;

var DER_step2 = 0;
var DER_i_step2 = 0;

var CAR_step2 = 0;
var CAR_i_step2 = 0;

var RHE_step2 = 0;
var RHE_i_step2 = 0;

var PUL_step2 = 0;
var PUL_i_step2 = 0;

var END_step2 = 0;
var END_i_step2 = 0;

// For resetting all variables and arrays for a retake
function itemReset_step2() {
	questionIndex_step2 = 0;
	categoryIndex_step2	= 0;
	keeper_step2 = new Array();
	correctAnswers_step2 = 0;
	preventer_step2	= 1;
	
	}
	
	
// Administer the test and record the answers
function startQuiz_step2(openStatus_step2, whetherOrNot_step2) {
	checker_step2 = openStatus_step2;
	if (whetherOrNot_step2 < questionIndex2_step2) { busted_step2(); return; }
	if (checker_step2) { 
		spawn_step2 = open('','','width=762,height=500,scrollbars=yes, status=1'); 
		!checker_step2;
		}
	reviewQuiz_step2(true, 1, 0)
	}
	

function listTest_step2(review_step2) {
	// Increment the variables for the last time
	if (review_step2 == 0) {questionIndex_step2++;preventer_step2++;printList_step2();}
	else {questionIndex2_step2++;preventer2_step2++;printList_step2();};
	}

function gradeTest_step2() {
	// Increment the variables for the last time
	questionIndex_step2++;
	preventer_step2++;
	
	// Compare student answers with correct answers
	for (var i = 0; i < killers_step2.length; i++) {
		if (keeper_step2[i] == answers_step2[i]) {
			correctAnswers_step2++;
			if (correctAnswers_step2) {
				
//SPECIALTIES
	
			if (cate_step2[i] == "IM")
				{IM_step2++;}																		
	
			if (cate_step2[i] == "PED")
				{PED_step2++;}							
	
			if (cate_step2[i] == "PSYCH")
				{PSYCH_step2++;}			
	
			if (cate_step2[i] == "OB/GYN")
				{OBG_step2++;}						
	
			if (cate_step2[i] == "SURGERY")
				{SURGERY_step2++;}						
//SUBSPECIALTIES	
			if (cateSub_step2[i] == "MULTI")
				{MUL_step2++;}						
	
			if (cateSub_step2[i] == "GASTRO")
				{GAS_step2++;}						
	
			if (cateSub_step2[i] == "HEM")
				{HEM_step2++;}				
	
			if (cateSub_step2[i] == "NEPH")
				{NEP_step2++;}						
	
			if (cateSub_step2[i] == "NEURO")
				{NEU_step2++;}						
	
			if (cateSub_step2[i] == "DER")
				{DER_step2++;}						
	
			if (cateSub_step2[i] == "CARDIO")
				{CAR_step2++;}						
	
			if (cateSub_step2[i] == "RHEUM")
				{RHE_step2++;}					
	
			if (cateSub_step2[i] == "PULM")
				{PUL_step2++;}				
	
			if (cateSub_step2[i] == "ENDO")
				{END_step2++;}						
									
					}
			}
			else {
			

//SPECIALTIES
	
			if (cate_step2[i] == "IM")
				{IM_i_step2++;}																		
	
			if (cate_step2[i] == "PED")
				{PED_i_step2++;}							
	
			if (cate_step2[i] == "PSYCH")
				{PSYCH_i_step2++;}			
	
			if (cate_step2[i] == "OB/GYN")
				{OBG_i_step2++;}						
	
			if (cate_step2[i] == "SURGERY")
				{SURGERY_i_step2++;}						
//SUBSPECIALTIES	
			if (cateSub_step2[i] == "MULTI")
				{MUL_i_step2++;}						
	
			if (cateSub_step2[i] == "GASTRO")
				{GAS_i_step2++;}						
	
			if (cateSub_step2[i] == "HEM")
				{HEM_i_step2++;}				
	
			if (cateSub_step2[i] == "NEPH")
				{NEP_i_step2++;}						
	
			if (cateSub_step2[i] == "NEURO")
				{NEU_i_step2++;}						
	
			if (cateSub_step2[i] == "DER")
				{DER_i_step2++;}						
	
			if (cateSub_step2[i] == "CARDIO")
				{CAR_i_step2++;}						
	
			if (cateSub_step2[i] == "RHEUM")
				{RHE_i_step2++;}
	
			if (cateSub_step2[i] == "PULM")
				{PUL_i_step2++;}				
	
			if (cateSub_step2[i] == "ENDO")
				{END_i_step2++;}					
					
			}
			
		}

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

	// Print the test results
	printResults_step2();
	}
//function putCorrect_step2()
//	{
//	the_Form.step2.value = Math.round(correctAnswers_step2 / killers_step2.length * 100) + '%';
//	}
// Print the questions, answer options, and other info
function printList_step2() {
	spawn_step2.document.clear();
	spawn_step2.document.open();
	spawn_step2.document.writeln('<HTML><HEAD>');
	spawn_step2.document.writeln('<TITLE>KaplanMedical</TITLE>');
	spawn_step2.document.writeln('<BODY TOPMARGIN=0 LEFTMARGIN=0 BGCOLOR="\WHITE\">');
	//spawn_step2.document.writeln('<B>Ranking: ' + jsAbility + '</B><BR><BR><BR>');
	spawn_step2.document.writeln('<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>&nbsp;');
	spawn_step2.document.writeln('<FONT FACE=\"ARIAL\" SIZE=\"2\">');
	spawn_step2.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_step2();opener.reviewQuiz_step2(true, 1);\">Review</a> | <a href=\"javascript:opener.gradeTest_step2();\">Submit</a>&nbsp;&nbsp;</FONT></TD></TR>');
	spawn_step2.document.writeln('</TR><TD COLSPAN=3 BGCOLOR=333333><img src=images/spacer.gif width=1 height=1 border=0></TD></TR></TABLE>');
	spawn_step2.document.writeln('<TABLE CELLPADDING=5 CELLSPACING=0 BORDER=0 width=720><TR><TD width=440>');		
	spawn_step2.document.writeln('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 width=100%><TR><TD bgcolor=\"#999999\">');	
		spawn_step2.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_step2.length; i++) {
	if (keeper_step2[i] == null)
		{ 
		// Determine if the student answered
spawn_step2.document.writeln('<TR><TD bgcolor=\"FFFFFF\"><FONT SIZE=\"2\" FACE=\"VERDANA\"><B>' + (i + 1) + '.</B> '  + cate_step2[i] + '&nbsp;'   + cateSub_step2[i] + ' <a href=\"');
	if (i == 0)
		{ 
spawn_step2.document.writeln('javascript:opener.itemReview_step2();opener.reviewQuiz_step2(true, 1);');	
		} else {
spawn_step2.document.writeln('javascript:opener.reviewQuiz_step2(true, 1,' + i + ');');		
		}
spawn_step2.document.writeln('\">Review Question</a></FONT></TD><TD bgcolor=red><FONT COLOR=\"white\" SIZE=\"2\" FACE=\"VERDANA\">No Answer</TD></TR>');
		
		} else	{
		
spawn_step2.document.writeln('<TR><TD bgcolor=\"FFFFFF\"><FONT SIZE=\"2\" FACE=\"VERDANA\"><B>' + (i + 1) + '.</B> '  + cate_step2[i] + '&nbsp;'   + cateSub_step2[i] + ' <a href=\"');

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


		}
		
		
		
		}	
	
// Add extra info about the ranking, questions, and application
		spawn_step2.document.writeln('</TABLE>');		
		spawn_step2.document.writeln('</TD></TR></TABLE>');		
		spawn_step2.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_step2();opener.reviewQuiz_step2(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_step2();\"><img src=\"images/button_grade.gif\" alt=\"Grade the Test\" width=\"95\" height=\"14\" border=\"0\"></a></FONT></TD></TR></TABLE></BODY></HTML>');
	spawn_step2.document.close();
	}

	
function itemReview_step2() {
	questionIndex2_step2 	= 0;
	categoryIndex2_step2	= 0;
	preventer2_step2 = 1;

	}	
	
// Administer the test and record the answers
function reviewQuiz_step2(openStatus_step2, whetherOrNot_step2, jumpto_step2) {

	checker2_step2 = openStatus_step2;
 	//if (whetherOrNot < questionIndex2) { busted(); return; }

	if (questionIndex2_step2 == killers_step2.length) { listTest_step2(1); return; }

	if (jumpto_step2 > 0)	{
	categoryIndex2_step2 = jumpto_step2;
	questionIndex2_step2 = jumpto_step2;
	}
	
	// Separate each array element to form the questions and answr options

	var question_step2 	= killers_step2[questionIndex2_step2].substring(0, killers_step2[questionIndex2_step2].indexOf('$$'));
	var categorical_step2	= cate_step2[categoryIndex2_step2].substring(0);		
	var subCategorical_step2	= cateSub_step2[categoryIndex2_step2].substring(0);			
	var optionA_step2 	= killers_step2[questionIndex2_step2].substring(killers_step2[questionIndex2_step2].indexOf('$$') + 2, killers_step2[questionIndex2_step2].indexOf('%%'));
	var optionB_step2 	= killers_step2[questionIndex2_step2].substring(killers_step2[questionIndex2_step2].indexOf('%%') + 2, killers_step2[questionIndex2_step2].indexOf('^^'));
	var optionC_step2 	= killers_step2[questionIndex2_step2].substring(killers_step2[questionIndex2_step2].indexOf('^^') + 2, killers_step2[questionIndex2_step2].indexOf('&&'));
	var optionD_step2 	= killers_step2[questionIndex2_step2].substring(killers_step2[questionIndex2_step2].indexOf('&&') + 2, killers_step2[questionIndex2_step2].indexOf('##'));
	var optionE_step2 	= killers_step2[questionIndex2_step2].substring(killers_step2[questionIndex2_step2].indexOf('##') + 2, killers_step2[questionIndex2_step2].length);

	
	// Write the questons and answrs options to the new window
	spawn_step2.document.clear();
	spawn_step2.document.open();
	spawn_step2.document.writeln('<HTML><HEAD><TITLE>Kaplan Medical</TITLE></HEAD>');
	spawn_step2.document.writeln('<BODY TOPMARGIN=0 LEFTMARGIN=0 BGCOLOR="\WHITE\">');
	spawn_step2.document.writeln('<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>&nbsp;');
	spawn_step2.document.writeln('<FONT FACE=\"ARIAL\" SIZE=\"2\">');
	spawn_step2.document.writeln('<b>Item ' + (questionIndex2_step2 + 1) + '&nbsp; of &nbsp;' + killers_step2.length +  '</b>');
	spawn_step2.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_step2 + '&nbsp;' + subCategorical_step2 + '</FONT> </TD></TR>');
	spawn_step2.document.writeln('</TR><TD COLSPAN=3 BGCOLOR=333333><img src=images/spacer.gif width=1 height=1 border=0></TD></TR></TABLE>');		
	spawn_step2.document.writeln('<FORM name=\"question1\"><input type=\"hidden\" name=\"category\" value=\"' + categorical_step2 + '\">');
	spawn_step2.document.writeln('<input type=\"hidden\" name=\"number\" value=\"' + (questionIndex2_step2 + 1) +  '\">');	
	spawn_step2.document.writeln('<CENTER><TABLE WIDTH=80%><TR><TD><FONT FACE=\"arial\" SIZE=\"2\">' + question_step2 + '<BR><BR>');
	if (keeper_step2[questionIndex2_step2] != null) 
		{
	spawn_step2.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_step2[questionIndex2] == null) 
		//{
	//spawn_step2.document.writeln('<FONT COLOR=RED SIZE=\"1\">You did not previously choose an answer for this question</font><BR><BR>');
		//}	
		
	if (keeper_step2[questionIndex2_step2] == 'A') 
		{
	spawn_step2.document.writeln('<b style=\"background: yellow;\"><INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"A\" checked onClick="opener.keeper_step2[opener.questionIndex2_step2 - 1] = this.value;\"> <b>A.</b> ' + optionA_step2 + '</b><BR>');
		}
		else 
		{
	spawn_step2.document.writeln('<INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"A\" onClick="opener.keeper_step2[opener.questionIndex2_step2 - 1] = this.value;\"> <b>A.</b> ' + optionA_step2 + '<BR>');
		}
	if (keeper_step2[questionIndex2_step2] == 'B') 
		{
	spawn_step2.document.writeln('<b style=\"background: yellow;\"><INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"B\" checked onClick="opener.keeper_step2[opener.questionIndex2_step2 - 1] = this.value;\"> <b>B.</b> ' + optionB_step2 + '</b><BR>');
		}
		else 
		{
	spawn_step2.document.writeln('<INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"B\" onClick="opener.keeper_step2[opener.questionIndex2_step2 - 1] = this.value;\"> <b>B.</b> ' + optionB_step2 + '<BR>');		
		}
	if (keeper_step2[questionIndex2_step2] == 'C') 
		{	
	spawn_step2.document.writeln('<b style=\"background: yellow;\"><INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"C\" checked onClick="opener.keeper_step2[opener.questionIndex2_step2 - 1] = this.value;\"> <b>C.</b> ' + optionC_step2 + '</b><BR>');
		}
		else 
		{
spawn_step2.document.writeln('<INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"C\" onClick="opener.keeper_step2[opener.questionIndex2_step2 - 1] = this.value;\"> <b>C.</b> ' + optionC_step2 + '<BR>');
		}
		if (keeper_step2[questionIndex2_step2] == 'D') 
		{	
	spawn_step2.document.writeln('<b style=\"background: yellow;\"><INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"D\" checked onClick="opener.keeper_step2[opener.questionIndex2_step2 - 1] = this.value;\"> <b>D.</b> ' + optionD_step2 + '</b><BR>');
		}
		else 
		{
	spawn_step2.document.writeln('<INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"D\" onClick="opener.keeper_step2[opener.questionIndex2_step2 - 1] = this.value;\"> <b>D.</b> ' + optionD_step2 + '<BR>');
		}
		if (keeper_step2[questionIndex2_step2] == 'E') 
		{	
	spawn_step2.document.writeln('<b style=\"background: yellow;\"><INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"E\" checked onClick="opener.keeper_step2[opener.questionIndex2_step2 - 1] = this.value;\"> <b>E.</b> ' + optionE_step2 + '</b><BR>');
		}
		else 
		{
	spawn_step2.document.writeln('<INPUT TYPE=RADIO NAME=\"answer\" VALUE=\"E\" onClick="opener.keeper_step2[opener.questionIndex2_step2 - 1] = this.value;\"> <b>E.</b> ' + optionE_step2 + '<BR>');
		}
		
	
		

	if (keeper_step2[questionIndex2_step2] != null) {
 	spawn_step2.document.writeln('<BR><input type=\"button\" value=\"Submit Answer\" onClick=\"opener.printList_step2(1);\">');
	} else {
		spawn_step2.document.writeln('<BR><input type=\"button\" value=\"Submit Answer\" onClick=\"opener.reviewQuiz_step2(false, ' + preventer2_step2 + ', ' + (questionIndex2_step2 + 1) +');\">');
	}
	
	
 	spawn_step2.document.writeln('</FORM></TD></TR></TABLE></CENTER></BODY></HTML>');	
	spawn_step2.document.close();
	
	// Increment variables for the next question
	questionIndex2_step2++;
	categoryIndex2_step2++;
	preventer2_step2++;
	}	
	
// Print the questions, answer options, and other info
function printResults_step2() {
//	putCorrect_step2();
	spawn_step2.document.clear();
	spawn_step2.document.open();
	spawn_step2.document.writeln('<HTML><HEAD>');
	spawn_step2.document.writeln('<TITLE>Kaplan Medical</TITLE>');
	spawn_step2.document.writeln('</HEAD><BODY BGCOLOR=\"WHITE\">');				
	spawn_step2.document.writeln('<FONT FACE=\"arial\" size=2>');
	spawn_step2.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_step2.document.writeln('<FONT FACE=\"arial\" STYLE=\"font-size:12;weight:bold;\"><b>OVERALL PERFORMANCE ANALYSIS<a href=\"javascript:opener.testDesc_step2();\"><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_step2.document.writeln('<FONT FACE=\"arial\" size=2><b>Overall Correct: ' + Math.round(correctAnswers_step2 / killers_step2.length * 100) + '%</b></font><br><br>');
	spawn_step2.document.writeln('<TABLE CellSpacing=0 cellPadding=3 width=700 BORDER=0 height=105><TR><TD WIDTH=35>');
	spawn_step2.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_step2 / killers_step2.length * 100)) + '><FONT color=#cc6633 size=1><b>' +  Math.round(correctAnswers_step2 / killers_step2.length * 100) + '%</b></FONT></TD></TR><TR><TD vAlign=top align=middle bgColor=#cc6633 height=' + correctAnswers_step2 / killers_step2.length * 100 + '><IMG height=1 src=\"images/spacer.gif\" width=1></TD></TR></TBODY></TABLE>');
	spawn_step2.document.writeln('</TD><TD VALIGN=BOTTOM NOWRAP><FONT FACE=\"arial\" size=1><FONT FACE=\"arial\" size=2>Correct: ' + correctAnswers_step2 + '<br>Incorrect: ' + (killers_step2.length - correctAnswers_step2) +'</TD></TR></TABLE><br><br>');




//SPECIALTY STUFF

	spawn_step2.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>SPECIALTIES</font></b><br><img src=\"images/element_bluedot.gif\" width=700 height=2 border=0><br>');

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

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

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

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

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

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

}	

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

spawn_step2.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>SUB-SPECIALTIES</font></b><br><img src=\"images/element_bluedot.gif\" width=700 height=2 border=0><br>');


//SUBSPECIALTY STUFF

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

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

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

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

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

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


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


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


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

	spawn_step2.document.writeln('</TD></TR></TABLE></BODY></HTML>');
}	



function testDesc_step2() {
	spawn_step2.document.clear();
	spawn_step2.document.open();
	spawn_step2.document.writeln('<HTML><HEAD>');
	spawn_step2.document.writeln('<TITLE>Kaplan Medical</TITLE>');
	spawn_step2.document.writeln('</HEAD><BODY BGCOLOR=\"WHITE\">');				
	spawn_step2.document.writeln('<FONT FACE=\"arial\" size=2>');
	spawn_step2.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_step2.document.writeln('<FONT FACE=\"arial\" STYLE=\"font-size:12;weight:bold;\"><b>QUESTION ANALYSIS<a href=\"javascript:opener.printResults_step2();\"><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_step2.document.writeln('<CENTER><TABLE CellSpacing=0 cellPadding=4 BORDER=0 WIDTH=500><TR><TD>');

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

			// Determine if the student answered each question appropriately, and display accordingly
			if (keeper_step2[i] == answers_step2[i]) {
			//correct
			spawn_step2.document.writeln('<BR><B><I><FONT COLOR=\"GREEN\">Correct, you answered ' + keeper_step2[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_step2[i] + '</TD></TR></TABLE><BR><BR><HR NOSHADE SIZE=1>'); 
				}
			//incorrect			
			else { spawn_step2.document.writeln('<BR><B><I><FONT COLOR=\"RED\">You answered ' + keeper_step2[i] + '\. The correct answer is: ' + answers_step2[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_step2[i] + '</TD></TR></TABLE><BR><BR><HR NOSHADE SIZE=1>'); 
				}
		}

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

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