// File:	datakortetcore.js
// Author:	Paul Roberts
// All Javascript functions used for Datakortet QxQ delivery
// Copyright QuestionMark Computing 2002 - 2005
// Version:	4.1.2.0
// Last modified: 10.08.05

var iAnswered = 1;
var iCurrentNum = 1;

function DoResize() {
	if (isNN6) return;

	if (!(isDOM1 || isIE4)) return;

	oActive = aElements[iActive];

	if ((!navObj) || (!listObj) || (!oActive)) return;

	var iWinWidth = document.body.clientWidth;
	var iWinHeight = document.body.clientHeight;
	var iHeaderTop = 0;
	var iHeaderLeft;
	var iHeaderWidth;
	var iHeaderHeight = header_height;
	var iQuestionTop;
	var iQuestionLeft;
	var iQuestionWidth;
	var iQuestionHeight;
	var iListTop;
	var iListLeft;
	var iListWidth;
	var iListHeight;
	var iNavTop;
	var iNavLeft;
	var iNavWidth;
	// iNavHeight has already been calculated

	if (rhs == 2) { // along the bottom
		var iNewHeight = iWinHeight - (iFooterHeight + header_height);
		if (iNewHeight < 0) iNewHeight = 0;

		iHeaderLeft = 0;
		iHeaderWidth = iWinWidth;

		iQuestionTop = header_height;
		iQuestionLeft = 0;
		iQuestionWidth = iWinWidth;
		iQuestionHeight = iNewHeight;
	
		if (bShowNavList) {
			iListTop = iWinHeight - iFooterHeight;
			iListLeft = 0;
			iListWidth = iWinWidth;
			iListHeight = list_height;
			iNavTop = iListTop + list_height;
		} else {
			iNavTop = iWinHeight - iNavHeight;
		}

		iNavLeft = 0;
		iNavWidth = iWinWidth;
	} else {
		if (rhs == 1) { // right hand side vertically
			// question
			var iNewHeight = iWinHeight - header_height;
			if (iNewHeight < 0) iNewHeight = 0;
			var iNewWidth = iWinWidth - panel_width;
			if (iNewWidth < 0) iNewWidth = 0;
		
			iQuestionTop = header_height;
			iQuestionLeft = 0;
			iQuestionWidth = iNewWidth;
			iQuestionHeight = iNewHeight;

			// header
			if (header_height > 0) {
				iHeaderLeft = 0;
				iHeaderWidth = iNewWidth;
			}

			// list
			if (bShowNavList) {
				iListTop = 0;
				iListLeft = iNewWidth;
				iListHeight = iWinHeight - iNavHeight;
				if (iListHeight < 0) iListHeight = 0;
				iListWidth = panel_width;
			} else {
				iListHeight = 0;
				iNavHeight = iWinHeight;
			}

			// navigation
			iNavTop = iListHeight;
			iNavLeft = iNewWidth;
			iNavWidth = panel_width;

		} else { // left hand side vertically
			var iNewHeight = iWinHeight - header_height;
			if (iNewHeight < 0) iNewHeight = 0;
			var iNewWidth = iWinWidth - panel_width;
			if (iNewWidth < 0) iNewWidth = 0;

			iQuestionTop = header_height;
			iQuestionLeft = panel_width;
			iQuestionWidth = iNewWidth;
			iQuestionHeight = iNewHeight;

			// header
			if (header_height > 0) {
				iHeaderLeft = panel_width;
				iHeaderWidth = iNewWidth;
			}

			// list
			if (bShowNavList) {
				iListTop = 0;
				iListLeft = 0;
				iListHeight = iWinHeight - iNavHeight;
				if (iListHeight < 0) iListHeight = 0;
				iListWidth = panel_width;
			} else {
				iListHeight = 0;
				iNavHeight = iWinHeight;
			}

			// navigation
			iNavTop = iListHeight;
			iNavLeft = 0;
			iNavWidth = panel_width;
		}
	}

	// set header
	if (header_height > 0) {
		headerObj.style.pixelTop = 0;
		headerObj.style.pixelLeft = iHeaderLeft;
		headerObj.style.height = iHeaderHeight;
		headerObj.style.width = iHeaderWidth;
	}
	// set list
	if (bShowNavList) {
		listObj.style.pixelLeft = iListLeft;
		listObj.style.pixelTop = iListTop;
		listObj.style.height = iListHeight;
		listObj.style.width = iListWidth;
	}

	// set control panel
	navObj.style.pixelLeft = iNavLeft;
	navObj.style.pixelTop = iNavTop;
	navObj.style.height = iNavHeight;
	navObj.style.width = iNavWidth;

	// set question
	oActive.style.pixelTop = iQuestionTop;
	oActive.style.pixelLeft = iQuestionLeft;
	oActive.style.height = iQuestionHeight;
	oActive.style.width = iQuestionWidth;
}

