var debug;

if(debug == 'true' || parent.ISDBSenrolled == 1)
	{NextEnabled = 1;}
else
	{NextEnabled = 0;}
	

var itdone = false;
	
function Clicked()
{
	var form = document.form1
	var vAnswered = 0;
	if (!itdone) {
	  for (var i=0; i < form.Quiz.length; i++)  {
		  //alert(form.Quiz[i].value) 
		  if(form.Quiz[i].value != '') {
			  vAnswered++;
		  }
	  }
	  
	  if (vAnswered == form.Quiz.length) {
		  DisplayFeedback(Feedback,Feedback)
		  
	  } else alert("Please type the answer and click Submit")
	}
}

function DisplayFeedback(Response,Feedback)
{
	//document.getElementById('maincontent').style.display = 'none';
	itdone = true;
	document.getElementById('feedbackDiv').style.display = 'block';	
	document.getElementById('feedbackDiv').focus();	
		
	    setNextActive()
		
		FeedBackText = ''

		FeedBackText = FeedBackText + '<div id="FBtext" style="background-color:#FFFFFF; overflow:auto; padding:0px;" >';	
		
		FeedBackText = FeedBackText + '<p>';
		FeedBackText = FeedBackText + Feedback;
		FeedBackText = FeedBackText + '</p></div>';		
	
		//document.getElementById('feedbackDiv').innerHTML=FeedBackText;
		openFeedbackWindow(FeedBackText);
}


function setNextActive()
{
	if(document.getElementById("next"))
		document.getElementById("next").style.visibility = "visible";
}

function openFeedbackWindow(feedback){

    wh = window.open("","feedback","height=400px,width=450px,status=1,scrollbars=yes");

	wh.document.open();
	wh.document.writeln("<html><head><title>Question Feedback</title>");
	wh.document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../naracui.css\" />");
    wh.document.writeln("</head>");
    wh.document.writeln("<body class=\"popup\">");        
    wh.document.writeln("<div id=\"content\" style=\"position:absolute;top:0px;overflow:auto;\">" + feedback + "</div>");
    wh.document.writeln("</body>");
    wh.document.writeln("</html>");
	wh.document.close();
	wh.focus();
}



