function DisplayControl(greyedOut,obj)
	{
		//alert('DisplayControl');
		this.questionArray = greyedOut;
		this.dataObj = obj;
	}
	
DisplayControl.prototype.shouldDisplay = function(q)
	{
		//javascript 'hashes' containing the various alternate version question and answer text strings
		var q6StringsArray = {q6QuestionStringA:"Do you rely on anyone else other than your partner for financial or other support <span class='smallQ'>(eg an ex-partner or relative)</span>?",q6QuestionStringB:"Do you rely on anyone else for financial or other support <span class='smallQ'>(eg an ex-partner or relative)</span>?"};

		var q7StringsArray = {q7QuestionStringA:"Does anyone other than your partner rely on you for financial or other support <br /><span class='smallQ'>(eg children or an elderly relative)</span>?",q7QuestionStringB:"Does anyone rely on you for financial or other support <span class='smallQ'>(eg children or an elderly relative)</span>?"};

		var q9StringsArray = {q9AnswerAStringA:"Not a problem. We can mostly afford what we want and often have money left over.",q9AnswerAStringB:"Not a problem, I can mostly afford what I want and often have money left over.",q9AnswerBStringA:"We can mostly afford what we need, but there's not much left over.",q9AnswerBStringB:"I'm coping; I can mostly afford what I need, but there's not much left over.",q9AnswerCStringA:"We struggle to make ends meet.",q9AnswerCStringB:"I am struggling to make ends meet."};

		var q10StringsArray = {q10AnswerAStringA:"We have some money put aside for a 'rainy day'.",q10AnswerAStringB:"I'd be OK. I have some money put aside for a 'rainy day'.",q10AnswerBStringA:"We would probably be able to get some money somehow.",q10AnswerBStringB:"I'd probably be able to get some money somehow.",q10AnswerCStringA:"I'm not sure - we might struggle to find the money.",q10AnswerCStringB:"I'm not sure - I might struggle to find the money."};
		
		var q11StringsArray = {q11AnswerAStringA:"No problems - we don't have any loans or money outstanding on any cards.",q11AnswerAStringB:"No problems - we're up to date with the mortgage and don't have any other loans or money outstanding on any cards.",q11AnswerAStringC:"No problems - I don't have any loans or money outstanding on any cards.",q11AnswerAStringD:"No problems - I'm up to date with the mortgage and I don't have any other loans or money outstanding on any cards.",q11AnswerBStringA:"It's OK - we are up to date with the payments on any loans and cards and know how we will repay what we owe.",q11AnswerBStringB:"It's OK - we're up to date with the payments on the mortgage, any other loans and cards and know how we will repay what we owe",
q11AnswerBStringC:"It's OK - I'm up to date with the payments on any loans and cards and know how I will repay what I owe.",q11AnswerBStringD:"It's OK - I'm up to date with the payments on my mortgage, any other loans or cards and know how I will repay what I owe.",q11AnswerCStringA:"It's hard to stay out of trouble. We don't know how we will repay what we owe or sometimes miss payments on our loans or cards.",q11AnswerCStringB:"It's hard to stay out of trouble. We sometimes miss payments on the mortgage, other loans or cards and I don't know how we will repay what we owe.",q11AnswerCStringC:"It's hard to stay out of trouble. I don't know how I will repay what I owe or sometimes miss payments on my loans or cards.",q11AnswerCStringD:"It's hard to stay out of trouble. I sometimes miss payments on the mortgage, other loans or cards or I don't know how I will repay what I owe.",q11AnswerDStringA:"We  are  having serious problems with our borrowing.",q11AnswerDStringB:"We're behind with the mortgage or have serious problems with other borrowing.",q11AnswerDStringC:"I  am  having serious problems with my borrowing.",q11AnswerDStringD:"I'm behind with the mortgage or having serious problems with other borrowing."};

		var q13StringsArray = {q13QuestionStringA:"Do you think you'll have enough money to repay your mortgage when the time comes?",q13QuestionStringB:"Do you think you'll have enough money to pay off the 'interest-only'/endowment part of your mortgage when the time comes?",q13AnswerAStringA:"Yes, we've made some plans and I'm confident they will provide enough money to pay off our mortgage.",q13AnswerAStringB:"Yes, I've made some plans and I'm confident they will provide enough money to pay off my mortgage.",q13AnswerBStringA:"Not sure - we've made some plans but I'm not sure they will provide enough money to pay off our mortgage.",q13AnswerBStringB:"Not sure - I've made some plans but I'm not sure they will provide enough money to pay off my mortgage.",q13AnswerCStringA:"No - I don't know how we will pay off our mortgage.",q13AnswerCStringB:"No - I don't know how I will pay off my mortgage."};

		var q14StringsArray = {q14QuestionStringA:"If you died tomorrow would your partner have enough money to live on?",q14QuestionStringB:"If you died tomorrow would your dependants have enough money to live on?",q14QuestionStringC:"If you died tomorrow, would your partner and dependants have enough money to live on?"};
		
		var q16StringsArray = {q16QuestionStringA:"Would you have enough money to live on if you lost your job or couldn't work?",q16QuestionStringB:"Would you have enough money to live on if you or your partner lost your job or couldn't work?",q16QuestionStringC:"Would you have enough money to live on if your partner lost their job or couldn't work?",q16AnswerAStringA:"Yes, I'd manage.",q16AnswerAStringB:"Yes, we'd manage.",q16AnswerBStringA:"No, I'd probably struggle to get by.",q16AnswerBStringB:"No, we'd probably struggle to get by."};
		
		var q18StringsArray = {q18AnswerAStringA:"Yes, we will have some extra money.",q18AnswerAStringB:"Yes, I will have some extra money.",q18AnswerBStringA:"No, we haven't got any other pensions or sources of income.",q18AnswerBStringB:"No, I haven't got any other pensions or sources of income."};

		
		var i = 0;
		var formName;
		var qNumberArray;
		var buttonLengthArray;
		var buttonLengthArray;
		var firstIdArray;
		var secondIdArray;
		var idArray;
		var colour;
		var buttonState;
		
		while(i <= this.questionArray.length)
			{	
				if(this.questionArray[i] == q)
					{
						switch(q)
							{
								case "2"://do stuff to question 16 (in conjunction with q3 & q4)
									formName = "the_worst";
									qNumberArray = new Array("q16");
									buttonLengthArray = [document.the_worst.q16.length];
									firstIdArray = new Array("q16QuestionTxt","q16aAnswerTxt","q16bAnswerTxt","q16cAnswerTxt");
									idArray = new Array(firstIdArray);
									colour = "#000000";
									buttonState = false;
									this.question2(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState,q16StringsArray);
									break;
									
								case "3"://a lot of stuff depends on the answer to question 3!!!
									formName = "aboutYou"; //starting with q4 on this form
									qNumberArray = new Array("q4");
									buttonLengthArray = [document.aboutYou.q4.length];
									firstIdArray = new Array("q4QuestionTxt","q4aAnswerTxt","q4bAnswerTxt","q4cAnswerTxt");
									idArray = new Array(firstIdArray);
									colour = "#000000";
									buttonState = false;
									this.question3(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState,q6StringsArray,q7StringsArray,q9StringsArray,q10StringsArray,q11StringsArray,q13StringsArray,q14StringsArray,q16StringsArray,q18StringsArray);
									break;
									
								case "4"://question 4 - controls q5 (& q16 in conjunction with q2)
									formName = "aboutYou";
									qNumberArray = new Array("q5");
									buttonLengthArray = [document.aboutYou.q5.length];
									firstIdArray = new Array("q5QuestionTxt","q5aAnswerTxt","q5bAnswerTxt");
									idArray = new Array(firstIdArray);
									colour = "#000000";
									buttonState = false;
									this.question4(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState,q16StringsArray);
									break;
									
								case "7"://question 7 controls wording of q14 (in conjunction with q3)
									formName = "the_worst";
									qNumberArray = new Array("q14");
									buttonLengthArray = [document.the_worst.q14.length];
									firstIdArray = new Array("q14QuestionTxt","q14aAnswerTxt","q14bAnswerTxt","q14cAnswerTxt");
									idArray = new Array(firstIdArray);
									colour = "#000000";
									buttonState = false;
									this.question7(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState,q14StringsArray);
									break;
									
								case "8"://question 8 - controls (in conjunction with q3) wording of answers to q11
									this.question8(q11StringsArray);
									break;
									
								case "12"://controls question 13
									formName = "your_mortgage";
									qNumberArray = new Array("q13");
									buttonLengthArray = [document.your_mortgage.q13.length];
									firstIdArray = new Array("q13QuestionTxt","q13aAnswerTxt","q13bAnswerTxt","q13cAnswerTxt");
									idArray = new Array(firstIdArray);
									colour = "#000000";
									buttonState = false;
									this.question12(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState,q13StringsArray);
									break;
									
								default:
									break;									
							}
						}
				i++;
			}
	}

