﻿// rusty.js
// Dimbee "Surrogate CGI" Coding for Rusty Chevrolet quiz v1.00.00; 12/28/2000; last 11/28/2006; © 2000 Dimbee
// v1.00.01 11/28/2006: Fixed small error in output to some browsers due to missing newline character
// v1.00.00 12/28/2000: Original release
// REQUIREMENTS: none

function tally()
{

return rust() + smoke() + heat() + doors() + dash() + pray() + frame() + muffler() + radio() + piston() + held() + steer() + tires() + laugh() + brands() + color();
 
}

// --------------------------------------------------

function rust()
{
var rff=0;
var rrf=0;
var rd=0;
var rbd=0;
var rfb=0;
var rh=0;
var rtb=0;
var rw=0;

if (window.document.tester.rff.checked == true)
	{
	var rff=4
	}

if (window.document.tester.rrf.checked == true)
	{
	var rrf=4
	}

if (window.document.tester.rd.checked == true)
	{
	var rd=5
	}

if (window.document.tester.rbd.checked == true)
	{
	var rbd=4
	}

if (window.document.tester.rfb.checked == true)
	{
	var rfb=6
	}

if (window.document.tester.rh.checked == true)
	{
	var rh=6
	}

if (window.document.tester.rtb.checked == true)
	{
	var rtb=5
	}

if (window.document.tester.rw.checked == true)
	{
	var rw=3
	}

return rff + rrf + rd + rbd + rfb + rh + rtb + rw;

}

// --------------------------------------------------

function smoke()
{
var swhite=0;
var sblue=0;
var sblack=0;
var sgreen=0;

if (window.document.tester.swhite.checked == true)
	{
	var swhite=1
	}

if (window.document.tester.sblue.checked == true)
	{
	var sblue=5
	}

if (window.document.tester.sblack.checked == true)
	{
	var sblack=2
	}

if (window.document.tester.sgreen.checked == true)
	{
	var sgreen=3
	}

return swhite + sblue + sblack + sgreen;

}

// --------------------------------------------------

function heat()
{
var heat=0;

if (window.document.tester.heat.selectedIndex == 1)
	{
	var heat=5
	}

return heat;

}

// --------------------------------------------------

function doors()
{
var drfo=0; 
var drbb=0; 
var drfa=0;

if (window.document.tester.drfo.checked == true)
	{
	var drfo=4
	}

if (window.document.tester.drbb.checked == true)
	{
	var drbb=3
	}

if (window.document.tester.drfa.checked == true)
	{
	var drfa=5
	}

return drfo + drbb + drfa;

}

// --------------------------------------------------

function dash()
{
var dash=0;

if (window.document.tester.dash.selectedIndex == 2)
	{
	var dash=5
	}

return dash;

}

// --------------------------------------------------

function pray()
{
var pray=0;

if (window.document.tester.pray.selectedIndex == 0)
	{
	var pray=5
	}

return pray;

}

// --------------------------------------------------

function frame()
{
var frame=0;

if (window.document.tester.frame.selectedIndex == 0)
	{
	var frame=5
	}

return frame;

}

// --------------------------------------------------

function muffler()
{
var muffler=0;

if (window.document.tester.muffler.selectedIndex == 1)
	{
	var muffler=5
	}
if (window.document.tester.muffler.selectedIndex == 2)
	{
	var muffler=1
	}

return muffler;

}

// --------------------------------------------------

function radio()
{
var radio=0;

if (window.document.tester.radio.selectedIndex == 1)
	{
	var radio=5
	}
if (window.document.tester.radio.selectedIndex == 2)
	{
	var radio=4
	}
if (window.document.tester.radio.selectedIndex == 3)
	{
	var radio=3
	}
if (window.document.tester.radio.selectedIndex == 4)
	{
	var radio=5
	}

return radio;

}

// --------------------------------------------------

function piston()
{
var piston=0;

if (window.document.tester.piston.selectedIndex == 0)
	{
	var piston=5
	}

return piston;

}

// --------------------------------------------------

function held()
{
var heldwire=0;
var helddt=0;
var heldzip=0;
var heldtwn=0;
var heldlck=0;

if (window.document.tester.heldwire.checked == true)
	{
	var heldwire=5
	}

if (window.document.tester.helddt.checked == true)
	{
	var helddt=5
	}

if (window.document.tester.heldzip.checked == true)
	{
	var heldzip=5
	}

if (window.document.tester.heldtwn.checked == true)
	{
	var heldtwn=5
	}

if (window.document.tester.heldlck.checked == true)
	{
	var heldlck=10
	}

return heldwire + helddt + heldzip + heldtwn + heldlck;

}