function noScroll() {
	if (!isIE) return;
	
	if ((window.event.srcElement.type != "text") && (window.event.srcElement.type != "textarea")) {
		window.event.returnValue = false; 
		window.event.cancelBubble = true;
	}
}



function ShowElement(index) {

	if (!(isDOM1 || isIE4)) return false;

    	if (iActive == index) {
		return false;
	}

	if (aElements.length == 0) {
		return false;
	}

	if (iActive > -1) {
		aElements[iActive].hide();
	}
	aElements[index].show();

	iActive = index;

	SetNav();

	return false;
}

/* 1.8.0.5 */
function SetNav() {

	if (!(isDOM1 || isIE4)) return;

/*
	if ((!bFeedback) && (!bEnd)) {
		if (AllQuestionsAnswered()) {
			alert("Submitting your answers now");
			QxQSubmitNow();
		}
	}
*/	

	if (bShowNavButtons) {
	
		if (!upButton) {
			
			if (isIE4) {
				var buttons = document.all.tags("INPUT");
				for (i = 0; i < buttons.length; i++) {
					if (buttons[i].id == ("qup")) {
						upButton = buttons[i];      
						break;
					} 
				}
			} else {
				upButton = document.getElementById("qup");
			}
		}

		if (upButton) {
			if ((!bFeedback) && (!bEnd)) {
				if (aElements[iActive].getIsQuestion())	{
					upButton.value = "" + iCurrentNum + " of " + (aQuestions.length - 1);
				} else {
					upButton.value = " ";
				}
				
			}
		} 


		if (!downButton) {
			
			if (isIE4) {
				var buttons = document.all.tags("INPUT");
				for (i = 0; i < buttons.length; i++) {
					if (buttons[i].id == ("qdown")) {
						downButton = buttons[i];      
						break;
					} 
				}
			} else {
				downButton = document.getElementById("qdown");
			}
		}

		if (downButton) {

			if ((!bFeedback) && (!bEnd)) {
				if ((aElements[iActive].getAnswered()) && (!AllQuestionsAnswered()) ) {
					downButton.disabled = false;
					if (isIE) {
						downButton.style.cursor = "hand";
					}
				} else {
					downButton.disabled = true;
					if (isIE) { 
						downButton.style.cursor = "default";
					}
					
				}
			} else {
				downButton.disabled = false;
				if (isIE) {
					downButton.style.cursor = "hand";
				}
			}
		} 

		

		if (!resetButton) {
			
			if (isIE4) {
				var buttons = document.all.tags("INPUT");
				for (i = 0; i < buttons.length; i++) {
					if (buttons[i].id == ("qquit")) {
						resetButton = buttons[i];      
						break;
					} 
				}
			} else {
				resetButton = document.getElementById("qquit");
			}
		}

		if (resetButton) {
			if (aElements[iActive].getAnswered()) {
				resetButton.disabled = false;
				if (isIE) {
					resetButton.style.cursor = "hand";
				}
			} else {
				resetButton.disabled = true;
				if (isIE) { 
					resetButton.style.cursor = "default";
				}
				
			}
		} 
	}

	// flag button is re-used for 'Skip'
	if (bShowFlag) {
		if (!flagButton) {
			
			if (isIE4) {
				var buttons = document.all.tags("INPUT");
				for (i = 0; i < buttons.length; i++) {
					if (buttons[i].id == ("qflag")) {
						flagButton = buttons[i];      
						break;
					} 
				}
			} else {
				flagButton = document.getElementById("qflag");
			}
		}

		if (flagButton) {
			if (aElements[iActive].getAnswered()) {
				flagButton.disabled = true;
				if (isIE) { 
					flagButton.style.cursor = "default";
				}
			} else {
				flagButton.disabled = false;
				if (isIE) {
					flagButton.style.cursor = "hand";
				}
			}
		}
	}

	if (bHideSubmit) {
		if (!submitButton) {
			var buttons;
			if (isIE4) {
				buttons = document.all.tags("INPUT");
				for (i = 0; i < buttons.length; i++) {
					if (buttons[i].id == ("qsubmit")) {
						submitButton = buttons[i];      
						break;
					} 
				}
			} else {
				submitButton = document.getElementById("qsubmit");
			}
		}

		if (submitButton) {
			if ((bHideSubmitAnswer && AllQuestionsAnswered()) || (bHideSubmitSeen && AllQuestionsSeen())) {
				submitButton.disabled = false;
				submitButton.title = finishTip;
				if (bUseGraphicButtons) {
					submitButton.src = imgArray[showFinishButton].src;
				}
				if (isIE) {
					submitButton.style.cursor = "hand";
				}
			} else {
				submitButton.disabled = true;
				submitButton.title = '';
				if (bUseGraphicButtons) {
					submitButton.src = imgArray[showNoFinishButton].src;
				}
				if (isIE) { 
					submitButton.style.cursor = "default";
				}
			}
		}
	}
	DoResize();

	

}	

