/****************************************************************************
**
** This is a script used only by the Healthy Balance Quiz.
**
**
** Developed by: Damon 3/12/07
**
*****************************************************************************/

/*************************************
**
** Global variables for the Quiz
**
**************************************/
var ans = new Array;
var done = new Array;
var yourAns = new Array;
var explainAnswer = new Array;

var score = 0;
ans[1] = "d";
ans[2] = "c";
ans[3] = "b";
ans[4] = "a";
ans[5] = "a";
ans[6] = "c";
ans[7] = "b";
ans[8] = "b";
ans[9] = "d";
ans[10] = "c";
ans[11] = "b";
ans[12] = "b";
ans[13] = "d";
ans[14] = "d";
ans[15] = "c";
ans[16] = "d";
ans[17] = "d";
ans[18] = "a";
ans[19] = "d";
ans[20] = "c";
ans[21] = "c";
ans[22] = "d";
ans[23] = "e";
ans[24] = "d";
ans[25] = "d";
ans[26] = "d";

explainAnswer[1]="One large bagel is about 4 to 6 ounces. A slice of bread is about 1 ounce.  Therefore, a 5-ounce bagel is roughly equal to 5 slices of bread. This shows the huge portion sizes that are being served today."
explainAnswer[2]="Most 12-ounce cans of soda contain 45 to 50 grams of sugar. (This is clearly stated on the food label.) One teaspoon of sugar is roughly 5 grams. Therefore, a product that has 50 grams of sugar contains 10 teaspoons of sugar."
explainAnswer[3]="The bacon, egg, and cheese biscuit has 450 calories. The sausage biscuit with egg has 450 calories. The sausage biscuit with egg has 500 calories. The deluxe cinnamon roll tops out with the most at 590 calories. This is a very high number of calories for a quick breakfast choice. It does not offer any nutrition! Plus, it has lots of sugar and fat."
explainAnswer[4]="Nust are caloric. But if eaten wisely, they are a great source of plant protein. They are also high in fiber and antioxidants. Plus, they are a rich source of omega 3 fatty acids. In 2003 the FDA approved the following health claim for 6 different kinds of nuts: hazelnuts, pecans, pistachios, walnuts, almonds, and peanuts. It stated that:Scientific evidence suggests, but does not prove, that eating 1.5 ounces per day of most nuts as part of a diet low in saturated fat and cholesterol may reduce the risk of heart disease. The tuna in the sandwich also has some of these kinds of fatty acids. But a tuna salad sandwich can have lots of mayo."
explainAnswer[5]="You cannot spot-remove fat from any one part of the body. Doing sit-ups and other core exercises will spot-strengthen your abdominal muscles. But it will not get rid of fat in that area. To lose fat, you need to burn more calories than you consume. A walking or running program will help you do this."
explainAnswer[6]="10,000 steps equals about 5 miles.  2,000 steps equals one mile."
explainAnswer[7]="Research has shown that those who do not eat breakfast are more often overweight than those who do. Eating breakfast may help to reduce food intake for the rest of the day."
explainAnswer[8]="The American Academy of Pediatrics suggests you limit children's TV viewing to no more than 2 hours per day. The rate at which you burn calories is at its lowest when you watch TV. Children who watch 4 or more hours of TV per day are much more likely to be obese."
explainAnswer[9]="The tuna and chicken sandwiches have lots of mayo. This makes them very high in calories. Roast beef served at a deli is normally a lean meat. It has less fat and calories per ounce than the ham."
explainAnswer[10]="To lose 1 pound you need to burn 3,500 calories. Burning 500 calories per day would equal 3,500 in 1 week. At this rate, you'll lose 1 pound per week!"
explainAnswer[11]="To satisfy most adults' daily protein requirements, the new food guide pyramid recommends between 5 to 7 ounces of: Meat, Chicken, or Beans and nuts. The exact amount depends on your: Age, Sex, and Activity level. Most restaurants will serve a 10 to 12 ounce steak. As you can see, this is way over the daily limit."
explainAnswer[12]="Walking 2,000 steps is almost the same as walking 1 mile. The number of calories burned in 1 mile is roughly 100. The exact number depends on your weight."
explainAnswer[13]="Research has shown that compared to people who include exercise in their weight-loss efforts, dieters who do not include it will: lose more lean body mass, be more susceptible to weight gain, and often get trapped in weight cycling"
explainAnswer[14]="Most diet books will tell you that a muffin has about 150 calories. This is for a 2-ounce muffin. That's pretty small by today's standards. A normal muffin weighs in at 6 ounces, if not more. A 6-ounce muffin has roughly 450 calories."
explainAnswer[15]="If you eat a double burger with cheese with 980 calories, you need to walk for about 3.5 hours to burn them off.";
explainAnswer[16]="Strength training increases the number of calories burned at rest. This is due to the increase in muscle. It may also help to decrease bone loss. This can lower the risk of bone disease. Also, it can strengthen the abdominal and back muscles. This can decrease the risk of back injury and improve posture."
explainAnswer[17]="Soda and other sweet drinks have lots of sugar. They do not provide the body with nutrition. Unsweetened juice can provide the body with some important nutrients. But it's still high in calories. And it has no fiber.  Children should limit their juice intake. It should be no more than two 6-ounce servings per day. Try club soda with a touch of added juice. It has few calories with lots of taste."
explainAnswer[18]="Adults should aim to add 30 minutes of moderate exercise to most days of the week. This is the smallest amount needed to receive many of the health benefits that exercise has to offer."
explainAnswer[19]="In order to improve your physical fitness level and to increase your performance in sports, you need to develop: your heart and breathing (for aerobics), your muscle strength, and your endurance"
explainAnswer[20]="Portion sizes at most places range from 2 to 3 cups. That's 400 to 600 calories before you add sauce."
explainAnswer[21]="A 1-ounce serving of grain is equal to a one-half cup. It has about 100 calories. A 2-ounce serving is equal to one cup. It has 200 calories. A 3-cup serving is 6 ounces. It has 600 calories. Most adults only need 6 ounces of grain per day. So a 3-cup serving is all they need."
explainAnswer[22]="The best way to make sure your children are active is for your family to live an active lifestyle.  Rewards and punishment could hinder the main goal. Have fun. It's the only reward your child should need."
explainAnswer[23]="Breakfast has a positive effect a child's schoolwork and weight."
explainAnswer[24]="TV ads are the most used way to reach children. On average, a child views 1 food ad every 5 minutes on TV. Most of these food ads are for poor food choices. These include: sweetened beverages, fast food, and candies"
explainAnswer[25]=" A small burger and fries with a small shake has about 1,000 calories. The large size has 2,400. You save 1,400 calories with the small size."
explainAnswer[26]="To get the answer, you: multiply 1,400 calories by 52 weeks and get 72,800 calories, then divide 72,800 calories by 3,500 (3,500 calories is about 1 pound), which equals 20.8 pounds! So choose to the small size instead of the large one. You will lose about 20 pounds per year."


