
var correct_width;
	var correct_height;
	var incorrect_width;
	var incorrect_height;
	var pop_width;
	var pop_height;
	var all;
	var tries = 0;

function popText(what) {

mywin = window.open(	"", 
						"PopUp", 
						"resizable=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,width=400,height=300");

// write to it
	mywin.document.open();
	mywin.document.writeln("<html><head><title>DLink</title>");
	mywin.document.writeln("</head><body bgcolor=#ffffff><br>");
	mywin.document.writeln("<table align=center width=85%><tr><td>");
	mywin.document.writeln(what);
	mywin.document.writeln("</td></tr><tr><td>");
	mywin.document.writeln("<br><a href=\"javascript:window.close()\;\">Close</a>");	
	mywin.document.writeln("</td></tr></table></body>");
	
	mywin.document.close();
	
	// bring it to the front
	mywin.focus();

}	
	
	
function popup_swap(which, moveup, trytimes) {

if (trytimes < 2) {
	if (which == "over") {
		where = moveup + "images/tryagain_yy.jpg"
	} else if (which == "out") {
		where = moveup + "images/tryagain_xx.jpg"
	} else if (which == "down") {
		where = moveup + "images/tryagain_zz.jpg"
	}
} else {
	if (which == "over") {
		where = moveup + "images/cloze_pop_yy.jpg"
	} else if (which == "out") {
		where = moveup + "images/cloze_pop_xx.jpg"
	} else if (which == "down") {
		where = moveup + "images/cloze_pop_zz.jpg"
	}
}
document.closeme.src = where;
}

function done_swap(which, moveup) {

if (in_review == false) {
	if (which == "over") {
		where = moveup + "images/done_yy.gif"
	} else if (which == "out") {
		where = moveup + "images/done_xx.gif"
	} else if (which == "down") {
		where = moveup + "images/done_zz.gif"
	}
} else {
	if (which == "over") {
		where = moveup + "images/review_yy.gif"
	} else if (which == "out") {
		where = moveup + "images/review_xx.gif"
	} else if (which == "down") {
		where = moveup + "images/review_zz.gif"
	}
}
//alert(where);
document.question.donebutton.src = where;
}

function tryagain_swap(which, moveup) {


	if (which == "over") {
		where = moveup + "images/tryagain_yy.jpg"
	} else if (which == "out") {
		where = moveup + "images/tryagain_xx.jpg"
	} else if (which == "down") {
		where = moveup + "images/tryagain_zz.jpg"
	}

//alert(where);
document.question.tryagain.src = where;
}

function popup_d_link(d_description) {

mywin = window.open(	"", 
						"DLink", 
						"resizable=1,toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,copyhistory=0,width=400,height=300");

// write to it
	mywin.document.open();
	mywin.document.writeln("<html><head><title>DLink</title>");
	mywin.document.writeln("</head><body bgcolor=#ffffff><br>");
	mywin.document.writeln("<table align=center width=85%><tr><td>");
	mywin.document.writeln(d_description);
	mywin.document.writeln("</td></tr><tr><td>");
	mywin.document.writeln("<br><br><a href=\"javascript:window.close()\;\">Close</a>");	
	mywin.document.writeln("</td></tr></table></body>");
	
	mywin.document.close();
	
	// bring it to the front
	mywin.focus();
}



function comment_tool(course_id, course_name, sco_id, sco_name, page_id, page_name, sequence) {

	//alert (page_id + ", " + page_name + ".");

	// open the window
	mywin = window.open(	"", 
						"_Comments", 
						"resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,width=300,height=100");
	myPageName = window.location;
	myPageNameTwo = myPageName + "";
	myArray = myPageNameTwo.split("/");
	myPageLocation = myArray.pop();
	//alert(myPageLocation);
	// write to it
	mywin.document.open();
	mywin.document.writeln("<html><head><title>_Comments</title>");
	mywin.document.writeln("<script type=\"text/javascript\">");
	mywin.document.writeln("function open_comment_window(window_loc) {");
	mywin.document.writeln("newwin = window.open( window_loc, \"Comments\", \"width=800,height=600,scrollbars=1\"\)\;");
	mywin.document.writeln("newwin.focus();");
	mywin.document.writeln("}");
	mywin.document.writeln("</script>");
	mywin.document.writeln("</head><body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>");
	mywin.document.writeln("<br><table width=90% border=0 align=center><tr><td align=center>");
	mywin.document.writeln("<a href=\"javascript:open_comment_window(\'http://c2build.c2ti.com/master_comments/submit_comment.asp?course_id=" + course_id + "&course_name=" + course_name + "&sco_id=" + sco_id + "&sco_name=" + sco_name + "&page_id=" + page_id + "&page_name=" + page_name + "&page_file_name=" + myPageLocation + "&page_path=" + myPageName + "\'\)\" >Add Comment</a>&nbsp;&nbsp;&nbsp;");
	mywin.document.writeln("<a href=\"javascript:open_comment_window(\'http://c2build.c2ti.com/master_comments/view_comment.asp?course_id=" + course_id + "&course_name=" + course_name + "&sco_id=" + sco_id + "&sco_name=" + sco_name + "&page_id=" + page_id + "&page_name=" + page_name + "&page_file_name=" + myPageLocation + "&page_path=" + myPageName + "\'\)\" >View Comments</a>");
	mywin.document.writeln("</td></tr></table></html>");
	mywin.document.close();
	
	// bring it to the front
	mywin.focus();
	
}