// move up the question list
function MoveUp() {

	if (iActive > 0) {
		ShowElement(iActive - 1);
		SetNav();
	} 
	
}

/* 1.8.05 */
// move down the question list
function MoveDown() {

	if ((bFeedback) || (bEnd)) {
		if (iActive < (aElements.length - 1)) {
			ShowElement(iActive + 1);
		} else {
			ShowElement(0);
		}
		SetNav();
		return
	}

	iCurrentNum = iAnswered;

	//find next unanswered question
	
	// look at all unanswered questions to end
	for (iPos = iActive + 1; iPos < (aElements.length); iPos++) {
	//alert("iPos = " + iPos);
		if (!aElements[iPos].getAnswered()) {
			ShowElement(iPos);
			SetNav();
			return;
		}
	}

	for (iPos = 0; iPos < (aElements.length); iPos++) {
		//alert("iPos = " + iPos);
		if (!aElements[iPos].getAnswered()) {
			ShowElement(iPos);
			SetNav();
			return;
		}
	}
	
	SetNav();
}

/* 1.8.05 */
// flag/unflag the current question
function Flag() {
	MoveDown();
}

// get confirm before submitting
function DoQxQSubmit() {
	if (bSubmitted) return false;
	
	if (document.forms[0].FINISH.value == "USER") return true;

	if (!(isDOM1 || isIE4)) {
		askConfirm = '0';
	}

	if (askConfirm == '0') {
		if (QMJava) {
			CheckApplets();
		} 
	}

	if (askConfirm == '1') {
		if (AllQuestionsAnswered()) {
			if (QMJava) {
				CheckApplets();
			} 
		} else {
			if (confirm(unansweredText)) {
				// check for Java questions
				if (QMJava) {
					CheckApplets();
				} 
			} else {
				return false;
			}
		}
	}

	if (askConfirm == '2') {
		// ask user to confirm
		if (confirm(confirmText)) {
			// check for Java questions
			if (QMJava) {
				CheckApplets();
			} 
		} else {
			return false;
		}
	}

	if (askConfirm == '3') {
		// tell user they cannot submit as questions are unanswered
		if (AllQuestionsAnswered()) {
			if (QMJava) {
				CheckApplets();
			} 
		} else {
			alert(needanswersText);
			return false;
		}
	}
	CheckTime();

	for (i = 0; i < document.forms[0].length; i++) { 
		if (document.forms[0].elements[i].type == "submit") {
			document.forms[0].elements[i].disabled = true;
		}
	}
	bSubmitted = true;
	window.setTimeout('ResetSubmit()',iSubmitTimeout * 1000);
	return true;

}

