//javascript
var totalvalue=0; var totalvalues= new Array(); var quiz=0; var quest=0; var playername=''; var grades=new Array(); var grade1=0; var grade2=0; var grade3=0; var grade4=0; var grade5=0; var grade6=0; var pick=9;
var question=''; var choices=new Array(); var responses=new Array(); var values=new Array(); var testtitle=''; var bigtext=new Array(); var bigtextneedle=0; var cowneed=9; var vampneed=9; var wookneed=9; var cowcount=0; var vampcount=0; var wookcount=0;
function quizwarning()
{
	document.getElementById("quiztext").innerHTML = '<div id="quizmidtext"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" style="float:left; width:1px; height:325px; top:0px; left:0px;" />Unseen but scientifically established is the idea that there are parallel universes to our world.  In these dimensions things are similar but different.  Planet of the Apes could be one of these.  So could the thirteen colonies described in Battlestar Galactica (Fracking A!).  Hypothetically these parallel universes are not literally parallel and can at times come close or meet our own universe (thus creating unnatural phenomenon such as UFOs and Elvis sightings).  <br /><br />Certain individuals can be more susceptible to recognizing, viewing, and crossing over to a parallel universe.  Scientists have created a Parallel Universe Clairvoyance (PUC) range that represents the ability to see these other worlds.  A person with a high PUC level might be able to see all kinds of crazy things; some of these people could be in asylums.  A person with a low PUC level might think this is all a bunch of rubbish.</div><table width="100%"><tr><td width="33%" style="text-align:center;"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" /></td><td width="33%" style="text-align:center;"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" /></td><td width="33%" style="text-align:center;"><a onclick="quizwarning2()">Continue</a></td></tr></table>';
}
function quizwarning2()
{
	document.getElementById("quiztext").innerHTML = '<div id="quizmidtext"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" style="float:left; width:1px; height:325px; top:0px; left:0px;" />Using a computer program we have created a quiz to find out your PUC level.  Some of the people in the quiz might be familiar, but remember these people might be more or less different than they are in our world.  Or they might be some of the few people with high enough PUC to be able to cross over.  Also time is fluid - so when pertinent we have included our own world\'s dates.  <br /><br />At any rate do not take anything in the quiz to heart.</div><table width="100%"><tr><td width="33%" style="text-align:center;"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" /></td><td width="33%" style="text-align:center;"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" /></td><td width="33%" style="text-align:center;"><a onclick="startQuiz()">Continue</a></td></tr></table>';
}
function startQuiz()
{
	document.getElementById("responsetext").innerHTML = '<h1>PUC Test</h1>';
	document.getElementById("quiztext").innerHTML = '<div id="quizmidtext"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" style="float:left; width:1px; height:325px; top:0px; left:0px;" />There are six quizzes with six multiple-choice questions.  <b>You only need to take three of them.</b>  Each quiz is different, and depending on how you do, this program can establish your Parellel Universe Clairvoyance (PUC) level.  Don\'t be afraid to use instinct.  That is what this is all about.  <br /><br />Once you have completed three of the six quizzes your PUC level will be displayed.  Of course, you can take the quizzes in any order.</div><table width="100%"><tr><td width="33%" style="text-align:center;"><a onclick="getQuestion(1,1)">Alpha Test</a></td><td width="33%" style="text-align:center;"><a onclick="getQuestion(2,1)">Delta Test</a></td><td width="33%" style="text-align:center;"><a onclick="getQuestion(3,1)">Gamma Test</a></td></tr><tr><td width="33%" style="text-align:center;"><a onclick="getQuestion(4,1)">Beta Test</a></td><td width="33%" style="text-align:center;"><a onclick="getQuestion(5,1)">Worker Test</a></td><td width="33%" style="text-align:center;"><a onclick="getQuestion(6,1)">Foodstock Test</a></td></tr></table>';
}
function getQuestion(quizn,questn,pick)
{
	if(questn==0)
	{
		startQuiz();
	}
	else
	{
		if(quiz!=quizn)//reset if new quiz
		{
			totalvalue=0; quiz=quizn; totalvalues.splice(0,15);
			if(quiz==1)
			{playername='my lord';testtitle='Alpha';}
			else if(quiz==2)
			{playername='sir';testtitle='Delta';}
			else if(quiz==3)
			{playername='sir';testtitle='Gamma';}
			else if(quiz==4)
			{playername='sir';testtitle='Beta';}
			else if(quiz==5)
			{playername='slave';testtitle='Worker';}
			else if(quiz==6)
			{playername='worm';testtitle='Foodstock';}
		}
		if(pick==cowneed)
		{cowcount++;}
		else if(pick==vampneed)
		{vampcount++;}
		else if(pick==wookneed)
		{wookcount++;}
		if(questn==7)//quiz finished
		{
			document.getElementById("responsetext").innerHTML = '<h1>PUC Quiz</h1>';
			for(y in totalvalues)
			{totalvalue+=parseFloat(totalvalues[y]);}
			if(totalvalue==0)
			{totalvalue=1;}
			if(quizn==1)
			{grade1=totalvalue;}
			else if(quizn==2)
			{grade2=totalvalue;}
			else if(quizn==3)
			{grade3=totalvalue;}
			else if(quizn==4)
			{grade4=totalvalue;}
			else if(quizn==5)
			{grade5=totalvalue;}
			else
			{grade6=totalvalue;}
			var grades=new Array(); var qnames=new Array();
			if(grade1!=0){grades.push(grade1);qnames.push('Alpha');}
			if(grade2!=0){grades.push(grade2);qnames.push('Delta');}
			if(grade3!=0){grades.push(grade3);qnames.push('Gamma');}
			if(grade4!=0){grades.push(grade4);qnames.push('Beta');}
			if(grade5!=0){grades.push(grade5);qnames.push('Worker');}
			if(grade6!=0){grades.push(grade6);qnames.push('Foodstock');}
			if(grades.length==3)
			{findPUC(grades[0],grades[1],grades[2]);}//testdone
			else
			{
				var qt1=qnames[0]; var qt2=''; var qt3='Two';
				if(qnames.length==2)
				{qt1=qnames[0]+' and '+qnames[1]; qt2='\'s'; qt3='One';}
			document.getElementById("quiztext").innerHTML = '<div id="quizmidtext"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" style="float:left; width:1px; height:325px; top:0px; left:0px;" />'+qt1+' Test'+qt2+' done.  '+qt3+' more left.<br /><br />You may now take another quiz.</div><table width="100%"><tr><td width="33%" style="text-align:center;"><a onclick="getQuestion(1,1)">Alpha Test</a></td><td width="33%" style="text-align:center;"><a onclick="getQuestion(2,1)">Delta Test</a></td><td width="33%" style="text-align:center;"><a onclick="getQuestion(3,1)">Gamma Test</a></td></tr><tr><td width="33%" style="text-align:center;"><a onclick="getQuestion(4,1)">Beta Test</a></td><td width="33%" style="text-align:center;"><a onclick="getQuestion(5,1)">Worker Test</a></td><td width="33%" style="text-align:center;"><a onclick="getQuestion(6,1)">Foodstock Test</a></td></tr></table>';
			}
			quest=0; quiz=0; grades.splice(0,5);  qnames.splice(0,5); 
		}
		else
		{
			bigtextneedle=0;
			if(questn==1)//quiz starting
			{quest=1; document.getElementById("responsetext").innerHTML = '<p style="color:#330000;">This is the first of six questions, '+playername+'.</p>';}
			else
			{
				quest=questn;
				if(!pick && pick!=0)
				{document.getElementById("responsetext").innerHTML = '';}
				else
				{
					if(responses[pick]==' ' || responses[pick]=='')
					{document.getElementById("responsetext").innerHTML = '';}
					else
					{document.getElementById("responsetext").innerHTML = '<p style="color:#330000;">'+responses[pick]+'</p>';}
					totalvalues.push(values[pick]);
				}
			}
			choices.splice(0,4); responses.splice(0,4); values.splice(0,4);//clear variables	
			createRequest();
			var url = "http://www.hoboditty.com/pu_quiz.php";
			url = url + "?quiz="+quizn+'&quest='+questn; 
			//alert(url);
			request.open("POST", url, true);
			request.onreadystatechange = getQuestion_catch;
			request.send(null);
		}
	}
}
var keeptext='';
function getQuestion_catch()
{
	if(request.readyState == 4)
	{
		//if(request.status ==200)
		//{
		var variable = request.responseText;
		//alert(variable);
		bigtext.splice(0,8);
		var callgetpartoftext=0; keeptext='';
		if(variable.match('&')=='&')
		{
			var broken = variable.split('&');
			question=broken[0];
			var totalquestiontext='<div id="quizmidtext"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" style="float:left; width:1px; height:325px; top:0px; left:0px;" /><p style="font-weight:bold;">'+question+'</p><ul>';
			choices.push(broken[1],broken[4],broken[7],broken[10]);
			responses.push(broken[2],broken[5],broken[8],broken[11]);
			values.push(broken[3],broken[6],broken[9],broken[12]);
			cowneed=9;wookneed=9;vampneed=9;
			for(x in choices)
			{
				var thischoice=choices[x];
				if(thischoice.match('cow')=='cow' || thischoice.match('Bovine')=='Bovine' || thischoice.match('Cow')=='Cow')
				{cowneed=x;}
				else if(thischoice.match('immortal')=='immortal' || thischoice.match('Carpathian')=='Carpathian')
				{vampneed=x;}
				else if(thischoice.match('wookie')=='wookie' || thischoice.match('Wookie')=='Wookie')
				{wookneed=x;}
				if(thischoice.match('cuthere')=='cuthere')
				{
					var breakuptext=thischoice.split('cuthere');
					for(d in breakuptext)
					{bigtext.push(breakuptext[d]);}
					callgetpartoftext=1;
					keeptext='<input type="radio" name="thechoices" onclick="getQuestion('+quiz+','+(quest+1)+','+x+')" value="'+x+'" />';
					totalquestiontext+='<li id="longtext"><input type="radio" name="thechoices" onclick="getQuestion('+quiz+','+(quest+1)+','+x+')" value="'+x+'" /></li>';
				}
				else
				{totalquestiontext+='<li><input type="radio" name="thechoices" onclick="getQuestion('+quiz+','+(quest+1)+','+x+')" value="'+x+'" />'+choices[x]+'</li>';}
			}
			totalquestiontext+='</ul></div><table width="100%"><tr><td width="33%" style="text-align:center;"><a onclick="backQuestion('+quiz+','+(quest-1)+')">back</a></td><td width="33%" style="text-align:center;"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" /></td><td width="33%" style="text-align:center;"><a onclick="startQuiz()">start over</a></td></tr></table>';
			//alert(totalquestiontext);
			document.getElementById("quiztext").innerHTML = totalquestiontext;
			if(callgetpartoftext==1)
			{getpartoftext();}
		}
		else
		{
			document.getElementById("responsetext").innerHTML = '<p>Sorry, there is an error.</p>'+variable;
		}
	}
}
function getpartoftext()
{
	if(bigtextneedle+1==bigtext.length)
	{var thetext=keeptext+bigtext[bigtextneedle];}
	else
	{var thetext=keeptext+bigtext[bigtextneedle]+'<a onclick="getpartoftext()" style="cursor:pointer; color:blue; padding-left: 5px;">more >></a>';}
	bigtextneedle++;
	document.getElementById("longtext").innerHTML = thetext;
}
function findPUC(one,two,three)
{
	document.getElementById("responsetext").innerHTML = '<h1>PUC Results</h1>';
	var keepgrades='<b>PUC Level: '+one+':'+two+':'+three+'</b>';
	grade1=0; grade2=0; grade3=0; grade4=0; grade5=0; grade6=0;
	var sp_text='';var mn_text='<b>And the results are...</b>';
	//specialtext
	if(cowcount>=2)
	{sp_text+='<br /><br />You do have intuition about cows.  In most dimensions cows play politics.  The cows in our world are lazy though.  Lucky for us, because they tend to vote irrationally.';}
	if(vampcount>=2)
	{sp_text+='<br /><br />Despite many rumors, Donald Rumsfeld is not a vampire.  Even in other dimensions.';}
	if(wookcount>=2)
	{sp_text+='<br /><br />You have a sick obsession of Wookies.  Be careful, Wookies smell when someone obsesses about them, much like a bear smells fear or a shark smells blood.  Initially they will be innocently excited to communicate with someone who admires them.  But Wookies get horny quick...';}
	sp_text+='<br /><br />'+keepgrades;
	cowcount=0; vampcount=0; wookcount=0;
	//maintext
	var g1=false; var g2=false; var g3=false; var PUCneed=0;
	if(one>=3){g1=true;}
	if(two>=3){g2=true;}
	if(three>=3){g3=true;}
	if(g1 && g2 && g3){PUCneed=1;}//ADF
	else if(g1 && g2 &&!g3){PUCneed=2;}//AD
	else if(g1 && !g2 && g3){PUCneed=3;}//AF
	else if(g1 && !g2 &&!g3){PUCneed=4;}//A
	else if(!g1 && g2 &&!g3){PUCneed=5;}//D
	else if(!g1 && !g2 && g3){PUCneed=5;}//F dont need 6 yet
	else if(!g1 && g2 && g3){PUCneed=7;}//DF
	else if(!g1 && !g2 &&!g3){PUCneed=8;}//
	switch(PUCneed)
	{
		case 1:
			mn_text='You may be a dimension hopper.  Whether you know it or not, you view other dimensions (at least the close ones) almost as easy as you see ours.  And your "vision" is consistent on all levels.<br /><br />There is a drawback to this.  You may be crazy and you may have several personalities.  And that doll you are hugging… it\'s a dead rat.';
			break;
		case 2:
			mn_text='You do not have a problem seeing other universes at all.  However, you do have trouble distinguishing which world is which.  While taking this quiz I bet you didn\'t bat an eye when you came up to words like "whump-whump", "Andromeda", or "Wookie."  You might not realize that most people don\'t know what those mean.';
		case 3:
			mn_text='You have a decent grasp of other universes (at least the close ones).  However, while you have no problems viewing other dimensions, you cannot feel their energy.  This energy is crucial to understanding the whole of the dimension.  For example, you may be "watching" a party of influential people in a parallel universe, but you can\'t see who is "watching" back.  And maybe there is a Warlock in the room!  You would be screwed.';
			break;
		case 4:
			mn_text='Well, if you are young then this is a good score.  Like seven years old; but if that\'s the case then why are you taking this quiz!<br /><br />Looking into parallel universes is not your thing.  You have control over what you want to see in the universe, though.  So if you, say, wanted to know what your wife is like in another universe, you can try REAL hard and maybe, just maybe, you can get a glimpse.<br /><br />But so what?  Who cares if it\'s not your thing?  Maybe something else is your thing.  Like maybe folding linen is.  Or maybe you\'re good with lumber.';
			break;
		case 5:
			mn_text='OK, you cannot see parallel universes very well.  However, you can spot vibes from another universe.  Like waves in the air, you know when something unworldly is afoot.  For example, you can\'t see thru to the Planet of the Apes dimension, but you can feel a foreign Ape "presence" when it comes onto our turf and takes over a military base or something.<br /><br />But you know what; that is a "glass half full" look.  Really your glass is only a third full.  So don\'t get cocky.';
			break;
		case 7:
			mn_text='Yeah.  You can see other universes.  But you have no control over what you see, when you see it, and whether it gives you a boner or not.  I bet you had many of those embarrassing "come-up-to-the-front-of-the-class" moments in your life.  But don\'t worry, this skill can be taught.  Send Jeff Eblen $2500 via Paypal for his exclusive Parallel Universe Clairvoyance Kit.  It includes ways for you to focus your vision and be able to see only the things that matter.  It\'s like spam-blocker FOR YOUR MIND!';
			break;
		case 8:
			mn_text='No.  You do not have the vision.  You might even think that this whole "parallel universe" thing is a crock of crap.  But that\'s fine; there are many muggles like you.  Only a small percentage of people have true parallel universe clairvoyance.  They tend to become crazy, religious, or artistic.  So I wouldn\'t worry about it if I was you.';
			break;
		default:
			alert('error'+PUCneed);
			break;
	}
	document.getElementById("quiztext").innerHTML ='<div id="quizmidtext"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" style="float:left; width:1px; height:325px; top:0px; left:0px;" />'+mn_text+sp_text+'</div><table width="100%"><tr><td width="33%" style="text-align:center;"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" /></td><td width="33%" style="text-align:center;"><img src="http://www.hoboditty.com/images/spacer.gif" alt="" /></td><td width="33%" style="text-align:center;"><a onclick="startQuiz()">start over</a></td></tr></table>';
}
function backQuestion(quizn,questn)
{
	totalvalues.pop();
	getQuestion(quizn,questn);
}