function open_edit_window( myLocation, myName, myWidth, myHeight, scrollbar) {	
		myWin= open(myLocation, myName ,"width="+myWidth+",height="+myHeight+",location=no,status=yes,toolbar=no,menubar=no,scrollbars="+scrollbar+",top=0,left=0");
		myWin.focus();		
}

function open_exam_window( myName, myWidth, myHeight, scrollbar){

	var StringNum = Math.round(Math.random()*2+1);
	
	  if (StringNum == 1) {
		myLocation = "Exam1.htm"
	} else if (StringNum == 2){
		myLocation = "Exam2.htm"
	} else if (StringNum == 3){
		myLocation = "Exam3.htm"
	}	
		
		myWin= open(myLocation, myName ,"width="+myWidth+",height="+myHeight+",location=no,status=yes,toolbar=no,menubar=no,scrollbars=yes,top=0,left=0");
		myWin.focus();		
}

function open_SA_exam_window( myName, myWidth, myHeight, scrollbar){

	var StringNum = Math.round(Math.random()*2+1);
	
	  if (StringNum == 1) {
		myLocation = "Exam1SA.htm"
	} else if (StringNum == 2){
		myLocation = "Exam2SA.htm"
	} else if (StringNum == 3){
		myLocation = "Exam3SA.htm"
	}	
		
		myWin= open(myLocation, myName ,"width="+myWidth+",height="+myHeight+",location=no,status=yes,toolbar=no,menubar=no,scrollbars=yes,top=0,left=0");
		myWin.focus();		
}

function open_course_window( myLocation, myName, myWidth, myHeight) {	
		window.opener.top.location = myLocation;
		window.close();		
}

function open_cc(theSTRING) {

mywin = window.open(	"", 
						"Showtext", 
						"resizable=1,toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,copyhistory=0,width=400,height=300");
	mywin.document.open();
	mywin.document.writeln("<html><head><title>Showtext</title>");
	mywin.document.writeln("</head><body bgcolor=#CECBCE><br>");
	mywin.document.writeln("<table align=center width=85%><tr><td>");
	mywin.document.writeln(theSTRING);
	mywin.document.writeln("</td></tr><tr><td>");
	mywin.document.writeln("<br><br><a href=\"javascript:window.close()\;\">Close</a>");	
	mywin.document.writeln("</td></tr></table></body>");
	mywin.document.close();
	mywin.focus();
}

function simple_roll(name, newloc) {

eval ('window.document.' + name + '.src = \'' + newloc + '\'');

}

function replay_audio() {

	//document.narr.GotoFrame(0);
	//document.narr.Play();
	document.location.reload();
	
}