DisplayControl.prototype.question2 = function(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState,q16StringsArray)	
	{
		if(this.dataObj._dataArray[2] == "a")//job=yes
			{
				if(this.dataObj._dataArray[3] == "b" || this.dataObj._dataArray[3] == "noValue")//partner=no or undefined
					{
						document.getElementById('q16QuestionTxt').innerHTML = q16StringsArray["q16QuestionStringA"];
						document.getElementById('q16aAnswerTxt').innerHTML = q16StringsArray["q16AnswerAStringA"];
						document.getElementById('q16bAnswerTxt').innerHTML = q16StringsArray["q16AnswerBStringA"];
						this.dataObj._dataArray[16] = "noValue";
						this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
					}
				else if(this.dataObj._dataArray[3] == "a")//partner=yes
					{
						if(this.dataObj._dataArray[4] != "a" || this.dataObj._dataArray[4] == "noValue" || this.dataObj._dataArray[4] == "x")//pjob=no or other or undefined or default
							{
								document.getElementById('q16QuestionTxt').innerHTML = q16StringsArray["q16QuestionStringA"];
								document.getElementById('q16aAnswerTxt').innerHTML = q16StringsArray["q16AnswerAStringB"];
								document.getElementById('q16bAnswerTxt').innerHTML = q16StringsArray["q16AnswerBStringB"];
								this.dataObj._dataArray[16] = "noValue";
								this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
							}
						else if(this.dataObj._dataArray[4] == "a")//pjob=yes
							{
								document.getElementById('q16QuestionTxt').innerHTML = q16StringsArray["q16QuestionStringB"];
								document.getElementById('q16aAnswerTxt').innerHTML = q16StringsArray["q16AnswerAStringB"];
								document.getElementById('q16bAnswerTxt').innerHTML = q16StringsArray["q16AnswerBStringB"];
								this.dataObj._dataArray[16] = "noValue";
								this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
							}
					}
			}
		else if(this.dataObj._dataArray[2] != "a")//job=no
			{
				if(this.dataObj._dataArray[3] == "b" || this.dataObj._dataArray[3] == "noValue")//partner=no
					{
						colour = "#CCCCCC";
						buttonState = true;
						this.dataObj._dataArray[16] = "x";//set a 'null' value for question16
						this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);//disable question 16
					}
				else if(this.dataObj._dataArray[3] == "a")//partner=yes
					{
						if(this.dataObj._dataArray[4] != "a" || this.dataObj._dataArray[4] == "noValue" || this.dataObj._dataArray[4] == "x")//pjob=no or undefined or default
							{
								colour = "#CCCCCC";
								buttonState = true;
								this.dataObj._dataArray[16] = "x";//set a 'null' value for question16
								this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);//disable question 16
							}
						else if(this.dataObj._dataArray[4] == "a")//pjob=yes
							{
								document.getElementById('q16QuestionTxt').innerHTML = q16StringsArray["q16QuestionStringC"];
								document.getElementById('q16aAnswerTxt').innerHTML = q16StringsArray["q16AnswerAStringB"];
								document.getElementById('q16bAnswerTxt').innerHTML = q16StringsArray["q16AnswerBStringB"];
								this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
							}
					}
			}
		return;
	}