function QxQSubmitNow() {
	if (DoQxQSubmit()) {
		document.forms[0].submit();
		return true;
	} else {
		return false;
	}
}

// check time taken for each question
function CheckTime() {
	// look at all hidden fields
	for (i = 0; i < document.forms[0].length; i++) { 
		if (document.forms[0].elements[i].type == "hidden") {
			sID = "";
	      		sName = document.forms[0].elements[i].name;
	      		iPos = sName.indexOf('TIME_');
	      		if (iPos > -1) {
	         		sID = "Q_" + sName.substring(iPos+5,sName.length);
				// find the matching question object
	    			for (j = 1; j < (aQuestions.length); j++) {
					if (aQuestions[j].getId() == sID) {
						document.forms[0].elements[i].value = aQuestions[j].getTimeTaken();
						break;
					}
				}
			}
		}
	}  
}

function ResetSubmit() {
	bSubmitted = false;

	for (i = 0; i < document.forms[0].length; i++) { 
		if (document.forms[0].elements[i].type == "submit") {
			document.forms[0].elements[i].disabled = false;
		}
	}
}

function AllQuestionsAnswered() {

	var bAnswered = true;

	for (i = 1; i < (aQuestions.length); i++) {
		if (!aQuestions[i].getAnswered()) {
			bAnswered = false;
			break;
		}
	}

	return bAnswered;
}

function AllQuestionsSeen() {

	var bSeen = true;

	for (i = 1; i < (aQuestions.length); i++) {
		if (!aQuestions[i].getSeen()) {
			bSeen = false;
			break;
		}
	}

	return bSeen;
}


function DoChange(questionNumber,object) {
	if (!(isDOM1 || isIE4)) return;
	if (aQuestions.length < 1) return;

	var answerState = true;

	// check that a text input isn't becoming empty
	if ((object.type == "text") || (object.type == "textarea")) {
		if (object.value.length == 0) {
			answerState = false;
		}	
	}
	if (!aQuestions[questionNumber].getAnswered())
	{
		aQuestions[questionNumber].setAnswered(true);
	}
	
}

function DoPSBChange(questionNumber,object) {
	if (!(isDOM1 || isIE4)) return;

	if (aQuestions.length < 1) return;
	aQuestions[questionNumber].setAnswered(true);
}

function DoJavaChange(questionNumber,appletName) {

	if (!(isDOM1 || isIE4)) return;

	if (aQuestions.length < 1) return;

	if ((!aQuestions[questionNumber].feedback) && 
		(!aQuestions[questionNumber].answerGiven)) {
		// find the applet
		var appObj;
		var sValue = "";
		if (isIE4) {
			appObj = document.applets[appletName]; 
		} else {
			appObj = document.getElementById(appletName);
		}
		if (appObj) {
			sValue = "" + appObj.getValue(); 
		} 
		
		// if non blank set answer given
		for (i = 0; i < (sValue.length); i++) {
			if (sValue.charAt(i) != ':') {
				aQuestions[questionNumber].setAnswered(true);	
				break;
			}
		}
	}
}

function QuestionReset() {

	// get the containing div element
	var sDivID = aElements[iActive].getId();
	var objDiv = document.getElementById(sDivID);

	// get question type
	var sQType = objDiv.getAttribute("qtype");

	// get ID of question
	var sQID = aElements[iActive].getId().substring(2);
	
	// call appropriate reset method for question type
	switch(sQType) {
		case "MC":
		case "MR":
		case "TF":
		case "YN":
		case "LKS":
			ResetMC(sQID);
			break;
		case "TM":
		case "FIB":
		case "ESSAY":
		case "NUM":
			ResetTM(sQID);
			break;
		case "MATCH":
		case "RANK":
		case "SAB":
		case "SEL":
			ResetSEL(sQID);
			break;
		case "HOT":
			ResetHOT(sQID);
			break;
		case "MAT":
			ResetMAT(sQID);
			break;
		default:
			alert("Cannot reset this question type");
	}

	aElements[iActive].setAnswered(false);	

}