function eval_question(my_id) {

	var right=false;
	var wrong=false;

	
	if (pop_width > 0) {  } else {pop_width = 500;}
	if (pop_height > 0) {  } else {pop_height = 360;}
	if (correct_width>0) {	} else {correct_width = 500;}
	if (correct_height>0) {	} else {correct_height = 160;}
	if (incorrect_width>0) { } else {incorrect_width = 500;}
	if (incorrect_height>0) { } else {incorrect_height = 160;}
	
	if (correctfeedback == "") {
			popup_feedback(reviewcontent, '500', '250');
			review_loc = moveup + "images/review_xx.jpg"
			document.question.donebutton.width= 0;
			document.question.donebutton.height= 0;
			if (all == true) {
				for (x=0; x < document.question.elements.length; x++) {
					if (document.question.elements[x].value == 1) {
						document.question.elements[x].checked = true;
					} else {
						document.question.elements[x].checked = false;
					}
				}
			}
			in_review=true;
			tries = 2;
				
	} else {
		//alert(document.question.elements.length);
		for (x=0; x < document.question.elements.length; x++) {
			if ((document.question.elements[x].value == 1) && (document.question.elements[x].checked)) {
				right=true;
			} else if ((document.question.elements[x].value == 1) && (!(document.question.elements[x].checked))) {
				wrong=true;
				if (tries == 1) {
					document.question.elements[x].checked = true;
				}
			} else if ((document.question.elements[x].value == 0) && (document.question.elements[x].checked)) {
				wrong=true;
				document.question.elements[x].checked = false;
			}	
		}
	
		//do the first time around
		if (tries == 0) {
			if ((right) && (!(wrong))) {
				popup_feedback(correctfeedback, correct_width, correct_height);
				tries = 2;
				review_loc = moveup + "images/review_xx.jpg"
				document.question.donebutton.width= 0;
				document.question.donebutton.height= 0;
				in_review=true;
			} else {
				popup_feedback_try1 (incfeedback1, incorrect_width, incorrect_height);
				tries = 1;
			}
		} else if (tries == 1) {
			if ((right) && (!(wrong))) {
				popup_feedback(correctfeedback, correct_width, correct_height);
				tries = 2;
				review_loc = moveup + "images/review_xx.jpg"
				document.question.donebutton.width= 0;
				document.question.donebutton.height= 0;
				in_review=true;
			} else {
				popup_feedback_try2 (incfeedback2, incorrect_width, incorrect_height);
				tries = 2;
				review_loc = moveup + "images/review_xx.jpg"
				document.question.donebutton.src = review_loc;
				document.question.donebutton.alt = 'Review';
				in_review=true;
			}
		} else {	
		popup_feedback(reviewcontent, pop_width, pop_height);	
		}
	}
}

function eval_pick_list(howmany) {

	var right=false;
	var wrong=false;
	
	if (pop_width > 0) {  } else {pop_width = 500;}
	if (pop_height > 0) {  } else {pop_height = 350;}
	if (correct_width>0) {	} else {correct_width = 500;}
	if (correct_height>0) {	} else {correct_height = 160;}
	if (incorrect_width>0) { } else {incorrect_width = 500;}
	if (incorrect_height>0) { } else {incorrect_height = 160;}
	
	for (x=0; x < document.question.elements.length; x++) {
		if (document.question.elements[x].name != "Submit") {
			if(document.question.elements[x].value == 1) {
				right=true;
			} else {
				if (tries == 0) {
				document.question.elements[x].options[0].selected = true;
				}
				wrong=true;
			}		
			if (tries == 1) {
				for (y=0; y < howmany; y++) {
					if (document.question.elements[x].options[y].value == 1) {
						document.question.elements[x].options[y].selected = true;
					}
				}
			}
		}
	}
	
		if (tries == 0) {
			if ((right) && (!(wrong))) {
				popup_feedback(correctfeedback, correct_width, correct_height);
				tries = 2;
				review_loc = moveup + "images/review_xx.jpg"
				document.question.donebutton.width= 0;
				document.question.donebutton.height= 0;
				in_review=true;
			} else {
				popup_feedback_try1 (incfeedback1, incorrect_width, incorrect_height);
				tries = 1;
			}
		} else if (tries == 1) {
			if ((right) && (!(wrong))) {
				popup_feedback(correctfeedback, correct_width, correct_height);
				tries = 2;
				review_loc = moveup + "images/review_xx.jpg"
				document.question.donebutton.width= 0;
				document.question.donebutton.height= 0;
				in_review=true;
			} else {
					
				popup_feedback_try2 (incfeedback2, incorrect_width, incorrect_height);
				tries = 2;
				review_loc = moveup + "images/review_xx.jpg"
				document.question.donebutton.src = review_loc;
				document.question.donebutton.alt = 'Review';
				in_review=true;

			}
		} else {	
		popup_feedback(reviewcontent, pop_width, pop_height);	
		}
}