/*****************************************
**
** Gather up users answers for the quiz
**
******************************************/
function Engine(question, answer) 
{
	yourAns[question]=answer;
}


/*******************************************
**
** Grade the quiz based upon users' answers
**
********************************************/
function Score()
{
	var answerText = "How did you do?\n------------------------------------\n";
	var state = "correct";
	for(i=1;i<=26;i++)
	{
 		answerText=answerText+"\nQuestion :"+i+"\n";
 		if(ans[i]!=yourAns[i])
  		{
  			state = "incorrect";
  			addElement(i, state);
    		}
  		else
  		{
 	 		state = "correct";
 	 		addElement(i, state);
 	      		score++;
  		}
	}
}

/********************************************
**
** Create the element to signify to the user
** whether thier answer was correct or not
**
*********************************************/
function addElement(i, state) 
{
  	var ni = document.getElementById(i);
  	var newdiv = document.createElement('div');
  	var divIdName = 'my'+i+'Ans';
  	newdiv.setAttribute('id',divIdName);
  	if(state == "correct")
  	{
  		  newdiv.innerHTML = '<p><font color="green"><b>Correct!</b> ' + explainAnswer[i] + '</font></p>';
  	}
  	else
  	{
  		  newdiv.innerHTML = '<p><font color="red"><b>Incorrect!</b> The correct answer was <b><u>' + ans[i] + '</u></b>. ' + explainAnswer[i] + '</font></p>';
  	}
  	ni.appendChild(newdiv);
}
