function getQuiz(quizNum){
  var quizzes = new Array();
   quizzes[0] = new Array(1,"Clementine","Sarah Pennypacker","clementine.jpg","What type of home does Clementine live in?","She lives in an apartment building","She lives in a townhouse.","She lives in a mansion.","0","What type of jobs do Clementine’s parents have?","Her father is a teacher, her mother is a banker","Her father is the apartment building supervisor, her mother is an artist","Her father sells cars, her mother is a baker","1","Why is Margaret’s mother so upset with Clementine?","Clementine was impolite to her.","Clementine pushed Margaret.","Clementine cut off most of Margaret’s hair.","2","Who was Polka Dottie?","Clementine’s cat that died","Margaret’s cat","a neighbors dog","0","How did Clementine help Principal Rice?","She straightened the books in Principal Rice’s office.","She answered the phone in Principal Rice’s office.","She dusted Principal Rice’s office.","1","What name(s) did Clementine give to her brother?","She called him Polka Dottie.","She didn’t name him anything.","She called him different vegetable names.","2","What was the main thing that the grown-ups kept telling Clementine to do?","They told her to pay attention.","They told her to sit up straight.","They told her to eat her vegetables.","0","How did Clementine try to fix Margaret’s hair?","She made a wig out of yarn for Margaret.","She colored Margaret’s head with a marker.","She took Margaret to a beauty shop.","1","How did Clementine help her dad solve his pigeon problem?","She just kept helping him clean the pigeon mess off the lions.","She never did help solve the problem","She got the neighbor to feed the pigeons from a different window.","2","What did Margaret get that Clementine wanted too?","braces","a new dog","a Gameboy","0","What was “the battle” that Clementine’s dad had to fight everyday?","Getting Clementine to clean her room","Cleaning up the pigeon mess on the lions in front of the apartment building","Helping Clementine get ready for school","1","Why did Clementine end up in Principal Rice’s office at the beginning of the week?","She glued the papers to the table.","She called Margaret a bad name.","She cut Margaret’s hair in the bathroom.","2","Why did Clementine’s parents throw her a surprise party?","She helped her dad to win the “Great Pigeon War”.","She didn’t go to the principal’s office for a whole week","She got an “A” in school.","0","What food did Clementine refuse to eat on Friday morning?","her cereal","eggs","green beans","1","What kind of cake did Clementine have at her party?","vanilla","lemon ","chocolate","2");
  quizzes[1] = new Array(2,"Counting on Grace","Elizabeth Winthrop","grace.jpg","What state does Grace live in?","Vermont","New Hampshire","Massachusetts","0","What does Miss Lesley say about Grace that surprises her?","Miss Lesley says that Grace is her best math student","Miss Lesley says that Grace is one of her best readers","Miss Lesley says that Grace is too quiet and shy","1","What book is Arthur reading?","Little Women","The Blue and the Gray","The Red Badge of Courage","2","What instrument does Grace’s father play?","An accordion","A fiddle","A harmonica","0","Grace helps Henry write a letter to the National Child Labor Committee.  How does Miss Lesley tell them to sign it?","Arthur Trottier","Anonymous","Grace Forcier","1","How does Grace concentrate her mind on her job","She sings","She prays","She counts each bobbin she drops into the box ","2","How old does Grace need to be to work in the mill?","Twelve","Fourteen","Sixteen","1","Where does Miss Lesley want Grace to go?","To Massachusetts so she won’t have to work in the mill","To the Normal School to become a teacher","To school to become a lawyer","1","Why is Lewis Hine at the mill?","To inspect the machines for safety","To take photographs for a newspaper","To take photographs of the children","2","Arthur is frustrated with working at the mill, what does he do?","He injures his hand by putting his fingers between the sprockets","He runs away to Canada","He damages the frame his mother works","0","Grace’s mother says Grace is too slow at doffing and Miss Lesley says her penmanship is not good. Why does Grace have a difficult time? ","She has trouble concentrating","She is naturally left-handed","She does not work hard enough","1","Why does Grace’s mother tear Mr. Hine’s photograph of Grace into small pieces?","She is embarrassed ","She doesn’t think it is a good picture of Grace","Because Grace is photographed in her mill smock not her Sunday dress","2","Why is it important for Arthur to keep working at the mill?","So he and his mother can live in their house on French Hill","His mother needs the money he makes","He needs to keep busy ","0","What does Grace give Arthur?	","Some money","Half of the picture Mr. Hine sent her","The notebook ","1","What surprising thing did Grace’s mother do?","She moved the Forcier family back to Canada","She taped Grace’s picture back together","She wanted Grace to become a substitute teacher","2");
  quizzes[2]= new Array(3,"The Ghost’s Grave","Peg Kehret","grave.jpg","Josh is sent to spend the summer with Aunt Ethel because","His mother is getting married in India","His parents don’t want him to play on the summer baseball team","His mother and stepfather are going to India on business","2","How did Aunt Ethel kill the bat in her house on the night of Josh’s arrival?","She hit it with a broom","She shot it with a shotgun","She poisoned it","1","After she died, Aunt Ethel thinks that her sister Florence came back to visit her as a ","Peacock","Ghost","Squirrel","0","When Josh first discovers the tree house, he also finds a stray","Cat","Dog","Peacock","0","Josh discovered that the tree house was haunted by","The ghost of his Aunt Florence","A coal miner’s ghost","The person who stole the Cash for Critters money","1","How did Willie die?","He fell out of the tree house","He was run over by a truck","In a coal mine explosion in 1905","2","What did Willie want Josh to do?","Dig up his leg bones and bury them with the rest of his body","Dig up his body and bury it next to his wife Sarah","Dig up Willie’s bones and move them to the cemetery","0","When Josh was digging for Willie’s leg bones, he found","A metal box","A huge rock","A wooden casket","0","Mr. Turlep stole the Cash for Critters money because","He wanted to buy a boat","He wanted to be rich","He wanted to finance his retirement","2","Aunt Ethel had to be taken to the hospital in an ambulance because","She was shot by Mr. Turlep","She had fainted when she saw Willie","She had tripped on the rug and broken her ankle","2","What did Josh write on the cake he gave to Muriel?","Happy Birthday!","Congratulations!","HELP","2","The police came in time to arrest Mr. Turlep because","Josh called the police when Mr. Turlep wasn’t looking","Muriel called the police after she picked up the cake on which Josh had written his message","Willie called the police","1","The police officer knew the money in the box was the Cash for Critters money because","	The money was marked with permanent ink","The officer’s grandchildren had written “For the Animals” on their $100 bills","The serial numbers on the money matched","1","How much money had been raised for the animal shelter and stolen by Mr. Turlep?","$1300","$100,000","$130,000","2","What did Willie leave for Josh before he became an angel?","His tombstone","His coal-miner’s hat","$100","1");
  quizzes[3]= new Array(4,"Henry’s Freedom Box: A True Story from the Underground Railroad ","Ellen Levine","henry.jpg","When Henry was a young slave, he worked","In the big house where his master lived","In the kitchen with his mother","In the tobacco fields with his brothers and sisters","0","What did Henry wish when he went to see his dying master?","Henry wished that his master would not die. ","Henry wished his master would set him free.","Henry wished that his master would give him some money.","1","Henry’s middle name became","\"Smith\"","\"Free\"","\"Box\"","2","Henry did not know his birthday because","Henry was a slave and slaves weren’t allowed to know their birthdays","His mother died when he was born","His mother forgot when he was born","0","One day while Henry was working:","His wife and children were killed in a fire. ","His wife and children were sold and he never saw them again","His children ran away. ","1","Who helped Henry escape to Freedom?","His mother.","George Michaelson","Dr. Smith","2","During Henry’s journey, his box traveled on  a","Steamboat","Airplane","Horse and wagon","0","Henry arrived in Philadelphia","On New Year's Day","On March 30, 1849","Injured and unconscious","1","How did Henry get out of working the day he escaped?","His friend Jonathan worked in his place.","It was Sunday and he didn't have to work. ","He burned his hand with vitriol.","2","What lucky thing happened during Henry's journey?","Two men turned over the box, so Henry wasn't upside down.","A kind man gave him food.","The captain nailed the box shut.","0","When Henry’s master died, Henry was","Sold to a plantation in Georgia. ","Given to his master’s son","Given his freedom","1","How would you describe Henry?","Mean and angry ","Lazy and foolish  ","Clever, determined, and brave.","2","Why were Henry and his wife lucky in the beginning?","They were able to live together even though they had different masters.","Their master gave them a nice house.","They found a bag of money.","0","Henry worked in his new master’s","House","Tobacco factory","Horse stable","1","Who came up with the idea of mailing Henry in a box?","His wife came up with the idea.","The Underground Railroad conductor told Henry he should try it.","It was Henry's idea.","2");
  quizzes[4] = new Array(5,"The Homework Machine","Dan Gutman","homework.jpg","What was Snik planning to offer Brenton for the use of the Homework Machine?","friendship","money","books","0"," Why was Miss Rasmussen happy about her new job?","She wanted to teach at a high school.","She loved nature and wanted to live near a national park. ","She wanted a job near the ocean.","1","Why did Sam think that the kids should not have been held accountable for what they did?","The Homework Machine actually was a time saver.","The kids did not physically hurt anyone by using the Homework Machine."," Kids do dumb things sometimes because the human brain is not fully developed until about age 20.","2"," Who was envious of Brenton’s intelligence and liked doing homework?","Judy","Kelsey","Snik","0","  How did Brenton, Snik, Judy, and Kelsey destroy the Beast?","  They unplugged the computer and lost all the programs on it.","They catapulted it over the South Rim of the Grand Canyon.","  They stuffed it full of firecrackers and blew it to smithereens.","1","Why did Mrs. Damagatchi leave the kids alone in Brenton’s room?","After giving the kids snacks, Mrs. Damagatchi knew that the kids wanted to play video games without any interruptions.","Mrs. Damagatchi didn’t really care what they were doing."," Mrs. Damagatchi was so happy that Brenton finally had some friends that she didn’t want to intrude on them.","2","What color did Kelsey dye her hair?"," pink","blonde","red","0","What was the first fad Brenton created using a software program he designed?","wear a hat to school on Monday"," wear red socks to school on Thursday","wear your clothes inside out to school","1","Why did Brenton think it would be cool to live on Mercury or Mars?","A day on those planets only lasts 6 hours.","He wanted to travel in a spaceship."," Days are much longer on those planets.","2","For a special project, the students in Miss Rasmussen’s class had to design a machine that included their studies of science, history and physics.  Which machine was it?"," a catapult","   a pulley","   a lever","0","Which of the following did Miss Rasmussen tell her class?","\"The early bird gets the worm.\""," \"Hard work pays off.\""," \"He who hesitates, is lost.\"","1","What was the real reason Snik told Brenton that he thought chess was boring? ","Snik preferred playing backgammon.","Snik thought the other kids would call him a loser if he played chess."," Snik didn’t think he was smart enough to learn the game.","2","Brenton and Snik’s Dad compared chess to "," war","checkers","monopoly","0","Who called in the tip to the police hotline and put the article in the school newspaper about a homework machine?","Ronnie Teotwawki"," Brenton Damagatchi","Judy Douglas","1","Someone named \"R.Milner\" contacted Benton via e-mail. Kelsey received several IMs from Milner.  He came to Brenton’s house.  Who was he and what did he want?","He was a FBI agent and he wanted to arrest the kids.","He was a computer scientist and he wanted to learn more about the software Brenton developed for the Beast "," He worked for a marketing company and he wanted Brenton to work for him.","2");
  quizzes[5]=new Array(6,"Owen & Mzee: The True Story of a Remarkable Friendship","Isabella Hatkoff, Craig Hatkoff, Dr. Paula Kahumbu","owen.jpg","How old was Mzee when Owen met him?"," 130 years old","150 years old","100 years old","0","A group of hippos is called","a herd","a pod","a pride","1","What caused the hippos to move downstream to the town coastal town of Malindi?","Fresh grasses growing along the shore were their favorite food.","There was more space for them to graze."," Heavy December rains caused racing floodwaters.","2","Why did Owen need to be rescued?","He was stranded on a coral reef by the tsunami and would become ill if left in the salty water.","He had wandered away from his mother and became lost in a heavy rainstorm.","He became confused by the villagers chasing the hippos back to their usual grazing area.","0","How did Owen get his name?","Hippos are named alphabetically like hurricanes and “O” was the next letter."," He was named for the man who held him while the rescuers secured the net.","He was named for his great-grandfather.","1","Why would Owen never be able to return to the wild?","He was injured on the reef and could not walk long distances.","Owen preferred people to other hippos."," Since he was still a baby, he had not yet learned to survive by himself.","2","What does a hippo enclosure need to include?"," It must be large, have water and mud for wallowing, tall trees and brush.","It must have open, desert area and many other types of animals living in it.","It must be a large area by the seashore.","0","What did Owen do when he was released into the enclosure?","He bellowed at Mzee.","He scrambled from the truck to hide behind Mzee.","He ate his first meal.","1","What did Mzee do when Owen arrived?","He stuck his neck out to be scratched.","He ate some leaves to show Owen which ones to eat.","He hissed and crawled away.","2","How do Mzee and Owen show they trust each other?","They are gentle with each other even though either could easily injure the other one.","They chase each other around the enclosure.","They eat each other’s food.","0","Why do wildlife experts think Owen became so attached to Mzee?","Mzee can sound like a hippo."," Mzee’s coloring and rounded shape may have looked like Owen’s mother.","Mzee didn’t like other tortoises.","1","Why have Owen and Mzee become famous?","The people at Haller Park put them on posters for tourists.","A song was written about them."," Their pictures have been in newspapers and magazines and TV programs and films have been made about them.","2","What caused the tsunami that separated Owen from his mother?"," an earthquake","a volcano","a hurricane","0","What country is home to Owen and Mzee?","Madagascar"," Kenya","Tanzania","1","The word “hippopotamus” comes from two Latin words meaning","elephant and water","body and sea"," horse and river","2");
  quizzes[6]=new Array(7,"Phineas L. MacGuire . . . Erupts","Frances O'Roark Dowell","phineas.jpg","Mac is sad on the first week of fourth grade because: "," His best friend Marcus has moved to Kansas.","He doesn't like his fourth grade teacher.","He doesn't like school because he struggles with reading.","0","Mac believes he is allergic to many items including which of the following?","Strawberries, peanuts, orange, chalk and mean people"," Avocados, yogurt, cottage cheese, purple and girls","Broccoli, mustard, yellow, ice cream and animal hair","1","No one likes Mac R. at the beginning of the school year because:","He is shy and quiet and never talks to anyone.","He steals the class pet on the first week of school."," He claims he is smarter than everyone on the first day of school.","2","Since Mac loves science and experiments, he has a subscription to which of the following magazines?"," Scientific American","National Geographic","Kids Discover","0","What did Aretha and Mac have in common?","They both had a keen interest in volcanoes and earthquakes."," They both were excited about the fourth grade science fair.","They both had parents who were divorced.","1","Mrs. Tuttle, the fourth grade teacher, likes which of the following?","Purple clothing and salamanders","Unusual hats and praying mantises"," High-top green sneakers and frogs","2","Before the fourth grade science fair, Mac practiced which of the following experiments?"," How to explode film canisters and microwave marshmallows","How to make a circuit with wire and a light bulb","How to grow carnivorous plants that eat insects","0","Which of the following was a requirement for the fourth grade science fair?","All students had to conduct an experiemnt that included a chemical reaction."," All students had to work with a partner and collaborate.","All students had to write a research paper that explained their experiement.","1","Which of the following are two ideas Mac considered investigating for his science fair project?","What makes insect bites itch and what makes plants poisonous?","How do rainbows occur and why is the ocean blue?"," Why do rotten eggs stink and what makes mold?","2","What type of pajamas was Mac R. wearing when Mac came over to talk about the science fair?","  Spider-man","Teenage Mutant Ninja Turtles","Super Mario Brothers","0","What talent did Ben demonstrate to convince his classmates to like him better?","He played original songs on his guitar."," He drew cartoon pictures that looked like his classmates.","He wrote amazing fantasy stories and read them to his class.","1","What are two things that Mac learned about Ben in one afternoon together?","Ben lived with his Dad and wanted to move back to Seattle.","Ben was an expert on volcanoes and rocks."," Ben was a drawing genius and a dinosaur genius.","2","Why did Mac visit Mr. Martinez, the school nurse?"," His nose started bleeding in math.","He had a bad headache and an upset stomach.","His skin broke out in red blotches because of an allergic reaction.","0","What mystery did Aretha and Mac solve by looking at the trash?","What food item was making the classroom pet sick."," Who was knocking over paint jars in the art closet.","Why Ben was able to draw incredible comic book characters.","1","When Ben forgot the vinegar for the science fair project, what did Aretha give him to make the volcano erupt?","Baking soda","Dishwashing liquid"," Lemon juice","2");
  quizzes[7]=new Array(8,"Punished","David Lubar","punished.jpg","Why did Logan get punished?","He was running and playing tag in the library","He stole a library book","He copied his friend’s homework","0","What is an oxymoron?","A person who acts silly","A phrase where the two parts have opposite meanings","A word that makes a sound","1","What was Logan’s punishment?","He had to clean the library","He had to write an apology letter","He had to make puns when he talked","2","How did Logan prove that he found seven oxymorons?","By taking pictures of them","By cutting them out of magazines","By drawing pictures of them","0","Which of the following is not an example of an anagram?","teach, cheat","there, their","taco, coat","1","What is a palindrome?","A tool that musicians use to keep the beat","A word that makes a sound","A word that is spelled the same forward and backward","2","Which of the following is NOT one of the tools Logan used to gather information for his quests?","A tape recorder","Rubber bands","A bag","0","_______________________ is a an example of a palindrome?","petal, plate","pot, top","crash, pow","1","How did Benedict save Logan from having to answer a question at school?","He pulled the fire alarm","He answered the question for Logan","He claimed his pants were on fire","2","How did Logan thank Benedict for saving him from getting in trouble at school?","He took him out for pizza","He bought him a candy bar","He invited him to his house for dinner","0","What happened to Logan when he got sent to the principal’s office?","She gave him detention","She laughed at his puns","She called his parents","1","Who punished Logan?","The librarian","His parents","A professor","2","How many quests did Logan have to complete to remove the punishment?","3","4","2	","0","Why did Benedict get angry with Logan?","Logan spread a rumor about Benedict","Logan wouldn’t let Benedict help","Logan forgot Benedict’s birthday","1","What is a pun?","Rhyming words","Sound words","A funny play on words","2");
  quizzes[8]=new Array(9,"Rules","Cynthia Lord","rules.jpg","What are Catherine's guinea pigs' names?","Nutmeg and Cinnamon","Sugar and Spice","Chocolate and Vanilla","0","What is David's favorite book to listen to?","Charlotte's Web by E.B. White","Frog and Toad by Arnold Lobel","Toot and Puddle by Holly Hobbie","1","What is Catherine's favorite activity?","Swimming","Reading","Drawing","2","How does Jason communicate?","Communication Book","Voice Box","Sign Language","0","Why is Jason upset with Catherine the first time they meet?","David was staring at him","Catherine was drawing a portrait of him","Catherine didn't say hello to him","1","What did David want from Ryan?","A ride to the video store","A game of basketball","A stick of gum","2","What does Catherine do when she sees Kristi by the Wharf? ","She hides","She introduces Jason to Kristi","She runs away","0","What does Catherine give Jason for his birthday?","Word cards","A guitar","A video game","1","Who is Catherine's favorite singer?","Gwen Stefani","Rhianna","Avril Lavigne","2","What does David say when Catherine's guinea pigs get loud?","\"Quiet, pigs!\"","\"Fix it?\"","\"Quiet, guinea pigs!\"","0","What does Catherine have to keep reminding her father to get for David?","A DVD player","A tape player","A CD player","1","Which of the toys below did not end up in the fish tank at Catherine and David's house?","A Barbie Doll","A tiny cowboy figurine","A slinky","2","What did Jason send Catherine from OT?","A big bunch of carrots","A CD","Colored pencils","0","Why doesn't Catherine want to go to the community center dance?","It goes against her rule of \"no dancing unless I'm alone in my room or it's pitch-black dark.\"","She was scared of what Kristi might think of her","She was embarrassed to be seen with David","1","What does Jason dream about being able to do?","Play the guitar","Drive","Run","2");
  quizzes[9]=new Array(10,"The Winner's Walk","Nancy Ruth Patterson","walk.jpg","What happened to Bitsy?","She was kicked by a horse and died.","She was poisoned.","She was hit by a car.","0","Why did Case's mother have a \"no dogs\" rule?","She was allergic to dogs.","She was afraid of loving another dog.","She had been bitten by a dog.","1","What did Case's mother do?","She worked in the city as a lawyer.","She was a scientist working on a secret government project.","She was an actress who traveled sometimes.","2","What was Noah's name when he lived with the Woodsons?","Duke","Tom","Rover","0","How did Case break his arm?","He fell off of his bike.","He fell off of his pony at a horse show.","He fell off of his skateboard.","1","What happened at the talent show?","The E-string on Case's guitar broke.","Case accidentally pushed another student off the stage.","One of the balls Case juggled hit his teacher in the head.","2","What was Case's science project?","He made a model of the human heart.","He grew African violets under special lights.","He made an erupting volcano.","0","Why didn't the Woodsons want Noah back?","Noah had bitten Meg's arm.","They had already replaced him with another dog named Gabriel.","Noah had run away and they didn't want a dog who might run away again.","1","Why did Case give Noah away?","Noah was bothering the horses.","Case's family moved to a new house and couldn't bring Noah with them.","Noah was a specially trained service dog who was needed by a handicapped child.","2","What kind of house did the Woodsons live in?","They lived in a large, expensive house with a pool and lots of rooms.","They lived in a houseboat.","They lived in a very small city apartment. ","0","How did they know that Noah was the same dog the Woodsons lost?","Noah had a collar with the Woodsons' name and address on it.","Noah had a horseshoe scar under his right ear.","The police told them.","1","Where did Case find Noah?","He found him in the barn.","He found him at the school playground.","He found him in a rowboat.","2","Why did Case want so badly to be a winner?","He felt like everyone in his family was talented except for him.","His grandfather promised him $100 if he won the science fair.","He made a bet with his best friend Harry. ","0","Who was Quinn?","Quinn was the kind custodian at Case's school.","Quinn was Case's sister.","Quinn was Case's next door neighbor.","1","What did Meg show Case during their visit?","Meg showed Case a photo album of herself before the skiing accident.","Meg showed Case her stamp collection.","Meg showed Case all the special tricks Gabriel and Noah could do.","2");
  return quizzes[quizNum - 1]
}