function popup_feedback (content, width, height) {
//alert("doing popupp feedback: - " + content + " - " + width + " = " + height);
old_x = parent.screenLeft;
old_y = parent.screenTop;
new_x = old_x + (400 - width/2);
new_y = old_y + (300 - height/2);

new_x = Math.ceil(new_x);
new_y = Math.ceil(new_y);
//alert(new_x + " - " + new_y);

closeButton = "<div class=\"hand\" ><div class=\"closing\"><img tabindex=1 src=\"" + moveup + "images/cloze_pop_xx.jpg\" name=\"closeme\" alt=\"Close\" width=79 height=21 onClick=\"window.close();\" onkeypress=\"window.close();\"  onMouseOver=\"opener.popup_swap_pop('over', '" + moveup + "', '2');\" onMouseOut=\"opener.popup_swap_pop('out', '" + moveup + "', '2');\" onMouseDown=\"opener.popup_swap_pop('down', '" + moveup + "', '2');\"></div></div>"

	mywin = window.open(	"", 
						"Feedback", 
						"resizable=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,copyhistory=0,width=" + width + ",height=" + height + ",left=" + new_x + ",top=" + new_y);

// write to it
	mywin.document.open();
	//mywin.document.writeln("hello");
	//mywin.document.writeln("<html><head><title>Popup</title>");
	//mywin.document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + moveup + "usmc_links.css\">");
	//mywin.document.writeln("<script type=\"text/javascript\" src=\"" + moveup + "scripts/questions.js\"></scrip" + "t>");
	mywin.document.writeln("<style type=\"text/css\"> .closing { 	position:absolute; 	left:" + (width - 100) + "px; top:" + (height - 30) + "px; } .hand { cursor:hand; } p, li, td { color: Black;font-family: Arial, Helvetica, sans-serif;font-size: 12px; } </style>");
	mywin.document.writeln("<body bgcolor=#CCCCCC>");
	//mywin.document.writeln("</head><body bgcolor=#CCCCCC onLoad=\"javascript:find_button('" + moveup + "');\"><br>");
	//mywin.document.writeln("<table align=center width=95%><tr><td>");
	mywin.document.writeln("<p>" + content + "</p>");
	//mywin.document.writeln("</td></tr></table>");
	mywin.document.writeln(closeButton);	
	//mywin.document.writeln("</body>");
	
	//mywin.document.close();
	
	// bring it to the front
	mywin.focus();

}


function popup_feedback_try1 (content, width, height) {
//alert("doing popupp feedback try 1: - " + content + " - " + width + " = " + height);
old_x = parent.screenLeft;
old_y = parent.screenTop;
new_x = old_x + (400 - width/2);
new_y = old_y + (300 - height/2);

new_x = Math.ceil(new_x);
new_y = Math.ceil(new_y);
//alert(new_x + " - " + new_y);

closeButton = "<div class=\"hand\" ><div class=\"closing\"><img tabindex=1 src=\"" + moveup + "images/tryagain_xx.jpg\" name=\"closeme\" alt=\"Try Again\" width=79 height=21 onClick=\"window.close();\" onkeypress=\"window.close();\"  onMouseOver=\"opener.popup_swap_pop('over', '" + moveup + "', '1');\" onMouseOut=\"opener.popup_swap_pop('out', '" + moveup + "', '1');\" onMouseDown=\"opener.popup_swap_pop('down', '" + moveup + "', '1');\"></div></div>"

mywin = window.open(	"", 
						"Feedback1", 
						"resizable=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,copyhistory=0,width=" + width + ",height=" + height + ",left=" + new_x + ",top=" + new_y);

// write to it
	mywin.document.open();
	//mywin.document.writeln("hello");
	//mywin.document.writeln("<html><head><title>Popup</title>");
	//mywin.document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + moveup + "usmc_links.css\">");
	//mywin.document.writeln("<script type=\"text/javascript\" src=\"" + moveup + "scripts/questions.js\"></scrip" + "t>");
		mywin.document.writeln("<style type=\"text/css\"> .closing { 	position:absolute; 	left:" + (width - 100) + "px; top:" + (height - 30) + "px; } .hand { cursor:hand; } p, li, td { color: Black;font-family: Arial, Helvetica, sans-serif;font-size: 12px; } </style>");
		mywin.document.writeln("<body bgcolor=#CCCCCC>");
	//mywin.document.writeln("</head><body bgcolor=#CCCCCC onLoad=\"javascript:find_button('" + moveup + "');\"><br>");
	//mywin.document.writeln("<table align=center width=95%><tr><td>");
	mywin.document.writeln("<p>" + content + "</p>");
	//mywin.document.writeln("</td></tr></table>");
	mywin.document.writeln(closeButton);	
	//mywin.document.writeln("</body>");
	
	//mywin.document.close();
	
	// bring it to the front
	mywin.focus();

}


