
var QID = new Array(numQues);
var AID = new Array(numQues);
var theirAnswers = new Array(numQues);
var aCount = 0;
var theScore = 0;
var theNum = 0;

function loadAnArray(theID,theAns)
{
	aCount = aCount + 1;
	QID[aCount] = theID;
	AID[aCount] = theAns;
}

function hideQList()
{

	if (document.all)
	{
		var it = eval("document.all.QADiv" + QID[1] + ".style");
		it.visibility = "visible";
	}
	else if (document.getElementById)
	{
		
		var it = eval("document.getElementById('QADiv" + QID[1] + "').style");
		it.visibility = "visible";
	}
	else
	{
		var it = eval("document.QADiv" + QID[1]);
		it.visibility = "visible";
	}
}

function gradeQA(y,quesID,form,theans)
{

	var theA = getSelectedButton(form);
	var prevSound = 0;
	
	this.thisy = y;
	
	theNum = theNum + 1;
	if (document.all)
	{
		
		var it = eval("document.all.QADiv" + quesID + ".style");
		it.visibility = "hidden";
		
		daExpert = eval("document.all.theExpert" + quesID + ".style")
		daExpert.visibility = "visible";
		
		daAnswer = eval("document.all.the" + theA + "for" + QID[y])
		daAnswer.src = "/f_share_html/virtualexam/images/ckon.gif";
		theirAnswers[y-1] = theans;
	}
	else if (document.getElementById)
	{		
				
		var it = eval("document.getElementById('QADiv" + quesID + "').style");
		it.visibility = "hidden";
		
		daExpert = eval("document.getElementById('theExpert" + quesID + "').style")
		daExpert.visibility = "visible";
		
		daAnswer = eval("document.images['the" + theA + "for" + QID[y] + "']")
		daAnswer.src = "/f_share_html/virtualexam/images/ckon.gif";
		theirAnswers[y-1] = theans;

	}
	else
	{
		var it = eval("document.QADiv" + quesID); 
		it.visibility = "hidden";

		daExpert = eval("document.theExpert" + quesID)
		finalExpert = eval("document.theFinalExpert")
		daExpert.visibility = "visible";

		daAnswer = eval("document.theExpert" + quesID + ".document.the" + theA + "for" + QID[y])
		daAnswer.src = "/f_share_html/virtualexam/images/ckon.gif";
		theirAnswers[y-1] = theans;
	}
	// timerID = setTimeout("afterGrade(y)", 3000);
}

function afterGrade(x)
{	
	if (x < numQues)
	{
		if (document.all)
		{					
			
			var next = eval("document.all.QADiv" + QID[x+1] + ".style");
			var it = eval("document.all.QADiv" + QID[x] + ".style");		
		}
		else if (document.getElementById)
		{
			var next = eval("document.getElementById('QADiv" + QID[x+1] + "').style");
			var it = eval("document.getElementById('QADiv" + QID[x] + "').style");
		}
		else
		{
			var next = eval("document.QADiv" + QID[x+1]);
			var it = eval("document.QADiv" + QID[x]);

		}
		
		daExpert.visibility = "hidden";
		it.visibility = "hidden";
		next.visibility = "visible";
	}

	else
	{
	
		var theanswers = theirAnswers;
		var theQID = QID;
		var theLastQID = QID[6];
		
		document.tempForm.theArray.value = theanswers;
		document.tempForm.QID.value = theQID;
		document.tempForm.LastQID.value = theLastQID;

		document.tempForm.submit();
		
	}
}

function doShowDiv(y,form)
		{
			
			var theA = getSelectedButton(form);
		
			if (document.all)
			{
			document.all.theLastQuestion.style.visibility = "hidden";
			document.all.theirAnswers.style.visibility = "hidden";
			showExpertFinalPage(theA);		
			}
			else if (document.getElementById)
			{
			document.getElementById("theLastQuestion").style.visibility = "hidden";
			document.getElementById("theirAnswers").style.visibility = "hidden";
			showExpertFinalPage(theA);
			}
			else
			{
			
			document.theLastQuestion.visibility = "hidden";
			document.theirAnswers.visibility = "hidden";			
			showExpertFinalPage(theA);	
					
			}	
		}

function showExpertFinalPage(theA)
{
	var xQID = theQID;
	
	//document.write("<form method='post' name='finalTempForm' action='VEExpertFinal.cfm'>");
	//document.write("<input type='hidden' name='theA' value=" + theA + ">");
	//document.write("<input type='hidden' name='LastQID' value='" + xQID + "'>");
	//document.write("</form>")

	document.finalTempForm.theA.value = theA;
	document.finalTempForm.LastQID.value = xQID;
		
	document.finalTempForm.submit();	
}

function getSelectedButton(radioGroup)
{

	for (var i = 0; i < radioGroup.length; i++)
	{
		if (radioGroup[i].checked)
		{
			return radioGroup[i].value
		}
	}
}

function showVEExamLastAnswers()
{
	
	document.write( "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"\n" );
	
	document.write( "  codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab##version=5,0,0,0\"\n" );
	
	document.write( "  id=\"Movie1\" width=\"202\" height=\"212\">\n" );
	
	document.write( "  <param name=\"movie\" value=\"/fed101/VirtualExam/VEExamLastAnswers.swf?" + zStr + "\">\n" );
	
	document.write( "  <param name=\"quality\" value=\"best\">\n" );
	
	document.write( "  <param name=\"wmode\" value=\"transparent\">\n" );
	
	document.write( "  <param name=\"bgcolor\" value=\"#FFFFFF\">\n" );
	
	document.write( "    <embed name=\"Movie1\" src=\"/fed101/VirtualExam/VEExamLastAnswers.swf?" + zStr + "\"\n" );
	
	document.write( "     menu=\"false\" quality=\"best\" wmode=\"transparent\" bgcolor=\"#FFFFFF\" swLiveConnect=\"true\"\n" );
	
	document.write( "     width=\"202\" height=\"212\"\n" );
	
	document.write( "     type=\"application/x-shockwave-flash\"\n" );
	
	document.write( "     pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>\n" );
	
	document.write( "</object>\n" );

}

function showVEDivsLoanInfo()
{

	document.write( "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"\n" );
	
	document.write( "  codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\"\n" );
	
	document.write( "  id=\"Movie1\" width=\"313\" height=\"256\">\n" );
	
	document.write( "  <param name=\"movie\" value=\"/fed101/VirtualExam/VEDivsLoanInfo.swf\">\n" );
	
	document.write( "  <param name=\"quality\" value=\"best\">\n" );
	
	document.write( "  <param name=\"wmode\" value=\"transparent\">\n" );
	
	document.write( "  <param name=\"bgcolor\" value=\"#FFFFFF\">\n" );
	
	document.write( "    <embed name=\"Movie1\" src=\"/fed101/VirtualExam/VEDivsLoanInfo.swf\"\n" );
	
	document.write( "     menu=\"false\" quality=\"best\" wmode=\"transparent\" bgcolor=\"#FFFFFF\" swLiveConnect=\"true\"\n" );
	
	document.write( "     width=\"313\" height=\"256\"\n" );
	
	document.write( "     type=\"application/x-shockwave-flash\"\n" );
	
	document.write( "     pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>\n" );
	
	document.write( "</object>\n" );
	
}