DisplayControl.prototype.question3 = function(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState,q6StringsArray,q7StringsArray,q9StringsArray,q10StringsArray,q11StringsArray,q13StringsArray,q14StringsArray,q16StringsArray,q18StringsArray)	
	{
		if(this.dataObj._dataArray[3] == "a")//if partner = yes
			{
				this.dataObj._dataArray[4] = "noValue";//this is needed to make the validation work. If a user says no to the partner question, default values are recorded for q4 & 5. If user then changes mind, the values have to be reset, otherwise it would be possible for the user to get to the next page without answering q4 & 5. 
				this.dataObj._dataArray[5] = "noValue";
				//enable question4
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
				//rewrite q6 & q7 - in the plural
				document.getElementById('qSix').innerHTML = q6StringsArray["q6QuestionStringA"];
				document.getElementById('qSeven').innerHTML = q7StringsArray["q7QuestionStringA"];
				//rewrite answers to q9 & q10 - in the plural
				document.getElementById('q9aText').innerHTML = q9StringsArray["q9AnswerAStringA"];
				document.getElementById('q9bText').innerHTML = q9StringsArray["q9AnswerBStringA"];
				document.getElementById('q9cText').innerHTML = q9StringsArray["q9AnswerCStringA"];
				document.getElementById('q10aText').innerHTML = q10StringsArray["q10AnswerAStringA"];
				document.getElementById('q10bText').innerHTML = q10StringsArray["q10AnswerBStringA"];
				document.getElementById('q10cText').innerHTML = q10StringsArray["q10AnswerCStringA"];
				//rewrite q11 (inconjunction with q8 mortgage question)
				if(this.dataObj._dataArray[8] == "b" || this.dataObj._dataArray[8] == "noValue")
					{
						document.getElementById('q11aText').innerHTML = q11StringsArray["q11AnswerAStringA"];
						document.getElementById('q11bText').innerHTML = q11StringsArray["q11AnswerBStringA"];
						document.getElementById('q11cText').innerHTML = q11StringsArray["q11AnswerCStringA"];
						document.getElementById('q11dText').innerHTML = q11StringsArray["q11AnswerDStringA"];
					}
				else if(this.dataObj._dataArray[8] == "a")
					{
						document.getElementById('q11aText').innerHTML = q11StringsArray["q11AnswerAStringB"];
						document.getElementById('q11bText').innerHTML = q11StringsArray["q11AnswerBStringB"];
						document.getElementById('q11cText').innerHTML = q11StringsArray["q11AnswerCStringB"];
						document.getElementById('q11dText').innerHTML = q11StringsArray["q11AnswerDStringB"];
					}
											
				//rewrite q13 - in the plural
				document.getElementById('q13aAnswerTxt').innerHTML = q13StringsArray["q13AnswerAStringA"];
				document.getElementById('q13bAnswerTxt').innerHTML = q13StringsArray["q13AnswerBStringA"];
				document.getElementById('q13cAnswerTxt').innerHTML = q13StringsArray["q13AnswerCStringA"];
										
				//enable q14 (in conjunction with q7)
				if(this.dataObj._dataArray[7] == "a" || this.dataObj._dataArray[7] == "noValue")
					{
						document.getElementById('q14QuestionTxt').innerHTML = q14StringsArray["q14QuestionStringA"];
						formName = "the_worst";
						qNumberArray = new Array("q14");
						buttonLengthArray = [document.the_worst.q14.length];
						firstIdArray = new Array("q14QuestionTxt","q14aAnswerTxt","q14bAnswerTxt","q14cAnswerTxt");
						idArray = new Array(firstIdArray);
						colour = "#000000";
						buttonState = false;
						this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
					}
										
				//enable q15
				this.dataObj._dataArray[15] = "noValue";
				formName = "the_worst";
				qNumberArray = new Array("q15");
				buttonLengthArray = [document.the_worst.q15.length];
				firstIdArray = new Array("q15QuestionTxt","q15aAnswerTxt","q15bAnswerTxt","q15cAnswerTxt");
				idArray = new Array(firstIdArray);
				colour = "#000000";
				buttonState = false;
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
										
				//do stuff to question 16 (in conjunction with q2 & q4)
				formName = "the_worst";
				qNumberArray = new Array("q16");
				buttonLengthArray = [document.the_worst.q16.length];
				firstIdArray = new Array("q16QuestionTxt","q16aAnswerTxt","q16bAnswerTxt","q16cAnswerTxt");
				idArray = new Array(firstIdArray);
				colour = "#000000";
				buttonState = false;
				if(this.dataObj._dataArray[2] != "a" || this.dataObj._dataArray[2] == "noValue")//job=no or undefined
					{
						if(this.dataObj._dataArray[4] != "a" || this.dataObj._dataArray[4] == "noValue")//pjob=no or undefined
							{
								colour = "#CCCCCC";
								buttonState = true;
								this.dataObj._dataArray[16] = "x";//set a 'null' value for question16
								this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);//disable question 16
							}
						else if(this.dataObj._dataArray[4] == "a")//pjob=yes
							{
								document.getElementById('q16QuestionTxt').innerHTML = q16StringsArray["q16QuestionStringC"];
								document.getElementById('q16aAnswerTxt').innerHTML = q16StringsArray["q16AnswerAStringB"];
								document.getElementById('q16bAnswerTxt').innerHTML = q16StringsArray["q16AnswerBStringB"];
								this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
							}
					}
				else if(this.dataObj._dataArray[2] == "a")//job=yes
					{
						if(this.dataObj._dataArray[4] != "a" || this.dataObj._dataArray[4] == "noValue")//pjob=no or undefined
							{
								document.getElementById('q16QuestionTxt').innerHTML = q16StringsArray["q16QuestionStringA"];
								document.getElementById('q16aAnswerTxt').innerHTML = q16StringsArray["q16AnswerAStringB"];
								document.getElementById('q16bAnswerTxt').innerHTML = q16StringsArray["q16AnswerBStringB"];
								this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
							}
						else if(this.dataObj._dataArray[4] == "a")//pjob=yes
								{
									document.getElementById('q16QuestionTxt').innerHTML = q16StringsArray["q16QuestionStringB"];
									document.getElementById('q16aAnswerTxt').innerHTML = q16StringsArray["q16AnswerAStringB"];
									document.getElementById('q16bAnswerTxt').innerHTML = q16StringsArray["q16AnswerBStringB"];
									this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
								}
					}
											
				//rewrite answers to question 18
				document.getElementById('q18aAnswerTxt').innerHTML = q18StringsArray["q18AnswerAStringA"];
				document.getElementById('q18bAnswerTxt').innerHTML = q18StringsArray["q18AnswerBStringA"];
			}
		else if(this.dataObj._dataArray[3] == "b")//if partner = no, disable question4 & 5
			{
				formName = "aboutYou";
				qNumberArray = new Array("q4","q5");
				buttonLengthArray = [document.aboutYou.q4.length,document.aboutYou.q5.length];
				firstIdArray = new Array("q4QuestionTxt","q4aAnswerTxt","q4bAnswerTxt","q4cAnswerTxt");
				secondIdArray = new Array("q5QuestionTxt","q5aAnswerTxt","q5bAnswerTxt");
				idArray = new Array(firstIdArray,secondIdArray);
				colour = "#CCCCCC";
				buttonState = true;
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
				//for(var z=0;z<=document.aboutYou.q4.length;z++)
				//	{
				//		alert("bollocks");
				//		document.aboutYou.q4[z].checked = false;
				//	}
				this.dataObj._dataArray[4] = "x";//set a 'null' value for question4
				this.dataObj._dataArray[5] = "x";//set a 'null' value for question5
										
				//rewrite q6 & q7 - in the singular
				document.getElementById('qSix').innerHTML = q6StringsArray["q6QuestionStringB"];
				document.getElementById('qSeven').innerHTML = q7StringsArray["q7QuestionStringB"];

				//rewrite answers to q9 & q10 - in the singular
				document.getElementById('q9aText').innerHTML = q9StringsArray["q9AnswerAStringB"];
				document.getElementById('q9bText').innerHTML = q9StringsArray["q9AnswerBStringB"];
				document.getElementById('q9cText').innerHTML = q9StringsArray["q9AnswerCStringB"];
				document.getElementById('q10aText').innerHTML = q10StringsArray["q10AnswerAStringB"];
				document.getElementById('q10bText').innerHTML = q10StringsArray["q10AnswerBStringB"];
				document.getElementById('q10cText').innerHTML = q10StringsArray["q10AnswerCStringB"];
				//rewrite q11 (inconjunction with q8 mortgage question
				if(this.dataObj._dataArray[8] == "b" || this.dataObj._dataArray[8] == "noValue")
					{
						document.getElementById('q11aText').innerHTML = q11StringsArray["q11AnswerAStringC"];
						document.getElementById('q11bText').innerHTML = q11StringsArray["q11AnswerBStringC"];
						document.getElementById('q11cText').innerHTML = q11StringsArray["q11AnswerCStringC"];
						document.getElementById('q11dText').innerHTML = q11StringsArray["q11AnswerDStringC"];
					}
				else if(this.dataObj._dataArray[8] == "a")
					{
						document.getElementById('q11aText').innerHTML = q11StringsArray["q11AnswerAStringD"];
						document.getElementById('q11bText').innerHTML = q11StringsArray["q11AnswerBStringD"];
						document.getElementById('q11cText').innerHTML = q11StringsArray["q11AnswerCStringD"];
						document.getElementById('q11dText').innerHTML = q11StringsArray["q11AnswerDStringD"];
					}
											
				//rewrite q13 - in the singular
				document.getElementById('q13aAnswerTxt').innerHTML = q13StringsArray["q13AnswerAStringB"];
				document.getElementById('q13bAnswerTxt').innerHTML = q13StringsArray["q13AnswerBStringB"];
				document.getElementById('q13cAnswerTxt').innerHTML = q13StringsArray["q13AnswerCStringB"];
										
				//disable q14 (in conjunction with q7)
				if(this.dataObj._dataArray[7] == "b" || this.dataObj._dataArray[7] == "noValue")
					{
						formName = "the_worst";
						qNumberArray = new Array("q14");
						buttonLengthArray = [document.the_worst.q14.length];
						firstIdArray = new Array("q14QuestionTxt","q14aAnswerTxt","q14bAnswerTxt","q14cAnswerTxt");
						idArray = new Array(firstIdArray);
						colour = "#CCCCCC";
						buttonState = true;
						this.dataObj._dataArray[14] = "x";//set a 'null' value for question14
						this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
					}
				else if(this.dataObj._dataArray[7] == "a")
					{
						document.getElementById('q14QuestionTxt').innerHTML = q14StringsArray["q14QuestionStringB"];
					}
										
				//disable q15
				formName = "the_worst";
				qNumberArray = new Array("q15");
				buttonLengthArray = [document.the_worst.q14.length];
				firstIdArray = new Array("q15QuestionTxt","q15aAnswerTxt","q15bAnswerTxt","q15cAnswerTxt");
				idArray = new Array(firstIdArray);
				colour = "#CCCCCC";
				buttonState = true;
				this.dataObj._dataArray[15] = "x";//set a 'null' value for question15
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
										
				//do stuff to question 16 (in conjunction with q2 & q4)
				formName = "the_worst";
				qNumberArray = new Array("q16");
				buttonLengthArray = [document.the_worst.q16.length];
				firstIdArray = new Array("q16QuestionTxt","q16aAnswerTxt","q16bAnswerTxt","q16cAnswerTxt");
				idArray = new Array(firstIdArray);
				colour = "#000000";
				buttonState = false;
										
				if(this.dataObj._dataArray[2] != "a" || this.dataObj._dataArray[2] == "noValue")//job=no or undefined
					{
						colour = "#CCCCCC";
						buttonState = true;
						this.dataObj._dataArray[16] = "x";//set a 'null' value for question16
						this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);//disable question 16
					}
				else if(this.dataObj._dataArray[2] == "a")//job=yes
					{
						document.getElementById('q16QuestionTxt').innerHTML = q16StringsArray["q16QuestionStringA"];
						document.getElementById('q16aAnswerTxt').innerHTML = q16StringsArray["q16AnswerAStringA"];
						document.getElementById('q16bAnswerTxt').innerHTML = q16StringsArray["q16AnswerBStringA"];
						this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
					}
											
				//rewrite answers to question 18
				document.getElementById('q18aAnswerTxt').innerHTML = q18StringsArray["q18AnswerAStringB"];
				document.getElementById('q18bAnswerTxt').innerHTML = q18StringsArray["q18AnswerBStringB"];
			}
		return;
	}
	
