<!--

if (query!="") {


//conventional
var c = 0;
var cpara = "";
//enterprising
var e = 0;
var epara = "";
//artistic
var a = 0;
var apara = "";
//realistic
var r = 0;
var rpara = "";
//social
var s = 0;
var spara = "";
//investigative
var i = 0;
var ipara = "";

var Q01_most = answers[0].substring(0);
var Q01_least = answers[1].substring(0);
var Q02_most = answers[2].substring(0);
var Q02_least = answers[3].substring(0);
var Q03_most = answers[4].substring(0);
var Q03_least = answers[5].substring(0);
var Q04_most = answers[6].substring(0);
var Q04_least = answers[7].substring(0);
var Q05_most = answers[8].substring(0);
var Q05_least = answers[9].substring(0);
var Q06_most = answers[10].substring(0);
var Q06_least = answers[11].substring(0);
var Q07_most = answers[12].substring(0);
var Q07_least = answers[13].substring(0);


//Q01 most
if (Q01_most == "a") {
	c += 1;
}
else if (Q01_most == "b") {
	i += 1;
}
else if (Q01_most == "c") {
	a += 1;
}
else if (Q01_most == "d") {
	r += 1;
}
else if (Q01_most == "e") {
	s += 1;
}
else if (Q01_most == "f") {
	e += 1;
}
//Q01 least
if (Q01_least == "a") {
	c -= 1;
}
else if (Q01_least == "b") {
	i -= 1;
}
else if (Q01_least == "c") {
	a -= 1;
}
else if (Q01_least == "d") {
	r -= 1;
}
else if (Q01_least == "e") {
	s -= 1;
}
else if (Q01_least == "f") {
	e -= 1;
}
//Q02 most
if (Q02_most == "a") {
	e += 1;
}
else if (Q02_most == "b") {
	r += 1;
}
else if (Q02_most == "c") {
	a += 1;
}
else if (Q02_most == "d") {
	c += 1;
}
else if (Q02_most == "e") {
	s += 1;
}
else if (Q02_most == "f") {
	i += 1;
}
//Q02 least
if (Q02_least == "a") {
	e -= 1;
}
else if (Q02_least == "b") {
	r -= 1;
}
else if (Q02_least == "c") {
	a -= 1;
}
else if (Q02_least == "d") {
	c -= 1;
}
else if (Q02_least == "e") {
	s -= 1;
}
else if (Q02_least == "f") {
	i -= 1;
}
//Q03 most
if (Q03_most == "a") {
	r += 1;
}
else if (Q03_most == "b") {
	s += 1;
}
else if (Q03_most == "c") {
	i += 1;
}
else if (Q03_most == "d") {
	e += 1;
}
else if (Q03_most == "e") {
	a += 1;
}
else if (Q03_most == "f") {
	c += 1;
}
//Q03 least
if (Q03_least == "a") {
	r -= 1;
}
else if (Q03_least == "b") {
	s -= 1;
}
else if (Q03_least == "c") {
	i -= 1;
}
else if (Q03_least == "d") {
	e -= 1;
}
else if (Q03_least == "e") {
	a -= 1;
}
else if (Q03_least == "f") {
	c -= 1;
}
//Q04 most
if (Q04_most == "a") {
	a += 1;
}
else if (Q04_most == "b") {
	e += 1;
}
else if (Q04_most == "c") {
	s += 1;
}
else if (Q04_most == "d") {
	c += 1;
}
else if (Q04_most == "e") {
	i += 1;
}
else if (Q04_most == "f") {
	r += 1;
}
//Q04 least
if (Q04_least == "a") {
	a -= 1;
}
else if (Q04_least == "b") {
	e -= 1;
}
else if (Q04_least == "c") {
	s -= 1;
}
else if (Q04_least == "d") {
	c -= 1;
}
else if (Q04_least == "e") {
	i -= 1;
}
else if (Q04_least == "f") {
	r -= 1;
}
//Q05 most
if (Q05_most == "a") {
	i += 1;
}
else if (Q05_most == "b") {
	a += 1;
}
else if (Q05_most == "c") {
	c += 1;
}
else if (Q05_most == "d") {
	r += 1;
}
else if (Q05_most == "e") {
	e += 1;
}
else if (Q05_most == "f") {
	s += 1;
}
//Q05 least
if (Q05_least == "a") {
	i -= 1;
}
else if (Q05_least == "b") {
	a -= 1;
}
else if (Q05_least == "c") {
	c -= 1;
}
else if (Q05_least == "d") {
	r -= 1;
}
else if (Q05_least == "e") {
	e -= 1;
}
else if (Q05_least == "f") {
	s -= 1;
}
//Q06 most
if (Q06_most == "a") {
	s += 1;
}
else if (Q06_most == "b") {
	c += 1;
}
else if (Q06_most == "c") {
	e += 1;
}
else if (Q06_most == "d") {
	i += 1;
}
else if (Q06_most == "e") {
	r += 1;
}
else if (Q06_most == "f") {
	a += 1;
}
//Q06 least
if (Q06_least == "a") {
	s -= 1;
}
else if (Q06_least == "b") {
	c -= 1;
}
else if (Q06_least == "c") {
	e -= 1;
}
else if (Q06_least == "d") {
	i -= 1;
}
else if (Q06_least == "e") {
	r -= 1;
}
else if (Q06_least == "f") {
	a -= 1;
}
//Q07 most
if (Q07_most == "a") {
	a += 1;
}
else if (Q07_most == "b") {
	i += 1;
}
else if (Q07_most == "c") {
	r += 1;
}
else if (Q07_most == "d") {
	s += 1;
}
else if (Q07_most == "e") {
	c += 1;
}
else if (Q07_most == "f") {
	e += 1;
}
//Q07 least
if (Q07_least == "a") {
	a -= 1;
}
else if (Q07_least == "b") {
	i -= 1;
}
else if (Q07_least == "c") {
	r -= 1;
}
else if (Q07_least == "d") {
	s -= 1;
}
else if (Q07_least == "e") {
	c -= 1;
}
else if (Q07_least == "f") {
	e -= 1;
}

}