function setupQuiz(){
	var txtQuizNum = document.location.search.substring(4);
	var questions = new Array();
	var txtChoice;
	var i;
	var j;
	var randomnumber;
	var quesNum;
	questions = getQuiz(txtQuizNum);
	var qUsed = new Array();
	document.getElementById("hidBook").value=questions[1];
	document.getElementById("imgBook").src="images/"+questions[3];
	for (i = 0; i < 10; i++){ 
		qUsed[i] = false;
	}
	for (i=0; i<5; i++){
		randomnumber = Math.floor(Math.random()*16)
		
		if (!qUsed[randomnumber] && randomnumber <=15 && randomnumber > 0){
			quesNum=i+1;
			document.getElementById("Q"+quesNum.toString()).innerHTML=questions[randomnumber*5-1];
			for (j = 1; j<4; j++){
				txtChoice="q"+quesNum.toString()+"c"+j.toString();
//			alert (txtChoice);
				document.getElementById(txtChoice).innerHTML=questions[randomnumber*5-1+j];
				A[quesNum]=questions[randomnumber*5+3];
				qUsed[randomnumber]=true;
			}
		} else {
			i--;
		}	
	}
}

function scoreboard(){
	var msg="";
	var intRightCount=0;
	if(document.frmQuiz.txtName.value=="" | document.frmQuiz.txtTeacher.value==""){
		alert("You must give your full name and your teacher's name");
		document.frmQuiz.txtName.focus();
		}
	else{ 
		if(document.frmQuiz.q1c[A[1]].checked) intRightCount++
		if(document.frmQuiz.q2c[A[2]].checked) intRightCount++
		if(document.frmQuiz.q3c[A[3]].checked) intRightCount++
		if(document.frmQuiz.q4c[A[4]].checked) intRightCount++
		if(document.frmQuiz.q5c[A[5]].checked) intRightCount++
		document.getElementById("hidRightCount").value=intRightCount;
		msgWindow=window.open("score.htm", "msgwin", "height=450,width=700,titlebar=0");
		}

}