// reset functions for each question type
/*
ResetMC :
MC=Multiple Choice
MR=Multiple Response
TF=True/False
YN=Yes/No
LKS=Likert Scale

ResetTM :
TM=Text Match
ESSAY=Essay
FIB=Fill in Blanks
NUM=Numeric

ResetSEL :
MATCH=Matching
RANK=Ranking
SAB=Select a Blank
SEL=Pull-down list

ResetHOT :
HOT=Drag and Drop

ResetMAT :
MAT=Matrix

Not supported :
FLASH=Macromedia Flash
VOICE=Spoken Response
*/


function ResetMC(sQID) {
	// find all input elements for question
	var aInput = document.getElementsByName(sQID);

	// reset each one
	for (i = 0; i < aInput.length; i++) {
		aInput[i].checked = false;
	}
}

function ResetTM(sQID) {
	// find all input elements for question
	var aInput = document.getElementsByName(sQID);

	// find choices that match
	for (i = 0; i < aInput.length; i++) {
		var sCID = aInput[i].value;
		// look at each text box
		var aText = document.getElementsByName(sCID);
		for (j = 0; j < aText.length; j++) {
			aText[j].value = "";
		}
	}
}

function ResetSEL(sQID) {
	// find all input elements for question
	var aInput = document.getElementsByName(sQID);

	// find selects that match
	for (i = 0; i < aInput.length; i++) {
		var sCID = aInput[i].value;
		// look at each select
		var aSelect = document.getElementsByName(sCID);
		for (j = 0; j < aSelect.length; j++) {
			// select first (blank) option
			aSelect[j].selectedIndex = 0;
		}
	}
}

function ResetHOT(sQID) {
	Clear(sQID,"bottom");
	
}

function ResetMAT(sQID) {
	// find all input elements for question
	var aInput = document.getElementsByName(sQID);

	// find each group of radio buttons that match
	for (i = 0; i < aInput.length; i++) {
		var sCID = aInput[i].value;
		// look at each group
		var aRadios = document.getElementsByName(sCID);
		// rest each radio button
		for (j = 0; j < aRadios.length; j++) {
			aRadios[j].checked = false;
		}
	}
}

// ****************************************
// constructor for Question object
function Question(window, id, number, index, type, feedback, score, max, answered) {
	if (isNN6) return;
	if (!(isDOM1 || isIE4)) return;

	this.window = window;		// window this belongs to
	this.id = id;			// question ID
	this.number = number;		// question number
	this.index = index;		// index in question array
	this.type = type;		// 'Q' question, 'E' explanation, 'B' block, 'O' outcome

	// information for feedback
	this.feedback = feedback;
	this.answered = answered;
	this.score = score;
	this.max = max;
	this.right = false;
	this.wrong = false;
	this.flagged = false;

	// information for display
	this.answerGiven = answered;
	this.seen = answered;
	this.here = false;
	this.style = this.getDiv();
	this.viewImg = null;
	this.statusImg = null;
	this.title = "";
	this.timeTaken = 0;
	this.showTime = 0;


}

Question.prototype.setFlag = function (bFlag) { 
	this.flagged = bFlag; 

	if (this.answerGiven) {
		if (this.flagged) {
			this.setStatus(statusFlagSeen);
		} else {
			this.setStatus(statusSeen);
		}
	} else {
		if (this.flagged) {
			this.setStatus(statusFlag);
		} else {
			this.setStatus(statusUnseen);
		}
	}
}

Question.prototype.getIsQuestion = function () { return (this.type == 'Q'); }

Question.prototype.getFlag = function () { return this.flagged; }

Question.prototype.setTitle = function (sTitle) { this.title = sTitle; }

Question.prototype.getId = function () { return this.id; }

Question.prototype.getNumber = function () { return this.number; }

Question.prototype.getAnswered = function () { return this.answerGiven; }

Question.prototype.getSeen = function () { return this.seen; }