//puts results into an associative array and sorts with the highest score first.

function thing(at1, at2)
{
    var tmp = new Object();
    tmp.letter = at1;
    tmp.value  = at2;
    return tmp;
}

var myArray = new Array();
myArray[0] = new thing("c",c);
myArray[1] = new thing("e",e);
myArray[2] = new thing("a",a);
myArray[3] = new thing("r",r);
myArray[4] = new thing("s",s);
myArray[5] = new thing("i",i);

function doSort(a,b)
{
    return b.value - a.value ;
}

myArray.sort(doSort);

// to test results
/*
for (var i in myArray)
{
	document.write(myArray[i].letter + " = " + myArray[i].value+"<br>");
}
*/

if (c > 0) {
cpara = "<h3>Conventional</h3><p>Your results suggest that Conventional type work might suit your interests and preferences.</p>";
}
else if (c < 0) {
cpara = "<h3>Conventional</h3><p>Your results suggest that Conventional type work is less likely to suit your interests.</p>";
}
if (c != 0) {
cpara += "<p>Conventional types are happy to work within systems and large organisations and tend to focus on accuracy and efficiency, preferring to know what is expected of them.  They tend to like things to be organised and predictable and are often involved in roles that involve recording, sorting, documenting and organising.  Typical roles for Conventional types include the range of administrative and clerical roles (e.g. in the government and financial sectors) as well as accountancy, banking, bookkeeping, secretarial work and some inspecting roles.</p>";
}

if (e > 0) {
epara = "<h3>Enterprising</h3><p>Your results suggest that Enterprising type work might suit your interests and preferences.</p>";
}
else if (e < 0) {
epara = "<h3>Enterprising</h3><p>Your results suggest that Enterprising type work is less likely to suit your interests.</p>";
}
if (e != 0) {
epara += "<p>Enterprising types like persuading and influencing people as well as controlling, managing and selling to them.  They like to take a lead and are often quite motivated and ambitious but may be impatient and can find rules and detail frustrating.  They tend to favour roles such as salesperson, manager, estate agent, supervisor, lawyer, advertising or marketing executive and often like positions that have status and prestige.</p>";
}

if (a > 0) {
apara = "<h3>Artistic</h3><p>Your results suggest that Artistic type work might suit your interests and preferences.</p>";
}
else if (a < 0) {
apara = "<h3>Artistic</h3><p>Your results suggest that Artistic type work is less likely to suit your interests.</p>";
}
if (a != 0) {
apara += "<p>Artistic types are interested in creativity and art, preferring freedom and independence to following rules and procedures.  Self-expression is very important to Artistic types and they may prefer to work alone.  Typical roles for Artistic types include artist, singer, designer, photographer, musician, writer and actor.</p>";
}

if (r > 0) {
rpara = "<h3>Realistic</h3><p>Your results suggest that Realistic type work might suit your interests and preferences.</p>";
}
else if (r < 0) {
rpara = "<h3>Realistic</h3><p>Your results suggest that Realistic type work is less likely to suit your interests.</p>";
}
if (r != 0) {
rpara += "<p>Realistic types generally prefer action to words, they like physical activity and may prefer working with things to working with people.  They tend to favour jobs where they can work with their hands or produce things, and often like outdoor work.  Typical roles that suit Realistic types are gardener, mechanic, driver, electrician, farmer, sportsperson, skilled trades, labourers and some engineering and military roles.</p>";
}

if (s > 0) {
spara = "<h3>Social</h3><p>Your results suggest that Social type work might suit your interests and preferences.</p>";
}
else if (s < 0) {
spara = "<h3>Social</h3><p>Your results suggest that Social type work is less likely to suit your interests.</p>";
}
if (s != 0) {
spara += "<p>Social types like roles that focus on helping, teaching or supporting others and very much prefer working with people to working with things or ideas.  They tend to prefer working in teams and like to feel they are doing something useful.  Typical roles for social types include teacher, counsellor, nurse, minister of religion, clinical psychologist or police officer. </p>";
}

if (i > 0) {
ipara = "<h3>Investigative</h3><p>Your results suggest that Investigative type work might suit your interests and preferences.</p>";
}
else if (i < 0) {
ipara = "<h3>Investigative</h3><p>Your results suggest that Investigative type work is less likely to suit your interests.</p>";
}
if (i != 0) {
ipara += "<p>Investigative types prefer thinking to action, they like working with information and may prefer working with ideas rather than with people.  They tend to like jobs in which they can research, analyse and solve problems (or come up with new problems!) and prefer using their brains to their interpersonal skills.  Typical roles that suit Investigative types are scientist, engineer, laboratory worker, computer programmer, pharmacist and vet.</p>";
}
for (var x in myArray) {
	text = eval(myArray[x].letter+"para");
	document.write (text);			
			}
if ((c == 0) && (e == 0) && (a == 0) && (r == 0) && (s == 0) && (i == 0)) {
document.write("<p>The results of the questionnaire have not identified any particular likes or dislikes for you.</p>");
}
 

// -->

