// JavaScript Document
ctr=0;
/* Put the title of your test here, just
   as you want it to appear on screen. */
ttl="Downtown Dragons Quiz Game 2";

/* Now, what is a perfect score? Although
   it will usually be 100, you can alter 
   it if you wish. However, it may not
   exceed 999 and must be a whole number. */
psco=100;

/* Deduction for each wrong answer. May
   be the perfect score divided by the
   number of questions.  But if you "weight"
   wrong answers, as we have done in this
   little demo script, it may be higher,
   but must be a whole number.  */
wrans=10;

/* Deduction for each "no answer". Usually
   this will be the simple arithmetical
   perfect score divided by number of
   questions. (A whole number) However,
   again, you are in charge. */
noans=10;

/* Change "nr" below to be equal to the
   number of questions you have on this
   test. (Our demo has 5 questions) */
nr=10;

/* Simply replace the "questions" below with
   the ones you wish to use for this test. If
   you wish more than 5 questions, simply add
   ques[5], ques[6], etc. But be sure that the
   "nr" just above is changed to reflect the
   actual number of questions you have
   prepared.  NOTE: do not use any double
   quote signs in your questions.  If you
   need them, use the HTML &quot; instead.
   Or, single quote signs may be safely used. */
ques=new Array();
ques[0]="1. What do the letters on the top of the building at Station Square (P&LERR) stand for?";
ques[1]="2. Why do The Shops at Station Square have a sign saying &ldquo;The Freight House Shops&rdquo;?";
ques[2]="3. How many cans of oven cleaner were used to clean the stained glass ceiling of the Grand Concourse Restaurant at Station Square?";
ques[3]="4. What are the names of Pittsburgh’s three rivers?";
ques[4]="5. What is a Grotesque?";
ques[5]="6. How is a Gargoyle different from a Grotesque?";
ques[6]="7. What date can you find on the Smithfield Street Bridge?";
ques[7]="8. What is terra cotta?";
ques[8]="9. What disaster occurred in 1845 that destroyed most of the buildings in downtown Pittsburgh?";
ques[9]="10. Why does it make sense to recycle buildings?";

// add as many questions as you wish here

/* Now the tedious part.  You must put the
   letter equivalent for each correct answer
   (a, b, c, d, or e) in order in a row for
   your particular test.  As you can see
   below, I've done so for the demo test. */
cor="cbcdaabcde";

/* When entering your own answers, do not
   use any double quote signs in your 
   answers.  Instead, use the HTML &quot;
   so the JS will not get confused. */
ans=new Array();

ans[0]="Pennsylvania &amp; Lake Erie Rail Road";
ans[1]="Pittsburgh &amp; Lucky Express Rail Road";
ans[2]="Pittsburgh &amp; Lake Erie Rail Road";
ans[3]="Pittsburgh &amp; Lost Elvis Rail Road";
ans[4]="All of the above";

ans[5]="The Shops are named after Albert E. Freight.";
ans[6]="Trains used to pull into the building to unload freight.";
ans[7]="Because the shops sell freight";
ans[8]="Because it just sounds cool";
ans[9]="All of the above";

ans[10]="50";
ans[11]="100";
ans[12]="400";
ans[13]="4000";
ans[14]="All of the above";

ans[15]="Iowa, Allegheny, Monongahela";
ans[16]="Iron, Aluminum, and Steel";
ans[17]="Ore, Albany, and Mongolia";
ans[18]="Ohio, Allegheny, and Monongahela";
ans[19]="All of the above";

ans[20]="A decorative creature found on buildings and bridges";
ans[21]="A kind of stone";
ans[22]="A kind of gorilla ";
ans[23]="A style of building";
ans[24]="All of the above";

ans[25]="A gargoyle has a drain pipe in its mouth.";
ans[26]="A gargoyle is only on churches.";
ans[27]="A gargoyle is always made of stone.";
ans[28]="A gargoyle frightens away pigeons.";
ans[29]="All of the above";

ans[30]="1781";
ans[31]="1881";
ans[32]="1981";
ans[33]="2001";
ans[34]="All of the above";

ans[35]="A kind of stone ";
ans[36]="A delicious pastry";
ans[37]="A hard clay that is fired or baked in a kiln and sometimes glazed";
ans[38]="An ingredient for making steel";
ans[39]="All of the above";

ans[40]="A flood";
ans[41]="A hurricane";
ans[42]="An earthquake";
ans[43]="A fire";
ans[44]="All of the above";

ans[45]="Because you don’t waste bricks or stones";
ans[46]="Because you save the great spaces";
ans[47]="Because it continues the life of the building";
ans[48]="Because you end up with a cool-looking city";
ans[49]="All of the above";

// Continue adding answers here



// The rest of the code should not be edited!
ns="0123456789"
ls="abcde";
astr="";
ack=new Array();
for (var i=0;i<nr;i++){
 ack[i]=(nr*5)+1;
 }

function lightIt(){
 document.images[flg+ad].src="nr/rbl.gif";
 }
function dimIt(){
 if (ack[Math.floor(flg/5)]!=flg){
  document.images[flg+ad].src="nr/rbd.gif";
  }
 }
function dumpIt(){
 if (ack[Math.floor(flg/5)]==flg){
  document.images[ack[Math.floor(flg/5)]+ad].src="nr/rbd.gif";
  ack[Math.floor(flg/5)]=(nr*5)+1;
  }
 else{
  if (ack[Math.floor(flg/5)]!=flg&&ack[Math.floor(flg/5)]!=(nr*5)+1){
   document.images[ack[Math.floor(flg/5)]+ad].src="nr/rbd.gif";
   }
  document.images[flg+ad].src="nr/rbl.gif";
  ack[Math.floor(flg/5)]=flg;
  }
 }
function ckSco(){
 document.images[ad+(nr*5)].src="nr/cwf2.gif";
 setTimeout('document.images[ad+(nr*5)].src="nr/cwf0.gif"',1000);

 for (var i=0;i<nr;i++){
  u=cor.charAt(i);
  v=ls.indexOf(u)+(i*5);
  document.images[ad+v].src="nr/gbl.gif";
  }
 sco=psco;
 for (var i=0;i<nr;i++){
  if (ack[i]==(nr*5)+1){
   sco-=noans;
   }
  else{
   u=cor.charAt(i);
   v=ls.indexOf(u)+(i*5);
   sco=(v==ack[i]?sco:sco-wrans);
   }
  }
 sco=(sco<0?0:sco); // prevent minus score
 scos=""+sco;
 while (scos.length<3){
  scos="0"+scos;
  }
 document.images[ad+(nr*5)+1].src="nr/yts.gif";
 ctr=ad+(nr*5)+2;
 for (var i=0;i<3;i++){
  nj=ns.indexOf(scos.charAt(i));
  document.images[ctr].src="nr/"+nj+".gif";
  ctr++;
  }
 }
function litbut(){
 document.images[ad+(nr*5)].src="nr/cwf1.gif";
 }
function dimbut(){
 document.images[ad+(nr*5)].src="nr/cwf0.gif";
 }
 ctr=0;

function srand() {
 today=new Date();
 rand=today.getTime();
 picker=""+rand
 picker=picker.charAt((picker.length - 4));
 rec=eval(picker);
 }
/* This little routine is simply used to count the
   number of images you may place on your web page
   prior to the radio buttons.  Just makes the routine
   independent of how you lay your page out. */
function getImgAdd(){
 for (var i=0;i<20;i++){
  if (document.images[i].src.indexOf("rbd.gif")>-1){
   ad=i;
   i=20;
   }
  }
 }