function popup_feedback_try2 (content, width, height) {
//alert("doing popupp feedback try2: - " + content + " - " + width + " = " + height);
old_x = parent.screenLeft;
old_y = parent.screenTop;
new_x = old_x + (400 - width/2);
new_y = old_y + (300 - height/2);

new_x = Math.ceil(new_x);
new_y = Math.ceil(new_y);
//alert(new_x + " - " + new_y);
closeButton = "<div class=\"hand\" ><div class=\"closing\"><img tabindex=1 src=\"" + moveup + "images/cloze_pop_xx.jpg\" name=\"closeme\" alt=\"Close\" width=79 height=21 onClick=\"window.close();\" onkeypress=\"window.close();\" onMouseOver=\"opener.popup_swap_pop('over', '" + moveup + "', '2');\" onMouseOut=\"opener.popup_swap_pop('out', '" + moveup + "', '2');\" onMouseDown=\"opener.popup_swap_pop('down', '" + moveup + "', '2');\"></div></div>"
mywin = window.open(	"", 
						"Feedback2", 
						"resizable=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,copyhistory=0,width=" + width + ",height=" + height + ",left=" + new_x + ",top=" + new_y);

// write to it
	mywin.document.open();
	//mywin.document.writeln("hello"); 
	//mywin.document.writeln("<html><head><title>Popup</title>");
	//mywin.document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + moveup + "usmc_links.css\">");
	//mywin.document.writeln("<script type=\"text/javascript\" src=\"" + moveup + "scripts/questions.js\"></scrip" + "t>");
	mywin.document.writeln("<style type=\"text/css\"> .closing { 	position:absolute; 	left:" + (width - 100) + "px; top:" + (height - 30) + "px; } .hand { cursor:hand; } p, li, td { color: Black;font-family: Arial, Helvetica, sans-serif;font-size: 12px; } </style>");
	mywin.document.writeln("<body bgcolor=#CCCCCC>");
	//mywin.document.writeln("</head><body bgcolor=#CCCCCC onLoad=\"javascript:find_button('" + moveup + "');\"><br>");
	//mywin.document.writeln("<table align=center width=95%><tr><td>");
	mywin.document.writeln("<p>" + content + "</p>");
	//mywin.document.writeln("</td></tr></table>");
	mywin.document.writeln(closeButton);	
	//mywin.document.writeln("</body>");
	
	//mywin.document.close();
	
	// bring it to the front
	mywin.focus();

}

function popup_swap_pop(which, moveup, trytimes) {

if (trytimes < 2) {
	if (which == "over") {
		where = moveup + "images/tryagain_yy.jpg"
	} else if (which == "out") {
		where = moveup + "images/tryagain_xx.jpg"
	} else if (which == "down") {
		where = moveup + "images/tryagain_zz.jpg"
	}
} else {
	if (which == "over") {
		where = moveup + "images/cloze_pop_yy.jpg"
	} else if (which == "out") {
		where = moveup + "images/cloze_pop_xx.jpg"
	} else if (which == "down") {
		where = moveup + "images/cloze_pop_zz.jpg"
	}
}
	
mywin.document.closeme.src = where;
}

function display_content() {

objRef = eval("words");
objRef.style.color = '#000000';


}

function eval_jumper() {

	if (document.question.elements[0].checked) {
		window.location="page0140_jmp.html";
	} else if (document.question.elements[1].checked) {
		window.location="page0130_jmp.html";
	} else if (document.question.elements[2].checked) {
		window.location="page0120_jmp.html";
	} else {
	alert("Please choose one of the options");
	}
}

function OverOption(which) {
//alert(which);
theOne = eval("document.question.opt_" + which);
newSource = moveup + "images/btn" + which + "_over.jpg";
theOne.src = newSource;
//do the words
theWords = eval("choice_" + which);
theWords.style.color = '#000099';
}

function OutOption(which) {
//alert(which);
	if (eval("selected_" + which) == false) {
		theOne = eval("document.question.opt_" + which);
		newSource = moveup + "images/btn" + which + ".jpg";
		theOne.src = newSource;
		//do the words
		theWords = eval("choice_" + which);
		theWords.style.color = '#000000';
	}
}

function ClickOption(which, value) {
if (tries == 0) {
	eval("selected_" + which + " = true");
	question_feedback.style.visibility = "hidden";
	if (value == 1) {
		is_correct = true;
	} else {
		is_correct = false;
	}
	for (x=1; x<totaloptions+1; x++) {
		if (x != which) {
			eval("selected_" + x + " = false");
			theOne = eval("document.question.opt_" + x);
			newSource = moveup + "images/btn" + x + ".jpg";
			theOne.src = newSource;
					//do the words
		theWords = eval("choice_" + x);
		theWords.style.color = '#000000';
		}
	}
}
//alert(which);
}


function OverOptionTEST(which) {
//alert(which);
if (active == true) {
	theOne = eval("document.question.opt_" + which);
	newSource = moveup + "images/btn" + which + "_over.jpg";
	theOne.src = newSource;
	//do the words
	theWords = eval("choice_" + which);
	theWords.style.color = '#ff9900';
	}
}

function OutOptionTEST(which) {
//alert(which);
if (active == true) {
	if (eval("selected_" + which) == false) {
		theOne = eval("document.question.opt_" + which);
		newSource = moveup + "images/btn" + which + ".jpg";
		theOne.src = newSource;
		//do the words
		theWords = eval("choice_" + which);
		theWords.style.color = '#000000';
	}
	}
}

