<!--

superman = new Image
superman.src = "assets/images/doppelme/superman.gif"

gandalf = new Image
gandalf.src = "assets/images/doppelme/gandalf.gif"

doctor = new Image
doctor.src = "assets/images/doppelme/doctor.gif"

librarian = new Image
librarian.src = "assets/images/doppelme/librarian.gif"

hippy = new Image
hippy.src = "assets/images/doppelme/hippy.gif"

teenager = new Image
teenager.src = "assets/images/doppelme/teenager.gif"

hooligan = new Image
hooligan.src = "assets/images/doppelme/hooligan.gif"

stormtrooper = new Image
stormtrooper.src = "assets/images/doppelme/stormtrooper.gif"

televangelist = new Image
televangelist.src = "assets/images/doppelme/televangelist.gif"

motobikegang = new Image
motobikegang.src = "assets/images/doppelme/motobikegang.gif"

pirate = new Image
pirate.src = "assets/images/doppelme/pirate.gif"

gangster = new Image
gangster.src = "assets/images/doppelme/gangster.gif"

hitman = new Image
hitman.src = "assets/images/doppelme/hitman.gif"

jason = new Image
jason.src = "assets/images/doppelme/jason.gif"

satan = new Image
satan.src = "assets/images/doppelme/satan.gif"

exwife = new Image
exwife.src = "assets/images/doppelme/exwife.gif"

var imageSet = "doppelMe";


var prob_fraud = [
{n: 'design',          v:.05},
{n: 'spelling',       v:.05},
{n: 'cell',         v:.10},
{n: 'counterfeit',       v:.75},
{n: 'replica',       v:.50},
{n: 'toogood',        v:.30},
{n: 'ebay',       v:.20},
{n: 'auctiononly',       v:.10},
{n: 'webname',         v:.20},
{n: 'reg_old',         	v:.10},
{n: 'reg_new',          v:.15},
{n: 'reg_short',        v:.10},
{n: 'reg_address',      v:.15},
{n: 'reg_phone',     v:.30},
{n: 'reg_email',     v:.05},
{n: 'creditnone',     v:.30},
{n: 'creditlocal',     v:.75},
{n: 'moneyorder',        v:.40},
{n: 'creditorder',    v:.30},
{n: 'customs',    v:.75},
{n: 'payment',    v:.25},
{n: 'fakeshipping',    v:.75},
{n: 'documents',     v:.20},
{n: 'google',        v:.50},
{n: 'localadmin', 	v:.40},
{n: 'highquality',    v:.15},
{n: 'nopaypal',    v:.30},
{n: 'ignoreIM',    v:.75},
{n: 'competitionscam',    v:.55},
{n: 'largerquantity',    v:.25}
 ];


var xmsg = [
{x: 0, d: 'The same scams, with mostly minor variations, keep circulating year after year. They were scams last year, and they\'re still scams this year.'},
{x: 0, d: 'Many of these scams orginate in China, where corruption and disinterested Law Enforcement means that fraudsters are unlikely to be prosecuted'},
{x: 0, d: 'West African scammers have emigrated to other cities, but continue to run their scams'},
{x: 0, d: 'Money is often the bait that scammers use to lure their prey'},
{x: 0, d: 'Because scammers\'s email accounts are often closed down quickly, they don\'t want to pay for them. So they make extensive use of free email accounts'} ];


	var odds = [
	{v: 1e14,        d: 'IMPOSSIBLE'},
	{v: 10000000000, d: 'being killed by space debris'},
	{v:  5000000000, d: 'you living to be 116'},
	{v:  2000000000, d: 'asteroid impact causing global disaster this year'},
	{v:    95980407, d: 'you dying from a venomous snake or lizard bite this year'},
	{v:    25000000, d: 'you being killed by lightning this year'},
	{v:     4362746, d: 'winning the Lottery this week from a two-draw slip'},
	{v:     3529526, d: 'drawing a royal flush in spades in a five-card poker draw'},
	{v:     3000000, d: 'you being killed by freezing'},
	{v:     2598960, d: 'you being struck by lightning this year'},
	{v:     2000000, d: 'you being killed by lightning'},
	{v:     1110878, d: 'you dying in a deliberately lit fire this year'},
	{v:     1000000, d: 'you dying in a bath tub'},
	{v:      700000, d: 'you being killed by a dog'},
	{v:      280000, d: 'an asteroid impact causing regional disaster this year'},
	{v:      132553, d: 'you picking all 4 aces from a deck of cards'},
	{v:      100000, d: 'you dying in a fire this year'},
	{v:       91149, d: 'you being killed by poisoning'},
	{v:       86000, d: 'you being murdered'},
	{v:       20000, d: 'you being injured in a fire this year'},
	{v:        5000, d: 'you being killed in a car crash'},
	{v:         541, d: 'your next child being triplets'},
	{v:         142, d: 'you being drunk right now'},
	{v:          25, d: 'you being a vegetarian'},
	{v:          52, d: 'picking the Ace of Spades from a deck of cards'},
	{v:          15, d: 'the world being at peace right now'},
	{v:          13, d: 'picking an ace from a deck of cards'},
	{v:           7, d: 'you being left-handed'},
	{v:           6, d: 'a sunny day in Seattle'},
	{v:           3, d: 'you being at least 20% overweight'},
	{v:           2, d: 'guessing a coin toss'},
	{v:           1, d: 'you being right-handed'}  ];

	
