
var Progress = "1" ;

function Clicked()
{
	//alert("CorrectAnswer is " + CorrectAnswer + " and Value is " + document.form1.CheckMe.value);
	//alert(document.form1.CheckMe.value == CorrectAnswer);
	if (document.form1.CheckMe.value == ""){
		alert("\nYou need to answer the question to continue.")
	}else{
		if (Progress == "1"){
			if (document.form1.CheckMe.value == CorrectAnswer){
				DisplayFeedback('Correct',Feedback);
				Progress++;
			}else{
				DisplayFeedback('Incorrect',FeedbackWrong1);
			}
			
		}else if (Progress == "2"){
			if (document.form1.CheckMe.value == CorrectAnswer){
				DisplayFeedback('Correct',Feedback);	
			}else{
				DisplayFeedback('Incorrect',FeedbackWrong2);
			}
		}
	}	
}

function SwapMe(){
	//alert("Attempt is " + Attempt);
	if (Progress == 2){
		self.location = NextPage;
	}		
	
	if (Progress == 1){
		Progress++;
		self.focus();
	}
}




function DisplayFeedback(Response,Feedback)
{
	if(Response == "Correct") {Answer = '<img src="../images/correct.gif" WIDTH=450 HEIGHT=36 BORDER=0 alt="Correct, Review the feedback below.  When you are ready to proceed, click on the Continue button.">'};
	if(Response == "Incorrect") {Answer = '<img src="../images/correctNot.gif" WIDTH=450 HEIGHT=33 BORDER=0 alt="Incorrect, Review the feedback below.  When you are ready to proceed, click on the Continue button.">'};
		

		vwidth = 570;
		vheight = 450;
		sWidth = screen.width;
		tWidth = (sWidth/2);
		hWidth = (vwidth/2);
		uWidth = (tWidth-hWidth);
		

			
	FBwin=window.open("","Feedback2","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=no,width=" + vwidth + ",height=" + vheight + ",left=" + uWidth + ",top=50");
	if (FBwin != null)
	{
	if (FBwin.opener == null) {FBwin.opener = window};
		FeedBackText = ''
		FeedBackText = FeedBackText + '<html><head><title>Feedback &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</title>';
		FeedBackText = FeedBackText + '</head><link rel="stylesheet" href="../files/Feedback.css">';
		FeedBackText = FeedBackText + '<body bgcolor="white" onload="self.focus()" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>';
		FeedBackText = FeedBackText + '<TABLE  width="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>	<TR><TD><IMG SRC="../images/feedback_01.gif" ALT="Feedback"></TD><TD><IMG SRC="../images/feedbackCompare_03.gif" ALT="" border="0" name="printme1"><a href="javascript:opener.SwapMe();self.close(); void(0);" onMouseOver="document.closeme.src=\'../images/feedbackHi_02.gif\';" onMouseOut="document.closeme.src=\'../images/feedback_02.gif\';"><IMG SRC="../images/feedback_02.gif" ALT="Continue" border="0" name="closeme"></a></TD><td width="100%" background="../images/feedback_03.gif"><IMG SRC="../images/feedback_03.gif" ALT=""></td>	</TR></TABLE></td></tr><tr><td height="100%" valign="top">';
		FeedBackText = FeedBackText + '<table width="100%" border="0" cellspacing="0" cellpadding="12"><tr bgcolor="#FFFFFF">	<td><p>';
		FeedBackText = FeedBackText + Answer;
		FeedBackText = FeedBackText + '<p>';
		FeedBackText = FeedBackText + Feedback;
		FeedBackText = FeedBackText + '</td></tr></table></td></tr><tr><td><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><IMG SRC="../images/feedbackBtm_01.gif" ALT="Feedback"><IMG SRC="../images/feedbackCompareBtm_02.gif" ALT="" border="0" name="printme2"><a href="javascript:opener.SwapMe();self.close(); void(0);" onMouseOver="document.closeme2.src=\'../images/feedbackBtmHi_02.gif\';" onMouseOut="document.closeme2.src=\'../images/feedbackBtm_02.gif\';"><IMG SRC="../images/feedbackBtm_02.gif" ALT="Continue" border="0" name="closeme2"></a><IMG SRC="../images/feedbackBtm_03.gif" ALT=""></td>	</TR></TABLE></td></tr></table></body></html>';
	
		FBwin.document.write(FeedBackText);
		FBwin.document.close();
	}	
}