// --------------------------------------------------

function steer()
{
var steer=0;

if (window.document.tester.steer.selectedIndex == 1)
	{
	var steer=3
	}
if (window.document.tester.steer.selectedIndex == 2)
	{
	var steer=5
	}
if (window.document.tester.steer.selectedIndex == 3)
	{
	var steer=10
	}

return steer;

}

// --------------------------------------------------

function tires()
{
var tires=0;

if (window.document.tester.tires.selectedIndex == 0)
	{
	var tires=5
	}
if (window.document.tester.tires.selectedIndex == 2)
	{
	var tires=3
	}
if (window.document.tester.tires.selectedIndex == 3)
	{
	var tires=2
	}
if (window.document.tester.tires.selectedIndex == 4)
	{
	var tires=3
	}
if (window.document.tester.tires.selectedIndex == 5)
	{
	var tires=1
	}
if (window.document.tester.tires.selectedIndex == 6)
	{
	var tires=4
	}

return tires;

}

// --------------------------------------------------

function laugh()
{
var laugh=0;

if (window.document.tester.laugh.selectedIndex == 0)
	{
	var laugh=5
	}

return laugh;

}

// --------------------------------------------------

function brands()
{
var brands=0;

if (window.document.tester.brands.selectedIndex == 0)
	{
	var brands=10
	}

if (window.document.tester.brands.selectedIndex == 4)
	{
	var brands=10
	}

return brands;

}

// --------------------------------------------------

function color()
{
var cwhite=0;
var cred=0;
var cblue=0;
var cgray=0;
var cblack=0;
var cbrown=0;
var crust=0;
var cprimer=0;
var cgreen=0;
var corange=0;
var cyellow=0;
var cpurple=0;

if (window.document.tester.cwhite.checked == true)
	{
	var cwhite=1
	}

if (window.document.tester.cred.checked == true)
	{
	var cred=1
	}

if (window.document.tester.cblue.checked == true)
	{
	var cblue=1
	}

if (window.document.tester.cgray.checked == true)
	{
	var cgray=1
	}

if (window.document.tester.cblack.checked == true)
	{
	var cblack=1
	}

if (window.document.tester.cbrown.checked == true)
	{
	var cbrown=1
	}

if (window.document.tester.crust.checked == true)
	{
	var crust=5
	}

if (window.document.tester.cprimer.checked == true)
	{
	var cprimer=5
	}
if (window.document.tester.cgreen.checked == true)
	{
	var cgreen=1
	}

if (window.document.tester.corange.checked == true)
	{
	var corange=1
	}

if (window.document.tester.cyellow.checked == true)
	{
	var cyellow=1
	}

if (window.document.tester.cpurple.checked == true)
	{
	var cpurple=1
	}

return cwhite + cred + cblue + cgray + cblack + cbrown + crust + cprimer + cgreen + corange + cyellow + cpurple;

}

// __________________________________________________

function tallybob()
{
window.document.magic_winder.windertext.value=submit()
}

// --------------------------------------------------

function submit()
{
if (window.document.tester.brands.selectedIndex == 0)
	{
	var words=chevy()
	}
else if (window.document.tester.brands.selectedIndex == 1)
	{
	var words=dodge()
	}
else if (window.document.tester.brands.selectedIndex == 2)
	{
	var words=ford()
	}
else if (window.document.tester.brands.selectedIndex == 3)
	{
	var words=german()
	}
else
	{
	var words=foreign()
	}

return words;

}

// --------------------------------------------------

