
	QArray   = new Array(new Array(),new Array()) //[0][0],[1][0] - QTxt,QDisp
	Q0AArray = new Array(new Array(),new Array()) //[0][0],[1][0] - ATxt,AAct
	Q1AArray = new Array(new Array(),new Array())
	Q2AArray = new Array(new Array(),new Array())
	Q3AArray = new Array(new Array(),new Array())
	Q4AArray = new Array(new Array(),new Array())
	Q5AArray = new Array(new Array(),new Array())
	Q6AArray = new Array(new Array(),new Array())
	Q7AArray = new Array(new Array(),new Array())
	Q8AArray = new Array(new Array(),new Array())
	Q9AArray = new Array(new Array(),new Array())
	Q10AArray = new Array(new Array(),new Array())
	Q11AArray = new Array(new Array(),new Array())
		
	//Question1
	QArray [0][0] = 'Question 1. What type of service would you like?<br>'
	QArray [1][0] = 'inline'
	
		//Question2 Branch a
		QArray [0][1] = 'Question 2. Please select the amount you may deposit<br>'
		QArray [1][1] = 'none'
	
			//Question3 Branch a
			QArray [0][3] = 'Question 3. Do you need instant access to the money?<br>'
			QArray [1][3] = 'none'
			
				//Question4 Branch a:a:a
				QArray [0][4] = 'Question 4. Which account would you like to see?<br>'
				QArray [1][4] = 'none'
				
				//Question4 Branch a:a:b
				QArray [0][11] = 'Question 4. Which account would you like to see?<br>'
				QArray [1][11] = 'none'
			
			//Question3 Branch a:b
			QArray [0][10] = 'Question 3. Which account would you like to see?<br>'
			QArray [1][10] = 'none'
	
		
		//Question2 Branch b
		QArray [0][2] = 'Question 2. Are you looking for an execution only service?<br>'
		QArray [1][2] = 'none'
		
			//Question3 Branch b
			QArray [0][5] = 'Question 3. Please select the amount you wish to invest?<br>'
			QArray [1][5] = 'none'
			
			//Question4 Branch b
			QArray [0][6] = 'Question 4. Which account would you like to see?<br>'
			QArray [1][6] = 'none'
			
			//Question4 Branch b
			QArray [0][7] = 'Question 4. Which account would you like to see?<br>'
			QArray [1][7] = 'none'
			
			//Question4 Branch b
			QArray [0][8] = 'Question 4. Which account would you like to see?<br>'
			QArray [1][8] = 'none'
			
			//Question4 Branch b
			QArray [0][9] = 'Question 4. Which account would you like to see?<br>'
			QArray [1][9] = 'none'




	
	//Question 1 Answers
	Q0AArray [0][0] = 'Please select an option'
	Q0AArray [1][0] = 'NULL:NULL'
	Q0AArray [0][1] = 'Banking only'
	Q0AArray [1][1] = 'shw:1'
	Q0AArray [0][2] = 'An integrated banking and investment service'
	Q0AArray [1][2] = 'jmp:combined-services/focus.aspx'
	Q0AArray [0][3] = 'Investment only'
	Q0AArray [1][3] = 'shw:2'
	Q0AArray [0][4] = 'Trust'
	Q0AArray [1][4] = 'jmp:trusts.aspx'
	Q0AArray [0][5] = 'Lending'
	Q0AArray [1][5] = 'jmp:banking-services/lending.aspx'
	Q0AArray [0][6] = 'Foreign exchange'
	Q0AArray [1][6] = 'jmp:banking-services/foreign-exchange.aspx'
	
		//Question 2 branch a Answers
		Q1AArray [0][0] = 'Please select an amount'
		Q1AArray [1][0] = 'NULL:NULL'
		Q1AArray [0][1] = '&pound;5,000 - &pound;49,999'
		Q1AArray [1][1] = 'shw:10'
		Q1AArray [0][2] = '&pound;50,000 +'
		Q1AArray [1][2] = 'shw:3'
		
		//Question 3 branch a Answers
		Q3AArray [0][0] = 'Please select an option'
		Q3AArray [1][0] = 'NULL:NULL'
		Q3AArray [0][1] = 'Yes'
		Q3AArray [1][1] = 'shw:11'
		Q3AArray [0][2] = 'No'
		Q3AArray [1][2] = 'shw:4'
		
		//Question 3 branch a, sub branch b Answers
		Q10AArray [0][0] = 'Please select an option'
		Q10AArray [1][0] = 'NULL:NULL'
		Q10AArray [0][1] = 'Reserve account'
		Q10AArray [1][1] = 'jmp:banking-services/reserve-account.aspx'
		Q10AArray [0][2] = 'Accumulation account'
		Q10AArray [1][2] = 'jmp:banking-services/accumulation-account.aspx'
		
		//Question 4 branch a Answers
		Q4AArray [0][0] = 'Please select an account'
		Q4AArray [1][0] = 'NULL:NULL'
		Q4AArray [0][1] = 'Fixed term deposits'
		Q4AArray [1][1] = 'jmp:banking-services/fixed-term-deposits.aspx'
		Q4AArray [0][2] = 'Focus'
		Q4AArray [1][2] = 'jmp:combined-services/focus.aspx'
		Q4AArray [0][3] = 'Structured deposits'
		Q4AArray [1][3] = 'jmp:banking-services/structured-deposits.aspx'
		
		//Question 4 branch a Answers
		Q11AArray [0][0] = 'Please select an account'
		Q11AArray [1][0] = 'NULL:NULL'
		Q11AArray [0][1] = 'Focus'
		Q11AArray [1][1] = 'jmp:combined-services/focus.aspx'
		Q11AArray [0][2] = 'Accumulation account'
		Q11AArray [1][2] = 'jmp:banking-services/accumulation-account.aspx'
		
		//BranchB
		//Question 2 branch b Answers
		Q2AArray  [0][0] = 'Please select an option'
		Q2AArray  [1][0] = 'NULL:NULL'
		Q2AArray  [0][1] = 'Yes'
		Q2AArray  [1][1] = 'jmp:combined-services/focus.aspx'
		Q2AArray  [0][2] = 'No'
		Q2AArray  [1][2] = 'shw:5'
		
			//Question 3 branch b Answers
			Q5AArray [0][0] = 'Please select the amount you seek to invest'
			Q5AArray [1][0] = 'NULL:NULL'
			Q5AArray [0][1] = '&pound;10,000 - &pound;49,999'
			Q5AArray [1][1] = 'jmp:investment-services/unit-trust-funds.aspx'
			Q5AArray [0][2] = '&pound;50,000 - &pound;99,999'
			Q5AArray [1][2] = 'shw:7'
			Q5AArray [0][3] = '&pound;100,000 +'
			Q5AArray [1][3] = 'shw:8'
			
			//Question 4 branch a Answers
			Q7AArray [0][0] = 'Please select an account'
			Q7AArray [1][0] = 'NULL:NULL'
			//Q7AArray [0][1] = 'Focus index tracker'
			//Q7AArray [1][1] = 'jmp:investment-services/focus-index-tracker.aspx'
			Q7AArray [0][1] = 'International investment funds'
			Q7AArray [1][1] = 'jmp:investment-services/International-investment-funds.aspx'
			
			//Question 4 branch a Answers
			Q8AArray [0][0] = 'Please select an account'
			Q8AArray [1][0] = 'NULL:NULL'
			//Q8AArray [0][1] = 'Focus Index Tracker'
			//Q8AArray [1][1] = 'jmp:investment-services/International-investment-funds.aspx'
			Q8AArray [0][1] = 'International investment funds'
			Q8AArray [1][1] = 'jmp:investment-services/International-investment-funds.aspx'
			Q8AArray [0][2] = 'Discretionary investment management'
			Q8AArray [1][2] = 'jmp:investment-services/discretionary-investment-manag.aspx'
			

	function AnswerHandler(qId,qObj)
	{
		//If queestion answered is top question reset the questions
		if(qObj.id == '0')
			HideSubQuestions()
		
		aAct = qObj[qObj.selectedIndex].value
		
		//hide any other answers of the question object (just in case a user is switching an answer)
		for(i = 0; i< qObj.length; i++)
		{
			aObj = qObj[i].value.split(':');

			if(aObj[0] == 'shw')
			{
				document.getElementById('d'+aObj[1]).style.display = 'none';
				document.getElementById('d'+aObj[1]).selectedIndex = 0;
			}
		}
		
		aActArr = aAct.split(':')
		switch (aActArr[0])
		{
			case 'shw':
					{
						ShowQuestion(aActArr[1]);
						break
					}
			case 'jmp':
					{
						Jump(aActArr[1]);
						break
					}
			case 'NULL':
					{
					break;
					}
		}
	}
	
	function ShowQuestion(qId)
	{	
		document.getElementById('d'+qId).style.display='inline'
	}
	
	function HideSubQuestions()
	{	
		//Loop through all questions > 0 and hide them
		//Also make sure their selected index is 0, so old answers are not persisted
		for(x=1;x < QArray[0].length; x++)
		{
			document.getElementById('d'+x).style.display='none'
			document.getElementById('d'+x).selectedIndex = 0;
		}
	}
	
	function Jump(dest)
	{
		location.href=dest;
	}
	
	function WriteQuestion(qId)
	{
		strQHTML = ""
		strQHTML+='<div style="display:'+QArray[1][qId]+';font-family:arial;font-size:11px;margin-bottom:15px;" id="d'+qId+'">'+QArray[0][qId]+'<select id='+qId+' onChange="AnswerHandler('+qId+',this)">'
			
			QAArray = eval('Q'+qId+'AArray')
			for(n=0;n < QAArray[0].length; n++)
			{
				strQHTML+='<option value='+QAArray[1][n]+'>'+QAArray[0][n]+'</option>'
			}
			
		strQHTML+='</select></div><br />'
		document.write(strQHTML)
	}
	
	function ConstructQList()
	{
		for(i=0;i< QArray[0].length; i++)
		{
			WriteQuestion(i)
		}
	}
ConstructQList()