function ClickOptionTEST(which, value) {
if (tries == 0) {
	eval("selected_" + which + " = true");
	question_feedback.style.visibility = "hidden";
	if (value == 1) {
		is_correct = true;
	} else {
		is_correct = false;
	}
	for (x=1; x<totaloptions+1; x++) {
		if (x != which) {
			eval("selected_" + x + " = false");
			theOne = eval("document.question.opt_" + x);
			newSource = moveup + "images/btn" + x + ".jpg";
			theOne.src = newSource;
					//do the words
		theWords = eval("choice_" + x);
		theWords.style.color = '#000000';
		}
	}
}
//alert(which);
}


function DoneRollOver() {
		document.question.Done.src= moveup + "images/done_over.jpg";
}

function DoneRollOut() {
		document.question.Done.src= moveup + "images/done.jpg";
}

function DoneRollOverTEST() {
	if (active == true) {
		document.question.Done.src= moveup + "images/done_over.jpg";
		}
}

function DoneRollOutTEST() {
	if (active == true) {
		document.question.Done.src= moveup + "images/done.jpg";
		}
}

function evalTest() {
if (tries == 0) {

//check to make sure something has been clcked
	choice = false;
	for (x=1; x<6; x++) {
		if (eval("selected_" + x) == true) {
		choice = true;
		} 
	}
	if (choice == true) {
		active = false;
		if (is_correct == true) {
		//alert("correct");
		top.topEmpty.correctCounter = top.topEmpty.correctCounter + 1;
		top.topEmpty.questionCounter = top.topEmpty.questionCounter + 1;
		question_feedback.style.visibility = "visible";
		feedback_content.innerHTML = correctfeedback;
		move_on = true;
		wait_roll(next_name,next_image);
		tries++;
		howmany = totaloptions + 1;
		for (x=1; x<howmany; x++) {
			if (theOption == x) {
				theOne = eval("document.question.opt_" + x);
				newSource = moveup + "images/btn" + x + "_over.jpg";
				theOne.src = newSource;
				theOne.style.cursor = "default";
				theWords = eval("choice_" + x);
				theWords.style.color = 'white';
				theWords.style.cursor = "default";
			} else {
				theOne = eval("document.question.opt_" + x);
				newSource = moveup + "images/btn" + x + ".jpg";
				theOne.src = newSource;
				theOne.style.cursor = "default";
				theWords = eval("choice_" + x);
				theWords.style.color = '676767';
				theWords.style.cursor = "default";
			}
		}
		document.question.Done.src= moveup + "images/done.jpg";
		document.question.Done.style.cursor = "default";
		} else {
		//highlight the correct one
		howmany = totaloptions + 1;
		for (x=1; x<howmany; x++) {
			if (theOption == x) {
				theOne = eval("document.question.opt_" + x);
				newSource = moveup + "images/btn" + x + "_over.jpg";
				theOne.src = newSource;
				theOne.style.cursor = "default";
				theWords = eval("choice_" + x);
				theWords.style.color = 'white';
				theWords.style.cursor = "default";
			} else {
				theOne = eval("document.question.opt_" + x);
				newSource = moveup + "images/btn" + x + ".jpg";
				theOne.src = newSource;
				theOne.style.cursor = "default";
				theWords = eval("choice_" + x);
				theWords.style.color = '676767';
				theWords.style.cursor = "default";
			}
		}
		document.question.Done.src= moveup + "images/done.jpg";
		document.question.Done.style.cursor = "default";
		top.topEmpty.questionCounter = top.topEmpty.questionCounter + 1;
		//alert(top.topEmpty.questionCounter);
		// now go to the next page
		question_feedback.style.visibility = "visible";
		feedback_content.innerHTML = incfeedback1;
		move_on = true;
		wait_roll(next_name,next_image);
		//top.content.location = nextPageLoc;
		tries++;
		}
	} else {
	alert ("Please make a selection and click the Done button");
	}
}
}

function evalCOL() {

if (theChosen == 0) {
	alert ("Please make a selection and click the Done button");
} else {
	if (is_correct == true) {
	question_feedback.style.visibility = "visible";
	feedback_content.innerHTML = correctfeedback;
	move_on = true;
	wait_roll(next_name,next_image);
	} else {
//		if (tries == 0) {
//			question_feedback.style.visibility = "visible";
//			feedback_content.innerHTML = eval("answerfeed_" + theChosen) + " Try Again.";
//			tries++;
//		} else {
			if (remPageLoc == "") {
			question_feedback.style.visibility = "visible";
			feedback_content.innerHTML = incfeedback2 + " Try Again.";
			} else {
			question_feedback.style.visibility = "visible";
			feedback_content.innerHTML = incfeedback2 + "<br><br>Click <a href=\'" + remPageLoc + "'><font color=#ffffff>here</font></a> to review this information.";
			tries++;
//			}
		}
	}
	}
}