function chevy()
{

var score = tally();

if (score > 172)
	{
	var whatgot="Rusty Chevrolet With Problems Unknown To Man"
	var comment="This vehicle scored higher than the perfect example of a Rusty Chevrolet. Congratulations! You're king of the junkyard!" 
	}
else if (score == 172)
	{
	var whatgot="Perfect Rusty Chevrolet";
	var comment="This vehicle is the final fate of all GM products. This is what they all eventually turn into."
	}
else if (score >= 135)
	{
	var whatgot="Rusty Chevrolet";
	var comment="This vehicle is the standard issue Chevrolet. Fires and explosions are eminent. Chevy: Like a Rock, Sits There and Does Nothin'"
	}
else if (score >= 100)
	{
	var whatgot="Junk Chevrolet";
	var comment="This vehicle still has a little life in it. Sure, it looks ridiculous, but at least there's still some body left on it."
	}
else if (score >= 60)
	{
	var whatgot="Decent Chevrolet";
	var comment="This vehicle has been very lucky, or it is fairly new. Feel proud that you have a Chevy that isn't in pieces.....yet."
	}
else if (score >= 30)
	{
	var whatgot="Good Chevrolet";
	var comment="This vehicle has held together pretty well, or just hasn't been given the chance to have problems."
	}
else
	{
	var whatgot="Showroom Chevrolet";
	var comment="This vehicle is either directly off the factory line, has been kept in a moisture and air tight chamber since being manufactured, or was shot to the present in a time machine immediately after being built. These are the rarest of the rare."
	}

if (window.document.tester.sgreen.checked == true)
	{
	var green = "One thing you really should have looked at is the way it is seemingly burning chlorine. Green smoke?"
	}
else
	{
	var green = ""
	}

if (window.document.tester.radio.selectedIndex == 4)
	{
	var radio = "Also, I have a tip for you. If your radio isn't functioning, try checking the wires before kicking it."
	}
else
	{
	var radio = ""
	}

return "**************************************************\nYour Score is " + score + ". Status: " + whatgot + "- " + comment + " " + green + " " + radio;

}

// --------------------------------------------------

function ford()
{

var score = tally();

if (score >= 162)
	{
	var whatgot="Sure it ain't a Chevy?";
	var comment="This Vehicle seems to exhibit many of the characteristics of a Chevrolet. Perhaps when it was fairly new, some evil mechanic put GM parts on it."
	}
else if (score >= 125)
	{
	var whatgot="Hard Lifed Ford";
	var comment="This vehicle is an example of what happens to a Ford when it has been wrecked, rolled, and abused repeatedly. It still runs though!"
	}
else if (score >= 90)
	{
	var whatgot="Farmin' Ford";
	var comment="This vehicle is barely street legal anymore, but it's perfect for a bad ass farm vehicle."
	}
else if (score >= 50)
	{
	var whatgot="Great Ford";
	var comment="This vehicle is a well aged Ford. It'll sit wide open all day with no trouble and get ya where ya need to be, while still lookin pretty good."
	}
else if (score >= 20)
	{
	var whatgot="Sweet Ford";
	var comment="This vehicle is great for haulin' and for cruisin'. It runs and looks great. Often, these are given custom exhausts that make 'em sound as good as they look."
	}
else
	{
	var whatgot="Showroom Ford";
	var comment="This vehicle is a very beautiful thing. A Showroom Ford looks and runs as good as, or better than new. I wish I had one....."
	}

if (window.document.tester.sgreen.checked == true)
	{
	var green = "One thing you really should have looked at is the way it is seemingly burning chlorine. Green smoke?"
	}
else
	{
	var green = ""
	}

if (window.document.tester.radio.selectedIndex == 4)
	{
	var radio = "Also, I have a tip for you. If your radio isn't functioning, try checking the wires before kicking it."
	}
else
	{
	var radio = ""
	}

return "**************************************************\nYour Score is " + score + ". Status: " + whatgot + "- " + comment + " " + green + " " + radio;

}

// --------------------------------------------------

function dodge()
{

var score = tally();

if (score >= 162)	
	{
	var whatgot="Ready For Compacting";
	var comment="This vehicle is done. I'd say stick a fork in it, but it would probably rupture something and cause it to explode."
	}
else if (score >= 90)
	{
	var whatgot="Old Junk Dodge";
	var comment="This vehicle is a half decent farm truck.....if it runs. It should have a little more life in it, but it won't be long before it's ready for the compactor."
	}
else if (score >= 50)
	{
	var whatgot="Hot Rod's Lot Dodge";
	var comment="This vehicle is similar to the kind you would find on Hot Rod's used car lot. It looks ok, but soon stuff will start falling off, if it hasn't already. He'll give you a good price on trade in though."
	}
else if (score >= 20)
	{
	var whatgot="Good Dodge";
	var comment="This vehicle is actually in pretty good shape. It runs good, looks good...hell, it may even last a while!"
	}
else
	{
	var whatgot="Showroom Dodge";
	var comment="This vehicle is as perfect as Dodges come. It looks and runs near perfect. This vehicle probably hasn't seen a whole lot of road time."
	}

if (window.document.tester.sgreen.checked == true)
	{
	var green = "One thing you really should have looked at is the way it is seemingly burning chlorine. Green smoke?"
	}
else
	{
	var green = ""
	}

if (window.document.tester.radio.selectedIndex == 4)
	{
	var radio = "Also, I have a tip for you. If your radio isn't functioning, try checking the wires before kicking it."
	}
else
	{
	var radio = ""
	}

return "**************************************************\nYour Score is " + score + ". Status: " + whatgot + "- " + comment + " " + green + " " + radio;

}