//The help text scripts, 
function hideHelp(targetDivName)
{
	document.getElementById(targetDivName).className = 'hidden';


}

function showHelp(targetDivName)
{
	document.getElementById(targetDivName).className = 'visible';

}


function showImages(targetDivName)
{
	document.getElementById(targetDivName).className = 'visible';
	imageSet = targetDivName;
	checkit();
}

function hideImages(targetDivName)
{
	document.getElementById(targetDivName).className = 'hidden';
}


// This is the check script
function checkit()
{

	// Calculate probability that this is legit.
	var legit = 1.0;
	var box_checked;
	// See what checkboxes are checked.
	for (i=0; i < prob_fraud.length; i++) {
		box_checked = eval("document.checklist."+prob_fraud[i].n+".checked");
		if (box_checked) {
			legit *= (1 - prob_fraud[i].v);		
		}
	}

	// Get value of the 'Country' select box.
		if (document.checklist.country.selectedIndex != 0) {
			if (document.checklist.country.value == "cn")
			{
				legit *= 0.80;
			}
			if (document.checklist.country.value == "hk")
			{
				legit *= 0.90;
			}
			if (document.checklist.country.value == "in")
			{
				legit *= 0.85;
			}
			if (document.checklist.country.value == "jp")
			{
				legit *= 0.95;
			}
			if (document.checklist.country.value == "ph")
			{
				legit *= 0.87;
			}
			if (document.checklist.country.value == "sg")
			{
				legit *= 0.95;
			}
			if (document.checklist.country.value == "")
			{
				legit *= 0.95;
			}
		}

	

	if (legit == 0) {
		legit = 1e12;
	} else {
		legit = (1.0/legit);
		legit = legit.toFixed(0);
	}
	
    document.checklist.txt_odds.value = legit;

	// Write result to the textarea.
	for (i=0; i < odds.length; i++) {
		if (legit > odds[i].v) {
		    document.checklist.txt_event.value = odds[i].d;
		    document.checklist.txt_evodds.value = odds[i].v;
			break;
		}
	}

	if (imageSet == "doppelMe") {
		if (document.checklist.txt_odds.value < 2)   {
			document.doppelMeImage.src = "assets/images/doppelme/superman.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "Super Man";
		}
		if (document.checklist.txt_odds.value >= 2 && document.checklist.txt_odds.value < 5)   {
			document.doppelMeImage.src = "assets/images/doppelme/gandalf.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "Gandalf the Grey";
		}
		if (document.checklist.txt_odds.value >= 5 && document.checklist.txt_odds.value < 10)   {
			document.doppelMeImage.src = "assets/images/doppelme/doctor.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "The family Doctor";
		}
		if (document.checklist.txt_odds.value >= 10 && document.checklist.txt_odds.value < 15)   {
			document.doppelMeImage.src = "assets/images/doppelme/librarian.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "The local Librarian";
		}
		if (document.checklist.txt_odds.value >=15 && document.checklist.txt_odds.value < 20)   {
			document.doppelMeImage.src = "assets/images/doppelme/hippy.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "A stoned out Hippy....far out man";
		}
		if (document.checklist.txt_odds.value >= 25 && document.checklist.txt_odds.value < 50)   {
			document.doppelMeImage.src = "assets/images/doppelme/teenager.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "A Teenager";
		}
		if (document.checklist.txt_odds.value >= 50 && document.checklist.txt_odds.value < 75)   {
			document.doppelMeImage.src = "assets/images/doppelme/hooligan.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "A Football Hooligan";
		}
		if (document.checklist.txt_odds.value >= 75 && document.checklist.txt_odds.value < 1000)   {
			document.doppelMeImage.src = "assets/images/doppelme/stormtrooper.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "A Stormtrooper";
		}
		if (document.checklist.txt_odds.value >= 1000 && document.checklist.txt_odds.value < 2000)   {
			document.doppelMeImage.src = "assets/images/doppelme/televangelist.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "A Televangelist";
		}
		if (document.checklist.txt_odds.value >= 2000 && document.checklist.txt_odds.value < 4000)   {
			document.doppelMeImage.src = "assets/images/doppelme/motobikegang.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "A MotorCycle Gang Member";
		}
		if (document.checklist.txt_odds.value >= 4000 && document.checklist.txt_odds.value < 7000)   {
			document.doppelMeImage.src = "assets/images/doppelme/pirate.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "A Pirate, and no, not Johnny Depp";
		}
		if (document.checklist.txt_odds.value >=7000 && document.checklist.txt_odds.value < 15000)   {
			document.doppelMeImage.src = "assets/images/doppelme/gangster.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "A Mafia Boss";
		}
		if (document.checklist.txt_odds.value >= 15000 && document.checklist.txt_odds.value < 30000)   {
			document.doppelMeImage.src = "assets/images/doppelme/hitman.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "The Mafia Bosses Hitman";
		}
		if (document.checklist.txt_odds.value >= 30000 && document.checklist.txt_odds.value < 150000)   {
			document.doppelMeImage.src = "assets/images/doppelme/jason.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "Jason";
		}
		if (document.checklist.txt_odds.value >=150000 && document.checklist.txt_odds.value < 400000)   {
			document.doppelMeImage.src = "assets/images/doppelme/satan.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "Satan - Lord of Darkness";
		}
		if (document.checklist.txt_odds.value >=400000 && document.checklist.txt_odds.value < 250000000)   {
			document.doppelMeImage.src = "assets/images/doppelme/exwife.gif";
			document.getElementById('doppelText').firstChild.nodeValue = "My Ex Wife";
		}
	}
	
	if (imageSet == "shinySmileys") {
		if (document.checklist.txt_odds.value < 5)   {
			document.shinySmileyImage.src = "assets/images/shinySmileys/cha-ching.png";
			document.getElementById('smileyText').firstChild.nodeValue = "So you could think this site will save or make you some money";
		}
		if (document.checklist.txt_odds.value >= 5 && document.checklist.txt_odds.value < 10)   {
			document.shinySmileyImage.src = "assets/images/shinySmileys/grin.png";
			document.getElementById('smileyText').firstChild.nodeValue = "Still grinning I see, maybe this website is A-OK";
		}
		if (document.checklist.txt_odds.value >= 10 && document.checklist.txt_odds.value < 15)   {
			document.shinySmileyImage.src = "assets/images/shinySmileys/happy.png";
			document.getElementById('smileyText').firstChild.nodeValue = "A bit of a smile, maybe this website is B-OK";
		}
		if (document.checklist.txt_odds.value >= 15 && document.checklist.txt_odds.value < 25)   {
			document.shinySmileyImage.src = "assets/images/shinySmileys/hmm.png";
			document.getElementById('smileyText').firstChild.nodeValue = "Hmmm ?";
		}
		if (document.checklist.txt_odds.value >=25 && document.checklist.txt_odds.value < 50)   {
			document.shinySmileyImage.src = "assets/images/shinySmileys/nervous.png";
			document.getElementById('smileyText').firstChild.nodeValue = "Feeling nervous yet...you seem to be clicking quite a few options to get this far";
		}
		if (document.checklist.txt_odds.value >= 50 && document.checklist.txt_odds.value < 1000)   {
			document.shinySmileyImage.src = "assets/images/shinySmileys/surprise.png";
			document.getElementById('smileyText').firstChild.nodeValue = "Maybe you are feeling a bit surprised about how bad things are getting";
		}
		if (document.checklist.txt_odds.value >= 1000 && document.checklist.txt_odds.value < 2000)   {
			document.shinySmileyImage.src = "assets/images/shinySmileys/angry.png";
			document.getElementById('smileyText').firstChild.nodeValue = "Save me Tom Cruise!";
		}
		if (document.checklist.txt_odds.value >= 2000 && document.checklist.txt_odds.value < 3000)   {
			document.shinySmileyImage.src = "assets/images/shinySmileys/sad.png";
			document.getElementById('smileyText').firstChild.nodeValue = "This is beginning to look a little tragic";
		}
		if (document.checklist.txt_odds.value >= 3000 && document.checklist.txt_odds.value < 50000)   {
			document.shinySmileyImage.src = "assets/images/shiny-smileys/shame.png";
			document.getElementById('smileyText').firstChild.nodeValue = "Shame on you for clicking this many options!";
		}
		if (document.checklist.txt_odds.value >=50000 && document.checklist.txt_odds.value < 250000000)   {
			document.shinySmileyImage.src = "assets/images/shinySmileys/weepy.png";
			document.getElementById('smileyText').firstChild.nodeValue = "Go on and just cry me a river.  Justin Timberlake, 2002";
		}
	}

	if (imageSet == "doom") {
		if (document.checklist.txt_odds.value < 5)   {
			document.doomimage.src = "assets/images/doom/100health.gif";
		}
		if (document.checklist.txt_odds.value >= 5 && document.checklist.txt_odds.value < 20)   {
			document.doomimage.src = "assets/images/doom/75health.gif";
		}
		if (document.checklist.txt_odds.value >= 20 && document.checklist.txt_odds.value < 50)   {
			document.doomimage.src = "assets/images/doom/50health.gif";
		}
		if (document.checklist.txt_odds.value >=50 && document.checklist.txt_odds.value < 1000)   {
			document.doomimage.src = "assets/images/doom/25health.gif";
		}
		if (document.checklist.txt_odds.value >=1000 && document.checklist.txt_odds.value < 250000000)   {
			document.doomimage.src = "assets/images/doom/1health.gif";
		}
	}

}

// -->