DisplayControl.prototype.question4 = function(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState,q16StringsArray)	
	{
		if(this.dataObj._dataArray[4] != "b")//if not b, enable question5
			{
				this.dataObj._dataArray[5] = "noValue";
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);										
			}
		else if(this.dataObj._dataArray[4] == "b")//else disable question5
			{
				colour = "#CCCCCC";
				buttonState = true;
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
				this.dataObj._dataArray[5] = "x";//set default value for question5
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
			}
								
		//do stuff to q16...
		this.dataObj._dataArray[16] = "noValue";
		formName = "the_worst";
		qNumberArray = new Array("q16");
		buttonLengthArray = [document.the_worst.q16.length];
		firstIdArray = new Array("q16QuestionTxt","q16aAnswerTxt","q16bAnswerTxt","q16cAnswerTxt");
		idArray = new Array(firstIdArray);
		colour = "#000000";
		buttonState = false;
								
		if(this.dataObj._dataArray[4] == "a" && this.dataObj._dataArray[2] == "a")//if pjob==working & job==working
			{
				document.getElementById('q16QuestionTxt').innerHTML = q16StringsArray["q16QuestionStringB"];
				document.getElementById('q16aAnswerTxt').innerHTML = q16StringsArray["q16AnswerAStringB"];
				document.getElementById('q16bAnswerTxt').innerHTML = q16StringsArray["q16AnswerBStringB"];
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
			}
		else if(this.dataObj._dataArray[4] == "a" && (this.dataObj._dataArray[2] != "a" || this.dataObj._dataArray[2] != "noValue"))//if pjob==working & job=no or job=undefined
			{
				document.getElementById('q16QuestionTxt').innerHTML = q16StringsArray["q16QuestionStringC"];
				document.getElementById('q16aAnswerTxt').innerHTML = q16StringsArray["q16AnswerAStringB"];
				document.getElementById('q16bAnswerTxt').innerHTML = q16StringsArray["q16AnswerBStringB"];
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
			}
		else if(this.dataObj._dataArray[4] != "a" && this.dataObj._dataArray[2] == "a")//if pjob=no & job!=ret
			{
				document.getElementById('q16QuestionTxt').innerHTML = q16StringsArray["q16QuestionStringA"];
				document.getElementById('q16aAnswerTxt').innerHTML = q16StringsArray["q16AnswerAStringB"];
				document.getElementById('q16bAnswerTxt').innerHTML = q16StringsArray["q16AnswerBStringB"];
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
			}
		else if(this.dataObj._dataArray[4] != "a" && (this.dataObj._dataArray[2] != "a" || this.dataObj._dataArray[2] != "noValue"))//if pjob=ret & job=ret
			{
				colour = "#CCCCCC";
				buttonState = true;
				this.dataObj._dataArray[16] = "x";//set a 'null' value for question16
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);//disable question 16
			}
		return;
	}
	