Question.prototype.getTimeTaken = function () { 

	// if this question is visible, update the time taken
	if ((this.here) && (this.showTime > 0)) {
		now = new Date();
		this.timeTaken += Math.round((now.getTime() - this.showTime) / 1000);
		this.showTime = 0;
	}
	return this.timeTaken; 
}

Question.prototype.InitTime = function () { 
	this.timeTaken = 0;
	this.showTime = 0;
}

Question.prototype.getDiv = function () {
	var div = null;
	var divs;

	if (isIE4) {
		divs = document.all.tags("DIV");
		for (i = 0; i < divs.length; i++) {
			if (divs[i].id == this.id) {
				div = divs[i];      
				break;
			} 
		}
	} else {
		div = document.getElementById(this.id);
	}

	if (!div) {
		alert("DIV ID=" + this.id + " not found");
	} else {
		return div.style;
	}
	return div;
}



Question.prototype.show = function () {
//alert("Show " + this.id);
	this.style.visibility = "visible";
	this.seen = true;
	this.here = true;
	now = new Date();
	this.showTime = now.getTime();
	this.setView(viewSelect);
}

Question.prototype.hide = function () {
//alert("Hide " + this.id);
	this.style.visibility = "hidden";
	this.here = false;

	this.setView(viewUnselect);
	if (this.showTime > 0) {
		now = new Date();
		this.timeTaken += Math.round((now.getTime() - this.showTime) / 1000);
		this.showTime = 0;
	}
}

Question.prototype.isVisible = function () {
	return this.style.visibility == "visible";
}

Question.prototype.setStatus = function (status) {

	if (!this.statusImg) {
		var imgs;
		if (isIE4) {
			imgs = document.all.tags("IMG");
			for (i = 0; i < imgs.length; i++) {
				if (imgs[i].id == ("s" + this.index)) {
					this.statusImg = imgs[i];      
					break;
				} 
			}
		} else {
			this.statusImg = document.getElementById("s" + this.index);
		}
	}

	if (this.statusImg) {
		this.statusImg.src = imgArray[status].src;
	}
}

Question.prototype.setAnswered = function (answered) {
	if (!this.feedback) {
		if (answered) {
			if (!this.answerGiven) {
				this.answerGiven = true;
				iAnswered++;
				if (this.flagged) {
					if (autoUnflag == '1') {
						this.flagged = false;
						this.setStatus(statusSeen);
					} else {
						this.setStatus(statusFlagSeen);
					}
				} else {
					this.setStatus(statusSeen);
				}
			}
		} else {
			if (this.answerGiven) {
				this.answerGiven = false;
				iAnswered--;
				if (this.flagged) {
					this.setStatus(statusFlag);
				} else {
					this.setStatus(statusUnseen);
				}
			}
		}
	}
	SetNav();

}
Question.prototype.setView = function (view) {
	if (!this.viewImg) {
		var imgs;
		if (isIE4) {
			imgs = document.all.tags("IMG");
			for (i = 0; i < imgs.length; i++) {
				if (imgs[i].id == ("v" + this.index)) {
					this.viewImg = imgs[i];      
					break;
				} 
			}
		} else {
			this.viewImg = document.getElementById("v" + this.index);
		}
	}

	if (this.viewImg) {
		this.viewImg.src = imgArray[view].src;
	}
}

Question.prototype.getListEntry = function () {
	var sListEntry = "Entry for " + this.type + " not found";

	if (this.type == 'Q') {
		return this.getQuestionEntry();
	}

	if (this.type == 'E') {
		return this.getExplainEntry();
	}

	if (this.type == 'B') {
		return this.getBlockEntry();
	}


	if (this.type == 'O') {
		return this.getOutcomeEntry();
	}
	
	return sListEntry;
}

