// JavaScript Document
score=0;

function scorer(bit1,bit2,bit3,bit4,bit5,bit6) {
var objRef = document.getElementById(bit1);
var objRef2 = shrinker(objRef.value);
var objRef3 = filterNum(objRef2);

var x=1;
while (x>0) {
var objRef2 = objRef3;
objRef3 = filterNum(objRef3);
if(objRef2==objRef3) {
x=0;
}
}


if (objRef2==bit2 || objRef2==bit3 || objRef2==bit4 || objRef2==bit5 || objRef2==bit6){
objRef.style.background="#B7683D";
objRef.style.color="#DEB67B";
score++;
}
else
{
objRef.style.background="#ffffff";
objRef.style.color="#000000";
}

}


function shrinker(obbit) {
var obbit2 = obbit.toLowerCase();
return obbit2;
}



function filterNum(str) {
re = " ";
return str.replace(re, "");
}


//you cheating swine!

function scorer2() {
score=0;
scorer('quest1','pat','postmanpat','postmanpatandjess','patandjess','postmanpatt');
scorer('quest2','turtles','teenagemutantheroturtles','teenagemutantninjaturtles','tmnt','tmht');
scorer('quest3','bagpuss','bagpus','bagpussandfriends','emilyscatbagpuss','poobum');
scorer('quest4','spongebob','spongebobsquarepants','spongbobsquarepants','spongebobsquarpants','poobum');
scorer('quest5','starwars','returnofthejedi','starwarsanewhope','theempirestrikesback','thephantommenace');
scorer('quest6','billandben','billben','theflowerpotmen','billandbentheflowerpotmen','flowerpotmen');
scorer('quest7','simpsons','thesimpsons','simsons','thesimsons','arsecakes');
scorer('quest8','spiderman','thespiderman','spidermanthemovie','spiderman2','spidermantwo');
scorer('quest9','noddy','noddyandbigears','bigearsandnoddy','enidblyton','noddytheclown');
scorer('quest10','mrmen','themrmen','mrmenandlittlemiss','mrandmrs','mistermen');

}


function whom() {
score=0;
scorer('quest1','pat','postmanpat','postmanpatandjess','patandjess','postmanpatt');
scorer('quest2','turtles','teenagemutantheroturtles','teenagemutantninjaturtles','tmnt','tmht');
scorer('quest3','bagpuss','bagpus','bagpussandfriends','emilyscatbagpuss','poobum');
scorer('quest4','spongebob','spongebobsquarepants','spongbobsquarepants','spongebobsquarpants','poobum');
scorer('quest5','starwars','returnofthejedi','starwarsanewhope','theempirestrikesback','thephantommenace');
scorer('quest6','billandben','billben','theflowerpotmen','billandbentheflowerpotmen','flowerpotmen');
scorer('quest7','simpsons','thesimpsons','simsons','thesimsons','arsecakes');
scorer('quest8','spiderman','thespiderman','spidermanthemovie','spiderman2','spidermantwo');
scorer('quest9','noddy','noddyandbigears','bigearsandnoddy','enidblyton','noddytheclown');
scorer('quest10','mrmen','themrmen','mrmenandlittlemiss','mrandmrs','mistermen');
if (score<10) {
alert ("You haven't got them all right yet... you cheating swine.");
}

}


function scorer3() {
score=0;
scorer('quest1','pat','postmanpat','postmanpatandjess','patandjess','postmanpatt');
scorer('quest2','turtles','teenagemutantheroturtles','teenagemutantninjaturtles','tmnt','tmht');
scorer('quest3','bagpuss','bagpus','bagpussandfriends','emilyscatbagpuss','poobum');
scorer('quest4','spongebob','spongebobsquarepants','spongbobsquarepants','spongebobsquarpants','poobum');
scorer('quest5','starwars','returnofthejedi','starwarsanewhope','theempirestrikesback','thephantommenace');
scorer('quest6','billandben','billben','theflowerpotmen','billandbentheflowerpotmen','flowerpotmen');
scorer('quest7','simpsons','thesimpsons','simsons','thesimsons','arsecakes');
scorer('quest8','spiderman','thespiderman','spidermanthemovie','spiderman2','spidermantwo');
scorer('quest9','noddy','noddyandbigears','bigearsandnoddy','enidblyton','noddytheclown');
scorer('quest10','mrmen','themrmen','mrmenandlittlemiss','mrandmrs','mistermen');
if (score==0) {
alert("0/10\n Invisible Man tomato soup.");
}
if (score==1) {
alert("1/10\n Netto's homebrand Quincy shapes... in tomato sauce coloured water");
}
if (score==2) {
alert("2/10\n Morrison's homebrand Gaz Top pasta shapes... in tomato juice.. sell by date 1987.");
}
if (score==3) {
alert("3/10\n Tesco Value Juliet Bravo truncheon, helmet and smile pasta shapes... in tomato sauce.");
}
if (score==4) {
alert("4/10\n Spider, shark and dinosaur deadly animal shapes... in tomato sauce");
}
if (score==5) {
alert("5/10\n Crimewatch telephone, knife and helmet shapes... in tomato sauce");
}
if (score==6) {
alert("6/10\n Voice of the mysterons hoops... in tomato sauce");
}
if (score==7) {
alert("7/10\n Really Wild Show monkey,kitten and panda shapes... in tomato sauce");
}
if (score==8) {
alert("8/10\n Alphagettiswearogetti pasta letters containing only the FCNKTU letters for swearing ease... in tomato sauce");
}
if (score==9) {
alert("9/10\n Flash Gordon pasta shapes including a realistic smelling Brian Blessed... in tomato sauce.");
}
if (score==10) {
alert("10/10\n MC Escher's impossible shapes in tomato sauce.\n Congratulations!\n Unless you cheated...");
}
answers();
}

function answers() {
document.getElementById('quest1').value="Postman Pat";
document.getElementById('quest2').value="Teenage Mutant Ninja Turtles";
document.getElementById('quest3').value="Bagpuss";
document.getElementById('quest4').value="Spongebob Squarepants";
document.getElementById('quest5').value="Starwars";
document.getElementById('quest6').value="Bill and Ben";
document.getElementById('quest7').value="The Simpsons";
document.getElementById('quest8').value="Spiderman";
document.getElementById('quest9').value="Noddy";
document.getElementById('quest10').value="Mr Men";

document.getElementById('quest1').style.background="#CC3300";
document.getElementById('quest2').style.background="#CC3300";
document.getElementById('quest3').style.background="#CC3300";
document.getElementById('quest4').style.background="#CC3300";
document.getElementById('quest5').style.background="#CC3300";
document.getElementById('quest6').style.background="#CC3300";
document.getElementById('quest7').style.background="#CC3300";
document.getElementById('quest8').style.background="#CC3300";
document.getElementById('quest9').style.background="#CC3300";
document.getElementById('quest10').style.background="#CC3300";

document.getElementById('quest1').style.color="#FFFFFF";
document.getElementById('quest2').style.color="#FFFFFF";
document.getElementById('quest3').style.color="#FFFFFF";
document.getElementById('quest4').style.color="#FFFFFF";
document.getElementById('quest5').style.color="#FFFFFF";
document.getElementById('quest6').style.color="#FFFFFF";
document.getElementById('quest7').style.color="#FFFFFF";
document.getElementById('quest8').style.color="#FFFFFF";
document.getElementById('quest9').style.color="#FFFFFF";
document.getElementById('quest10').style.color="#FFFFFF";
}