<!doctype html>
<html>
<head>
<title>Clairvoyance Test - RJM Programming - December, 2015</title>
<link href='//www.rjmprogramming.com.au/PHP/emboss_h1.css' rel='stylesheet' type='text/css'>
<script type="text/javascript">
var userip="localhost";
</script>
<!--script title="Thanks to http://l2.io/" type="text/javascript" src="https://l2.io/ip.js?var=userip"></script-->
<script type='text/javascript'>
var goodname='';
var firstgo=true;
var prefix="Regarding our Clairvoyance Test of 9 cards amongst cross, star, wavy, round, box ... ";
var nomore='';
var computedStyle=null; // = getComputedStyle(document.body, null)
var bh=800; //computedStyle.height;
var bw=900; //computedStyle.width;
var hsuff="%";
var wsuff="%";
var hp="25";
var wp="33";
var cards=['c', 's', 'w', 'r', 'b'];
var cardurls=['crosscard.jpg', 'starcard.jpg', 'wavycard.jpg', 'circlecard.jpg', 'squarecard.jpg'];
var mapping=['id11', 'id12', 'id13', 'id21', 'id22', 'id23', 'id31', 'id32', 'id33'];
var score=0;
var goes=0;
var mgo=0;
function detectmob() { // thanks to http://stackoverflow.com/questions/11381673/detecting-a-mobile-browser
if( navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)
){
mgo=1;
return true;
}
else {
mgo=-1;
return false;
}
}
function doclick() {
var oaid=document.getElementById('aid');
if (oaid != null) {
if (oaid.href.indexOf('?') != -1) {
oaid.href=oaid.href.replace('?', '?isMobile=y&');
} else if (oaid.href.indexOf('isMobile=') == -1) {
//oaid.href+='.html?isMobile=y';
oaid.href=oaid.href.replace('.html', '.html?isMobile=y');
if (oaid.href.indexOf('isMobile=') == -1) oaid.href=oaid.href.replace('.htm', '.htm?isMobile=y');
}
oaid.click();
}
}
function ask(thisg, tn) {
var vmgo=mgo;
if (mgo == 0) detectmob();
if (nomore != 'y') {
var huh=null;
var icard=Math.floor(Math.random() * cards.length) + 0;
var ccard=cards[icard];
var oaid=document.getElementById('aid');
while (huh == null || huh == '') {
if (document.URL.indexOf('isMobile=') == -1 && firstgo && vmgo == 0 && mgo == 1 && oaid == null) {
nomore='y';
firstgo=false;
andthen();
setTimeout(doclick,1000);
return;
} else {
if (prefix != '') {
huh=prompt(prefix + "What is this card (" + tn + " of 9) from C(ross), S(tar), W(avy), R(ound), B(ox) ?", "");
} else {
huh=prompt(prefix + "What is this card (" + tn + " of 9) from C(ross), S(tar), W(avy), R(ound), B(ox) ?", "");
}
}
if (huh != null) {
if ((huh + ' ').toLowerCase().substring(0,1) != 'c' && (huh + ' ').toLowerCase().substring(0,1) != 's' && (huh + ' ').toLowerCase().substring(0,1) != 'w' && (huh + ' ').toLowerCase().substring(0,1) != 'r' && (huh + ' ').toLowerCase().substring(0,1) != 'b') {
huh='';
}
} else if (firstgo) {
nomore='y';
firstgo=false;
return;
}
}
prefix="";
if (huh == null) {
huh='';
nomore='y';
}
}
//alert('tn=' + tn + ' ccard=' + ccard);
document.getElementById(mapping[eval(-1 + tn)]).src=cardurls[icard];
if ((huh + ' ').toLowerCase().substring(0,1) == cards[icard]) {
score++;
goes++;
} else {
goes++;
}
document.getElementById('score').innerHTML = 'Score: ' + score + ' Goes: ' + goes + ' ... Average Odds Score: ' + eval(goes / 5) + ' ... Your Clairvoyance Score: ' + score;
//}
}
function getme(thiscell) {
var numcell=thiscell.replace('td','');
var oldidea='td' + numcell + '_' + userip + '.html';
goodname = 'cell' + numcell + "_" + userip;
//alert(document.cookie + ' ... ' + goodname + ' --- ' + goodurl);
var otn=eval(numcell % 10) + eval(eval(eval((numcell - eval(numcell % 10)) / 10) * 3) - 3);
ask(goodname, otn);
if (numcell == 33) setTimeout(andthen, 3000);
firstgo=false;
return '';
}
function andthen() {
if (mgo == 1) {
document.getElementById('myh1').innerHTML+=" ... <a id='aid' title=Again href=\"" + document.URL + "\">Another Test</a>";
} else {
document.getElementById('myh1').innerHTML+=" ... <a id='aid' title=Again onclick=\" location.href='" + document.URL + "'; \" href='#'>Another Test</a>";
}
}
</script>
</head>
<body style="background-color: yellow;background: url('clairvoyance.jpg') repeat;background-position:10px 200px; ">
<div id='dback' style="display:none;z-index:5;position:absolute;top:0;left:0;opacity:0.1;width:100%;height:100%;background: url('clairvoyance.jpg') repeat;background-position:10px 200px; ">
</div>
<div id='dmain' align='center' style='z-index:2;position:absolute;top:0;left:0;opacity:1.0;width:100%;height:800px;'>
<h1 id='myh1' align='center' style="font-size:36px;color:red;opacity:1.0;">Clairvoyance Test</h1><br>
<h1 align='center' style="font-size:36px;color:red;opacity:1.0;" id='score'></h1>
<table id="mytable" style="background-color:white;opacity:1.0; border: 125px solid white;" align='center'>
<tbody style="opacity:1.0;">
<tr>
<td id='td11'><img id='id11' src='blankcard.jpg' /><script> document.write(getme('td11')); </script></td><td id='td12'><img id='id12' src='blankcard.jpg' /><script> document.write(getme('td12')); </script></td><td id='td13'><img id='id13' src='blankcard.jpg' /><script> document.write(getme('td13')); </script></td>
</tr>
<tr>
<td id='td21'><img id='id21' src='blankcard.jpg' /><script> document.write(getme('td21')); </script></td><td id='td22'><img id='id22' src='blankcard.jpg' /><script> document.write(getme('td22')); </script></td><td id='td23'><img id='id23' src='blankcard.jpg' /><script> document.write(getme('td23')); </script></td>
</tr>
<tr>
<td id='td31'><img id='id31' src='blankcard.jpg' /><script> document.write(getme('td31')); </script></td><td id='td32'><img id='id32' src='blankcard.jpg' /><script> document.write(getme('td32')); </script></td><td id='td33'><img id='id33' src='blankcard.jpg' /><script> document.write(getme('td33')); </script></td>
</tr>
</tbody>
</table>
<br><br>
<div id='aatend'></div>
</div>
<!--/div-->
</body>
</html>