// 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 1";

/* 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. For whom is Pittsburgh named?";
ques[1]="2. What kind of building in Pittsburgh is named for the founder of Pennsylvania?";
ques[2]="3. Who was the founder of Pennsylvania?";
ques[3]="4. Famous people, places, and events in our history are recalled today in the names of:";
ques[4]="5. Which American president came to Pittsburgh as a young man to survey the land and fight?";
ques[5]="6. Why are the Courthouse lions at the building entrance so high above Grant Street?";
ques[6]="7. What materials are used in making the buildings in downtown Pittsburgh?";
ques[7]="8. What land feature in Pittsburgh is named for an Amerian president?";
ques[8]="9. What can you do to help take care of built things, like bridges and buildings?";
ques[9]="10. Why are old, or historic buildings, valuable in the life of a city?";

// 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="badebceaee";

/* 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]="William Penn";
ans[1]="William Pitt";
ans[2]="Ben Roethlisberger";
ans[3]="John Q. Pittsburgh";
ans[4]="All of the above";

ans[5]="a hotel";
ans[6]="the old jail";
ans[7]="the courthouse";
ans[8]="an office building";
ans[9]="All of the above";

ans[10]="Wilbert Pennsyl";
ans[11]="William Pitt";
ans[12]="Peter Sylvania";
ans[13]="William Penn";
ans[14]="All of the above";

ans[15]="streets";
ans[16]="buildings";
ans[17]="bridges";
ans[18]="parks";
ans[19]="All of the above";

ans[20]="Andrew Carnegie";
ans[21]="George Washington";
ans[22]="Abraham Lincoln";
ans[23]="John Smithfield";
ans[24]="All of the above";

ans[25]="Because the architect made a mistake";
ans[26]="Because the lions would scare people if they were closer to the ground";
ans[27]="Because the street was lowered after the courhouse was built";
ans[28]="Because that's where the lions look best";
ans[29]="All of the above";

ans[30]="glass";
ans[31]="steel";
ans[32]="stone";
ans[33]="brick";
ans[34]="All of the above";

ans[35]="a mountain";
ans[36]="a river";
ans[37]="a ravine";
ans[38]="a lake";
ans[39]="All of the above";

ans[40]="Don't put graffiti on anything.";
ans[41]="Tell people how important a building or bridge is.";
ans[42]="Apply for a &ldquo;Historic Landmark Plaque&rdquo; to recognize the building or bridge.";
ans[43]="Keep using or visiting the building or bridge.";
ans[44]="All of the above";

ans[45]="Because they often have neat details that modern buildings lack.";
ans[46]="Because they are usually smaller than modern buildings and fun to see and explore";
ans[47]="Because the styles of architecture that were popular at different times.";
ans[48]="Because they connect us to stories about our city from years ago.";
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;
   }
  }
 }