Question.prototype.getQuestionEntry = function () {
	var sListEntry = "";

	var iImage = 0;

	var sQuestion = qListText + " " + this.number;
	var sTitle = ""

	if (this.feedback) {
		if (this.answered) {
			if (this.score < 1) {
				iImage = statusWrong;
			} else {
				if (this.score == this.max) {
					iImage = statusRight;
				} else {
					iImage = statusPart;
				}
			}
			sTitle = sQuestion + " - " + this.score + " " + outofText + " " + this.max;
		} else {
			iImage = statusUnseen;
			sTitle = sQuestion + " - " + notansweredText;
		}
	} else {
		sTitle = sQuestion;
		if (this.answered) {
			iImage = statusSeen;
		} else {
			iImage = statusUnseen;
		}
	}

	
	sListEntry = '<A CLASS="entry"'; 
	sListEntry += ' onClick="ShowElement(';
	sListEntry += this.index;
	sListEntry += ')" ';
	sListEntry += 'TITLE="';
	sListEntry += sTitle;
	sListEntry += '">';
	

	// select image
	if (bShowListSelect) {
		sListEntry += '<IMG SRC="';
		sListEntry += imgArray[viewUnselect].src;
		sListEntry += '" ID="v';
		sListEntry += this.index;
		sListEntry += '">';
	}


	// status image
	if (bShowListBullet) {
		sListEntry += '<IMG SRC="';
		sListEntry += imgArray[iImage].src;
		sListEntry += '" ID="s';
		sListEntry += this.index;
		sListEntry += '" TITLE="';
		sListEntry += sTitle;
		sListEntry += '">';
	}

	// question number
	if (bShowListNum) sListEntry += this.number;

	sListEntry += '</A>';

	return sListEntry;
}

Question.prototype.getExplainEntry = function () {
	var sListEntry = "";

	sListEntry = '<A CLASS="entry"'; 

	sListEntry += ' TITLE="' + eListText + '" onClick="return ShowElement(';
	sListEntry += this.index;
	sListEntry += ')">';

	if (bShowListSelect) {
		sListEntry += '<IMG SRC="';
		sListEntry += imgArray[viewUnselect].src;
		sListEntry += '" ID="v';
		sListEntry += this.index;
		sListEntry += '">';
	}

	if (bShowListBullet) {
		sListEntry += '<IMG SRC="';
		sListEntry += imgArray[statusExplain].src;
		sListEntry += '" ID="s';
		sListEntry += this.index;
		sListEntry += '">';
	}

	if (bShowListNum) sListEntry += explainText;

	sListEntry += '</A>';
	
	return sListEntry;
}

Question.prototype.getBlockEntry = function () {
	var sListEntry = "";

	sListEntry = '<A CLASS="entry"'; 
	sListEntry += ' onClick="return ShowElement(';
	sListEntry += this.index;
	sListEntry += ')"';
	sListEntry += 'TITLE="';
	sListEntry += this.title;
	sListEntry += '">';

	if (bShowListSelect) {
		sListEntry += '<IMG SRC="';
		sListEntry += imgArray[viewUnselect].src;
		sListEntry += '" ID="v';
		sListEntry += this.index;
		sListEntry += '">';
	}
	
	if (bShowListBullet) {
		sListEntry += '<IMG SRC="';
		sListEntry += imgArray[statusBlock].src;
		sListEntry += '" ID="s';
		sListEntry += this.index;
		sListEntry += '">';
	}

	if (bShowListNum) sListEntry += blockText;

	sListEntry += '</A>';

	return sListEntry;
}

Question.prototype.getOutcomeEntry = function () {
	var sListEntry = "";
	
	sListEntry = '<A CLASS="entry"'; 

	sListEntry += ' onClick="return ShowElement(';
	sListEntry += this.index;
	sListEntry += ')"';
	sListEntry += 'TITLE="';
	sListEntry += this.title;
	sListEntry += '">';

	if (bShowListSelect) {
		sListEntry += '<IMG SRC="';
		sListEntry += imgArray[viewUnselect].src;
		sListEntry += '" ID="v';
		sListEntry += this.index;
		sListEntry += '">';
	}

	if (bShowListBullet) {
		sListEntry += '<IMG SRC="';
		sListEntry += imgArray[statusSession].src;
		sListEntry += '" ID="s';
		sListEntry += this.index;
		sListEntry += '">';
	}

	if (bShowListNum) sListEntry += outcomeText;

	sListEntry += '</A>';

	return sListEntry;
}