function evalCOL_mult() {
if (tries < 2) {
var correct = false;
var incorrect = false;
	for (x=1; x<totaloptions+1; x++) {
		if ((eval("selected_" + x) == true) && eval("question.va_" + x).value == 1) {
		correct = true;
		}
		if ((eval("selected_" + x) == true) && eval("question.va_" + x).value != 1) {
		incorrect = true;
		}
		if ((eval("selected_" + x) == false) && eval("question.va_" + x).value == 1) {
		incorrect = true;
		}
	}
	if ((correct == true) && (incorrect == false)) {
		answerCorrect = true;
	} else {
		answerCorrect = false;
	}
//alert(answerCorrect);
	if (answerCorrect) {
		question_feedback.style.visibility = "visible";
		feedback_content.innerHTML = correctfeedback;
		//question.correct.value=true;
		move_on = true;
		//wait_roll(next_name,next_image);
		tries++;
		next_button.style.visibility = "visible";
	} else {
	
//		if (tries < 1) {
		
//		question_feedback.style.visibility = "visible";
//		feedback_content.innerHTML = incfeedback1;
		//question.correct.value=false;
//		move_on = true;
//		tries++;
		
//		} else{
		
		question_feedback.style.visibility = "visible";
		feedback_content.innerHTML = incfeedback2 + "<br><br>Click <a href=\'" + remPageLoc + "'><font color=#ffffff>here</font></a> to review this information.";
		//question.correct.value=false;
		move_on = true;
		tries++;
//		}
	}
	//set up the end stuff
	//question.answers_selected.value=selected_ids;
}		
}

function ClickOptionCOL_mult(which, id) {
	if (tries < 2) {
	question_feedback.style.visibility = "hidden";
		if (moreThanOne == true) {
		//more than one answer can be true
			if (eval("selected_" + which) == true) {
				eval("selected_" + which + " = false");
				theOne = eval("document.question.opt_" + which);
				newSource = "images/btn" + which + ".jpg";
				theOne.src = newSource;
				//do the words
				theWords = eval("choice_" + which);
				theWords.style.color = '#ffffff';
				//selected_ids = selected_ids.replace("-" + id,"");
			} else {
				eval("selected_" + which + " = true");
				//selected_ids = selected_ids + "-" + id
			}
		} else {
		//more than one answer cannot be true
			eval("selected_" + which + " = true");
			//selected_ids = "-" + id;
			for (x=1; x<totaloptions; x++) {
				if (x != which) {
						eval("selected_" + x + " = false");
						theOne = eval("document.question.opt_" + x);
						newSource = "images/btn" + x + ".jpg";
						theOne.src = newSource;
						//do the words
						theWords = eval("choice_" + x);
						theWords.style.color = '#ffffff';
				}
			}
		}
	}
}



function ClickOptionCOL(which, value) {
if (tries < 2) {
	theChosen = which;
	eval("selected_" + which + " = true");
	question_feedback.style.visibility = "hidden";
	if (value == 1) {
		is_correct = true;
	} else {
		is_correct = false;
	}
	for (x=1; x<totaloptions+1; x++) {
		if (x != which) {
			eval("selected_" + x + " = false");
			theOne = eval("document.question.opt_" + x);
			newSource = moveup + "images/btn" + x + ".jpg";
			theOne.src = newSource;
					//do the words
		theWords = eval("choice_" + x);
		theWords.style.color = '#000000';
		}
	}
}
//alert(which);
}

function ClickOptionCOL_mult_save(which, value) {
if (tries < 2) {
	theChosen = which;
	eval("selected_" + which + " = true");
	question_feedback.style.visibility = "hidden";
	if (value == 1) {
		is_correct = true;
	} else {
		is_correct = false;
	}
	//for (x=1; x<totaloptions+1; x++) {
		//if (x != which) {
		//	eval("selected_" + x + " = false");
		//	theOne = eval("document.question.opt_" + x);
		//	newSource = moveup + "images/btn" + x + ".jpg";
		//	theOne.src = newSource;
					//do the words
		//theWords = eval("choice_" + x);
		//theWords.style.color = '#000000';
		//}
	//}
}
//alert(which);
}

function wait_roll(name, newloc) {
	if (move_on == true) {
		eval ('window.document.' + name + '.src = \'' + newloc + '\'');
	}
}

function moveNext(where) {
document.location = where;
}

function moveBack(where) {
document.location = where;
}