DisplayControl.prototype.question7 = function(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState,q14StringsArray)	
	{
		if(this.dataObj._dataArray[7] == "b" && this.dataObj._dataArray[3] == "b")//if no dependants and no partner
			{	
				colour = "#CCCCCC";
				buttonState = true;
				this.dataObj._dataArray[14] = "x";//set a 'null' value for question14
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
			}
		else if(this.dataObj._dataArray[7] == "b" && this.dataObj._dataArray[3] == "a")//if partner but no dependants
			{
				document.getElementById('q14QuestionTxt').innerHTML = q14StringsArray["q14QuestionStringA"];
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
			}
		else if(this.dataObj._dataArray[7] == "a" && this.dataObj._dataArray[3] == "b")//if dependants but no partner
			{
				this.dataObj._dataArray[14] = "noValue";
				document.getElementById('q14QuestionTxt').innerHTML = q14StringsArray["q14QuestionStringB"];
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
			}
		else if(this.dataObj._dataArray[7] == "a" && this.dataObj._dataArray[3] == "a")//if dependants and partner
			{
				document.getElementById('q14QuestionTxt').innerHTML = q14StringsArray["q14QuestionStringC"];
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
			}
		return;
	}	

DisplayControl.prototype.question8 = function(q11StringsArray)	
	{
		if(this.dataObj._dataArray[8] == "a" && this.dataObj._dataArray[3] == "a")//if mortgage = yes and partner = yes
			{
				document.getElementById('q11aText').innerHTML = q11StringsArray["q11AnswerAStringB"];
				document.getElementById('q11bText').innerHTML = q11StringsArray["q11AnswerBStringB"];
				document.getElementById('q11cText').innerHTML = q11StringsArray["q11AnswerCStringB"];
				document.getElementById('q11dText').innerHTML = q11StringsArray["q11AnswerDStringB"];
				this.dataObj._dataArray[12] = "noValue";//set default value for question11
				this.dataObj._dataArray[13] = "noValue";//set default value for question12
			}
		else if(this.dataObj._dataArray[8] == "a" && this.dataObj._dataArray[3] == "b")//if mortgage = yes and partner = no
			{
				document.getElementById('q11aText').innerHTML = q11StringsArray["q11AnswerAStringD"];
				document.getElementById('q11bText').innerHTML = q11StringsArray["q11AnswerBStringD"];
				document.getElementById('q11cText').innerHTML = q11StringsArray["q11AnswerCStringD"];
				document.getElementById('q11dText').innerHTML = q11StringsArray["q11AnswerDStringD"];
				this.dataObj._dataArray[12] = "noValue";//set default value for question11
				this.dataObj._dataArray[13] = "noValue";//set default value for question12
			}
		else if(this.dataObj._dataArray[8] == "b" && this.dataObj._dataArray[3] == "a")//if mortgage = no and partner = yes
			{
				document.getElementById('q11aText').innerHTML = q11StringsArray["q11AnswerAStringA"];
				document.getElementById('q11bText').innerHTML = q11StringsArray["q11AnswerBStringA"];
				document.getElementById('q11cText').innerHTML = q11StringsArray["q11AnswerCStringA"];
				document.getElementById('q11dText').innerHTML = q11StringsArray["q11AnswerDStringA"];
				this.dataObj._dataArray[12] = "noValue";//set default value for question11
				this.dataObj._dataArray[13] = "noValue";//set default value for question12
			}
		else if(this.dataObj._dataArray[8] == "b" && this.dataObj._dataArray[3] == "b")//if mortgage = no and partner = no
			{
				document.getElementById('q11aText').innerHTML = q11StringsArray["q11AnswerAStringC"];
				document.getElementById('q11bText').innerHTML = q11StringsArray["q11AnswerBStringC"];
				document.getElementById('q11cText').innerHTML = q11StringsArray["q11AnswerCStringC"];
				document.getElementById('q11dText').innerHTML = q11StringsArray["q11AnswerDStringC"];
			}
			
		if(this.dataObj._dataArray[8] == "b")
			{
				this.dataObj._dataArray[12] = "x";//set a 'null' value for question12
				this.dataObj._dataArray[13] = "x";//set a 'null' value for question13
			}
		return;
	}