// --------------------------------------------------

function german()
{

var score = tally();

if (score >= 150)
	{
	var whatgot="D-Day Nazi Wagon";
	var comment="This vehicle is like one of Hitler's boys on D-Day, still kickin', but not for long."
	}
else
	{
	var whatgot="Invincible Nazi Wagon";
	var comment="Watch out Frenchies! Here comes the Nazi wagon! This vehicle is near invincible. These beasts run for a long time!"
	}

if (window.document.tester.sgreen.checked == true)
	{
	var green = "One thing you really should have looked at is the way it is seemingly burning chlorine. You may have also gotten some sauerkraut on the manifold. Green smoke?"
	}
else
	{
	var green = ""
	}

if (window.document.tester.radio.selectedIndex == 4)
	{
	var radio = "Also, I have a tip for you. If your radio isn't functioning, try checking the wires before kicking it."
	}
else
	{
	var radio = ""
	}

return "**************************************************\nYour Score is " + score + ". Status: " + whatgot + "- " + comment + " " + green + " " + radio;

}

// --------------------------------------------------

function foreign()
{

var score = tally();

if (score >= 100)
	{
	var whatgot="Rusty, Flaming Foreign Junk";
	var comment="Put it on a catapult and send it back!"
	}
else
	{
	var whatgot="Foreign Junk";
	var comment="These make excellent urinals and one time use burning barrels. If you actually want to DRIVE it, I hope you're tiny. You could always use it as a golf cart if the clubs don't weigh it down. Perhaps you could carry it around in the back for a spare."
	}

if (window.document.tester.sgreen.checked == true)
	{
	var green = "One thing I hate about those riceburners is how they put off green smoke!"
	}
else
	{
	var green = ""
	}

if (window.document.tester.radio.selectedIndex == 4)
	{
	var radio = "As for the boot mark on the radio, I'd kick it too if it was speakin' some retarded foreigner talk!"
	}
else
	{
	var radio = ""
	}

return "**************************************************\nYour Score is " + score + ". Status: " + whatgot + "- " + comment + " " + green + " " + radio;

}

// __________________________________________________

function tasty()
{
clear()
}

// --------------------------------------------------


function clear()
{
window.document.tester.rff.checked = false;
window.document.tester.rrf.checked = false;
window.document.tester.rd.checked = false;
window.document.tester.rbd.checked = false;
window.document.tester.rfb.checked = false;
window.document.tester.rh.checked = false;
window.document.tester.rtb.checked = false;
window.document.tester.rw.checked = false;
window.document.tester.swhite.checked = false;
window.document.tester.sblue.checked = false;
window.document.tester.sblack.checked = false;
window.document.tester.sgreen.checked = false;
window.document.tester.heat.selectedIndex = 0;
window.document.tester.drfo.checked = false;
window.document.tester.drbb.checked = false;
window.document.tester.drfa.checked = false;
window.document.tester.dash.selectedIndex = 0;
window.document.tester.pray.selectedIndex = 0;
window.document.tester.frame.selectedIndex = 0;
window.document.tester.muffler.selectedIndex = 0;
window.document.tester.radio.selectedIndex = 0;
window.document.tester.piston.selectedIndex = 0;
window.document.tester.heldwire.checked = false;
window.document.tester.helddt.checked = false;
window.document.tester.heldzip.checked = false;
window.document.tester.heldtwn.checked = false;
window.document.tester.heldlck.checked = false;
window.document.tester.steer.selectedIndex = 0;
window.document.tester.tires.selectedIndex = 0;
window.document.tester.laugh.selectedIndex = 0;
window.document.tester.brands.selectedIndex = 0;
window.document.tester.cwhite.checked = false;
window.document.tester.cred.checked = false;
window.document.tester.cblue.checked = false;
window.document.tester.cgray.checked = false;
window.document.tester.cblack.checked = false;
window.document.tester.cbrown.checked = false;
window.document.tester.crust.checked = false;
window.document.tester.cprimer.checked = false;
window.document.tester.cgreen.checked = false;
window.document.tester.corange.checked = false;
window.document.tester.cyellow.checked = false;
window.document.tester.cpurple.checked = false;
window.document.tester.heldoem.checked = false;
window.document.tester.cchrome.checked = false;
window.document.magic_winder.windertext.value="**************************************************\nHello moron. Had a little bit of trouble did ya? Let me simplify: You clicky thingies, makie tell what your vroom vroom likey. Then clicky linky that say you is done. Understand Mr. Bush?"
}