function displayResults() {
userScore = Math.round((top.topEmpty.correctCounter/top.topEmpty.questionCounter)*100);
if (userScore > 85) {
results.innerHTML = "You answered " + top.topEmpty.correctCounter + " out of " + top.topEmpty.questionCounter + "<br>correct for a score of " + userScore + "%.";
results.innerHTML = results.innerHTML + "<p>Click <a href='javascript:saveScore()'>Save</a> to save your score to disk.";
} else {
results.innerHTML = "You answered " + top.topEmpty.correctCounter + " out of " + top.topEmpty.questionCounter + "<br>correct for a score of " + userScore + "%.";
results.innerHTML = results.innerHTML + "<p>Click <a href='javascript:jumpToFirst();'>here</a> to return to the first page of the lesson to review.</p>";
results.innerHTML = results.innerHTML + "<p>Click <a href='javascript:saveScore()'>Save</a> to save your score to disk.";
}
}

function jumpToFirst() {
		top.topEmpty.correctCounter = 0;
		top.topEmpty.questionCounter = 0;
		document.location = firstPage;
}

function jumpTo(which, where) {
	//alert(where);
	if (which <= top.topEmpty.currentPage) {
	location = where;
	} else {
		if (top.topEmpty.userName == "Instructor") {
			//alert("You will now jump, because you are logged in as an instructor.");
			location = where;
		} else {
			alert ("You cannot jump to pages you have not yet visited \nunless you log in as an instructor.");
		}
	}
	cmWin.close();
}

function setCurrentPage(which) {
top.document.title = top.content.document.title;
//alert(top.content.document.title);
if (which > top.topEmpty.currentPage) {
top.topEmpty.currentPage = which;
}
//alert(top.topEmpty.userName);
//alert(top.topEmpty.currentPage);
}

function open_courseMap_window( myLocation, myName, myWidth, myHeight) {

old_x = parent.screenLeft;
old_y = parent.screenTop;
new_x = old_x + (400 - myWidth/2);
new_y = old_y + (250 - myHeight/2);

new_x = Math.ceil(new_x);
new_y = Math.ceil(new_y);

		cmWin= open(myLocation, myName ,"width="+myWidth+",height="+myHeight+",left=" + new_x + ",top=" + new_y + ",location=no,status=no,toolbar=no,menubar=no,scrollbars=yes");
		cmWin.focus();		
}

function saveScore() {
	window.open("saveScore.html", ""," width=400,height=150,left=400,top=100,resizable=no,scrollbars=no,status=no, toolvar=no, menubar=no,location=no");
	//self.focus()
}

function flashmovie_DoFSCommand(command, args) {
	//if (command == "checkAduio") {
		//alert("Check Audio");
	//}
	//alert("doing it");
}

function narr_DoFSCommand(command, args) {

	if (command == "checkAudio") {
		theState = window.top.topEmpty.audioState;
		if (theState == "off") {
			document.narr.GotoFrame(3);
			document.narr.Stop();
		} else {
			//alert(theState);
		}
	}
	if (command == "turnOff") {
		window.top.topEmpty.audioState = "off";
	}
	if (command == "turnOn") {
		window.top.topEmpty.audioState = "on";
	}
	
}

function move_next_hold(where) {
	
	if (move_on == true) {
	document.location=where;
	} else {
//	alert("You must correctly answer the question before moving on.");
	document.location=where;
	}
}

function getOut() {
	URLeavin = window.confirm("Are you sure you want to exit?");
	if (URLeavin)
	{
		top.window.close();
	}
}

function exit_NO() {

	alert("You cannot exit while in an assessment.");

}

function dynamic_display(what) {

	//alert(what);
	dynamic_content.innerHTML = what;

}

function menu_window(myLocation) {
	var myName = "Menu";
		myWin= open(myLocation, myName ,"width=800,height=600,location=no,status=yes,toolbar=no,menubar=no,scrollbars=yes");
		myWin.focus();	
}

function show_response(which) {

//alert("got it");
		if (which == "g") {
		tries = 2;
		//alert("this should work");
		}
		
		if (which == "c") {
		//correct
		response.innerHTML = "<b><font color=#006600 size=+1>" + correctfeedback + "</font></b>"; 
		move_on = true;
//		wait_roll('Next','../../images/next_animate.gif');
		} else {
		tries++;
		if (tries == 3) {
		response.innerHTML = "<b><font color=#000099 size=+1>The correct answer is shown above.</font></b>";
		move_on = true;
//		wait_roll('Next','../../images/next_animate.gif');
		} else {
		//incorrect
			if (tries < 2) {
				response.innerHTML = "<b><font color=#000099 size=+1>" + incfeedback1 + "</font></b>";
			} else {
				response.innerHTML = "<b><font color=#000099 size=+1>" + incfeedback2 + "</font></b>";
			}
		}
		}
}