DisplayControl.prototype.question12 = function(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState,q13StringsArray)	
	{
		if(this.dataObj._dataArray[12] == "a")
			{
				//rewrite q13
				document.getElementById('q13QuestionTxt').innerHTML = q13StringsArray["q13QuestionStringA"];
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
				this.dataObj._dataArray[13] = "noValue";//set default value for question13 - to account for people who go back and change their minds
			}
		else if(this.dataObj._dataArray[12] == "c")
			{
				//rewrite q13
				document.getElementById('q13QuestionTxt').innerHTML = q13StringsArray["q13QuestionStringB"];
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
				this.dataObj._dataArray[13] = "noValue";//set default value for question13 - to account for people who go back and change their minds
			}
		else if(this.dataObj._dataArray[12] == "b" || this.dataObj._dataArray[12] == "d")
			{
				colour = "#CCCCCC";
				buttonState = true;
				//this.dataObj._dataArray[13] = "x";//set default value for question13
				this.disreenableQ(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState);
				this.dataObj._dataArray[13] = "x";//set a 'null' value for question13
			}
		return;
	}
	
DisplayControl.prototype.disreenableQ = function(formName,qNumberArray,buttonLengthArray,idArray,colour,buttonState)
	{
		var i = 0;
		while(i < qNumberArray.length)
			{
				var j = 0;
				while( j < idArray[i].length)
					{
						var id = idArray[i][j];
						document.getElementById(id).style.color = colour;
						j++;
					}
				
				var k = 0;
				while (k < buttonLengthArray[i])
					{
						if(buttonState == true)
							{
								document[formName][qNumberArray[i]][k].checked = false;//clear any checked buttons
							}				
						document[formName][qNumberArray[i]][k].disabled = buttonState;
						k++;
					}
				i++;
			}
		return;
	}