
var quiz = new Array(); var r = 0;
var analPage = 'quiz';
quiz[r++] =('<p class="parquiz">When telling a lie appears to be your only solution</p>~I will do my best to put as much truth there as possible.~I’ll try to make everyone happy, but if I can’t, then I can’t.~If right is on your side, what does it matter?~');
quiz[r++] =('<p class="parquiz">Food</p>~I prefer wholesome homemade meals, when possible.~My favorite is a big juicy hamburger.~I am at my best in a nice restaurant.~');
quiz[r++] =('<p class="parquiz">My favorite kinds of movies are</p>~Anything that ends happily ever after.~Action, adventure or horror.~I enjoy a movie that is made well with gripping performances.~');
quiz[r++] =('<p class="parquiz">Money</p>~Should be spent wisely and invested in the future.~Is important in order to get the things you want and need.~Will never be a problem if one does what needs to be done.~');
quiz[r++] =('<p class="parquiz">When I’m on the verge of failing</p>~I will use my inner strength to overcome it.~I will fight it tooth and claw to prevent it.~I will find a way to turn it to my advantage.~');
quiz[r++] =('<p class="parquiz">House keeping</p>~There is nothing like a clean, great smelling house!~Uhm… okay.~That’s what maids are for.~');
quiz[r++] =('<p class="parquiz">Best forms of electronic communication</p>~With email I have the time and space to say exactly what I want.~When I text, I can get it done quickly and move on to something else.~Nothing replaces live communication – tone of the voice, the inflection of the words.~');
quiz[r++] =('<p class="parquiz">Pets</p>~I love animals! They can be great companions.~No.~During lean times, they will sustain you.~');
quiz[r++] =('<p class="parquiz">When someone says something rude to your companion</p>~I would wait for a second offense before I took action.~My companion could take care of himself - he probably started it anyway.~I will deal with the offender later&hellip; in private.~');
quiz[r++] =('<p class="parquiz">Which two are most important?</p>~Beauty and health.~Health and wealth.~Wealth and beauty.~');
quiz[r++] =('<p class="parquiz">To succeed, I must</p>~Formulate a plan and work hard at it.~Fight for what I want.~Be patient.~');




// Quiz Javascript

// percentages for page splits
var one = 50; var two =  70;  var three = 0;

function randOrd(){return(Math.round(Math.random())-0.5); }
function displayResult(aa,bb,cc) {var tot = aa + bb + cc; aa = Math.floor(aa * 100 / tot); bb = Math.floor(bb * 100 / tot); cc = Math.floor(cc * 100 / tot); if (aa > one) analPage = analPage + 'a'; else if (bb > one) analPage = analPage + 'b'; else if (cc > one) analPage = analPage + 'c'; else if (aa + bb > two) analPage = analPage + 'ab'; else if (aa + cc > two) analPage = analPage + 'ac';  else if (bb + cc > two) analPage = analPage + 'bc'; else if (dd < 100 - three) analPage = analPage + 'abc';  document.write('<div style="color: #990066; font-style: italic; font-family: Georgia; font-size: 12pt;">Congratulations! You have completed the quiz.<\/div><blockquote><span style="font-size:12pt;"> <br \/> <br \/><\/span><\/blockquote><div style="color: #990066; font-style: normal; font-family: Georgia; font-size: 12pt;"><a href="'+analPage+'">Unveil your result &hellip; drumroll please!</a><\/div>');}
var qsParm = new Array(); function qs() {var query = window.location.search.substring(1); var parms = query.split('&'); for (var i=0; i<parms.length; i++) {var pos = parms[i].indexOf('='); if (pos > 0) { var key = parms[i].substring(0,pos); var val = parms[i].substring(pos+1); qsParm[key] = val;}}} qsParm['questnum'] = 0; qsParm['aa'] = 0; qsParm['bb'] = 0; qsParm['cc'] = 0; qsParm['dd'] = 0; qs(); var questnum = qsParm['questnum']; var aa = qsParm['aa'];aa=aa%475; var bb = qsParm['bb'];bb=bb%475; var cc = qsParm['cc'];cc=cc%475; var dd = qsParm['dd'];dd=dd%475;
function checkAnswer(e,x){var a = -1; for (var i=0; i<e.c.length; i++) {if (e.c[i].checked) {a = i;}} if (a == -1) {alert("Not so fast, please select an answer"); return false;} switch(e.c[a].value) {case '0': aa++; break; case '1': bb++; break; case '2': cc++; break; case '3': dd++; break;} var www = self.location.href.lastIndexOf('?'); var thispage = self.location.href; if (www != -1) thispage = self.location.href.substr(0,www); questnum++; var p = Math.floor((Math.random() * 8) + 2); aa = (p * 475) +aa; p = Math.floor((Math.random() * 8) + 2); bb = (p * 475) +bb; p = Math.floor((Math.random() * 8) + 2); cc = (p * 475) +cc; p = Math.floor((Math.random() * 8) + 2); dd = (p * 475) +dd; top.location = thispage + '?questnum='+ questnum +'&aa='+aa+'&bb='+bb+'&cc='+cc+'&dd='+dd; return false;}
var tblsz = quiz.length; document.write('<table align="center" cellpadding="3" width="580" border="1"><tr>'); if (questnum < quiz.length) {var f = quiz[questnum].split('~');var ans = []; document.write('<td align="left"><form name="myForm"><div style="font-size:14px;">'+f[0]+'</div><blockquote><span style="color:#FFFFCC; font: normal 12px/18px "Georgia", serif;">\n'); ans[0] = '<input type="radio" name="c" value="0" \/> '+f[1]+'<br />\n'; ans[1] = '<input type="radio" name="c" value="1" \/> '+f[2]+'<br \/>\n'; if (f[3] != '') ans[2] = '<input type="radio" name="c" value="2" \/> '+f[3]+'<br \/>\n'; if (f[4] != '') ans[3] = '<input type="radio" name="c" value="3" \/> '+f[4]+'<br />\n'; ans.sort( randOrd ); document.write(ans.join('')); document.write('<\/span><\/blockquote><br /><br /><div align="left"><input type="button" value="Next Question" onclick="checkAnswer(myForm,0);return false;" \/><\/div><\/form>\n');} else { document.write('<td align="center">\n'); document.write('<form name="myForm">'); displayResult(aa,bb,cc,dd); document.write('<\/form>\n');} document.write('<\/td><\/tr><\/table>\n');
