/* ThinkQuest International 2006/2007
   TQ Toolkit - A web building guide for ThinkQuesters (C)
   Your TQ Guides (R)
   Visit http://library.thinkquest.org/06aug/02048/

*/

var question = new Array(21);
var ans1 = new Array(21);
var ans2 = new Array(21);
var ans3 = new Array(21);
var ans4 = new Array(21);
var correct = new Array(21);

question[0]="What is the simplest and most effective way to reduce the germs in our hands right after using a toilet and minimize the risk of contaminating food afterwards?";
ans1[0]="stay in an air conditioned room for at least an hour";
ans2[0]="do not consume food for at least 3 hours";
ans3[0]="washing your hands with water and detergent";
ans4[0]="engage in healthy exercises to keep the body warm. The warmth will then kill the germs.";
correct[0]=3;

question[1]="If you were asked to design a bathroom that has water-savings features, the item that uses most water per unit time you would likely focus on is ..?";
ans1[1]="Tap";
ans2[1]="Shower";
ans3[1]="Toilet flush";
ans4[1]="Bidet";
correct[1]=3;

question[2]="Many parts of the toilet have the potential to be contaminated with germs. Which is probably the least contaminated?";
ans1[2]="Door handle";
ans2[2]="Toilet seat";
ans3[2]="Toilet flush";
ans4[2]="Taps";
correct[2]=2;

question[3]="When you head into a toilet cubicle, what is the first thing you should check?";
ans1[3]="Check for presence of toilet paper or water hose, else bring your own toilet or tissue paper!";
ans2[3]="Check if the flush button is in clean condition";
ans3[3]="Check if the door lock is functioning well";
ans4[3]="Check if the floor is wet";
correct[3]=1;

question[4]="Scientifically speaking when excreting, squatting is better than sitting because ...?";
ans1[4]="No, sitting is better";
ans2[4]="Squatting releases the constriction on the rectum, and allow for smoother excretion";
ans3[4]="Squatting numbs the leg, forcing one to finish his/her business faster";
ans4[4]="Squatting shortens the distance between the 'excretion point' and the water.";
correct[4]=2;

question[5]="Wiping after dumping can lead to Hemorrhoids. In layman's term, this is known as ...?";
ans1[5]="Measles";
ans2[5]="HIV";
ans3[5]="Flu";
ans4[5]="Piles";
correct[5]=4;

question[6]="Which of these is NOT a guideline to a good toilet?";
ans1[6]="Being clean and dry";
ans2[6]="Being well ventilated";
ans3[6]="Having queues occasionally spotted at entrance";
ans4[6]="Properly planned layout";
correct[6]=3;

question[7]="According to recorded history, which country first produced the toilet paper?";
ans1[7]="United States of America";
ans2[7]="Sweden";
ans3[7]="Russia";
ans4[7]="China";
correct[7]=4;

question[8]="In the USA alone, 5 billion gallons of water are used daily for ...?";
ans1[8]="Showering";
ans2[8]="Mopping";
ans3[8]="Flushing toilet";
ans4[8]="Garderning";
correct[8]=3;

question[9]="Which part of the toilet entrance probably has the highest germ count?";
ans1[9]="The door itself";
ans2[9]="The door handle";
ans3[9]="The door frame";
ans4[9]="The door mat";
correct[9]=2;

question[10]="Light-sensor activated water taps are becoming common nowadays. Why is this so?";
ans1[10]="The conventional button is unhygienic, and only serves to spread germs and bacterial.";
ans2[10]="Light sensing systems are cheaper.";
ans3[10]="Toilets designers want to present themselves as technologically advanced people.";
ans4[10]="Light sensing taps can save on electricity.";
correct[10]=1;

question[11]="To attain maximum efficiency, the toilet seat should...";
ans1[11]="be removed.";
ans2[11]="always be in the lifted position.";
ans3[11]="always be in the lowered position.";
ans4[11]="be left in the last used position";
correct[11]=4;

question[12]="Which of the following are examples of germs (diseases) that can cause serious illness from direct or indirect fecal contamination?";
ans1[12]="Salmonella infection, Viral gastroenteritis, Escherica Coli infection, cholera";
ans2[12]="SARS, bird flu, tuberculosis, AIDS";
ans3[12]="poliomyelitis, dengue fever, malaria, rabies";
ans4[12]="smallpox, syphilis, gonorrhea, leprosy";
correct[12]=1;

question[13]="In a bid to solve the large numbers of people without access to proper sanitation, developing countries often a favor the approach of employing ecological sanitation to the masses. What are the advantages of such an approach? Choose the choice with the most number of important advantages ";
ans1[13]="saves electricity, very cost effective, promotes digestion, relieves backache pain";
ans2[13]="politically acceptable, saves electricity, saves transport costs, less risk of diseases";
ans3[13]="less risk of diseases, promotes a healthy lifestyle, smell from human excreta is reduced, economy of nation is boosted";
ans4[13]="ery cost effective, saves water, does not pollute environment, nutrients in the excreta is reused for agricultural purposes";
correct[13]=4;

question[14]="In several parts of India, the disposal of human excreta has been considered \"dirty\" and \"undignified\" partly due to the taboo surrounding toilets and human feces. People who do such jobs are relegated to a group of outcasts, one of the lowest caste of people known as the ________.  A sanitation crusader, ________ has been at the forefront of efforts to eliminate this social divide since 1970 by building eco-friendly toilets and finding alternative jobs for these outcasts.";
ans1[14]="pariah, Mahatma Gandhi";
ans2[14]="bollywood, Jawaharlal Nehru";
ans3[14]="scavengers, Dr Bindeswar Pathak";
ans4[14]="suttee, Maulana Azad";
correct[14]=3;

question[15]="Approximately _____ people do not have access to a proper toilet and this number represents _______ of the world's population ";
ans1[15]="28 million, 1%";
ans2[15]="2.6 billion, 40%";
ans3[15]="800 million, 15%";
ans4[15]="1 billion, 30%";
correct[15]=2;

question[16]="At the rate of improvement as of 2007, the United Nations MDG will be missed by...";
ans1[16]="10% of those in need, 4% of the world population";
ans2[16]="15% of those in need, 6.5 of the world population";
ans3[16]="20% of those in need, 8.5% of the world population";
ans4[16]="25% of those in need, 10% of the world population";
correct[16]=4;

question[17]="What nutrients found in urine and feces are especially of use to plants?";
ans1[17]="Nitrogen, Potassium & Phosphorus";
ans2[17]="Oxygen, Carbon & Calcium";
ans3[17]="Sodium, Carbon & Lead";
ans4[17]="Lithium, Beryllium & Magnesium";
correct[17]=1;

question[18]="The United Nations has set a target to reduce by ____% the proportion of people without access to a proper toilet by 2015";
ans1[18]="10";
ans2[18]="30";
ans3[18]="50";
ans4[18]="100";
correct[18]=3;

question[19]="The World Toilet Organization decided to declare ____ to celebrate World Toilet Day as an annual event";
ans1[19]="20 January";
ans2[19]="19 September";
ans3[19]="19 November";
ans4[19]="11 September";
correct[19]=3;

question[20]="Which of the following organizations is not involved in championing for better sanitation and toilets both locally and worldwide?";
ans1[20]="Sulabh International";
ans2[20]="World Toilet Organization";
ans3[20]="World Toilet Association";
ans4[20]="Poo Foundation";
correct[20]=4

question[21]="The United Nations has declared 2008 to be the International Year of ____________ to recognize the urgent problems in the issue of ______ and toilets ";
ans1[21]="sanitation, sanitation";
ans2[21]="youth, constipation";
ans3[21]="elderly people, diarrhea";
ans4[21]="finance, pricing";
correct[21]=1;

var testIndex, val;

function checkAnswer()
{
	if (val == correct[testIndex])
		alert("Congratulations! You answered the question correctly.");
	else
		alert("Sorry, the correct answer is: " + eval("ans" + correct[testIndex] + "[" + testIndex + "]"));
}

function setVal(num)
{
	val = num;
	checkAnswer();
}

function testYourself()
{	
	if (document.getElementById('triviaQn') && document.createTextNode && document.createElement) {
	testIndex = Math.floor(Math.random() * question.length);
	val = 1;
	
	var container = document.getElementById('triviaQn');
	while (container.firstChild)
		container.removeChild(container.firstChild);
	var curQn = document.createTextNode(question[testIndex]);
	
	container.appendChild(curQn);
	container.appendChild(document.createElement('br'));
	container.appendChild(document.createElement('br'));
	
	var radiobutton = new Array(4);
	radiobutton[0] = document.createElement('img');
	radiobutton[1] = document.createElement('img');
	radiobutton[2] = document.createElement('img');
	radiobutton[3] = document.createElement('img');
	for (var i=0; i<4; i++)
	{
		radiobutton[i].setAttribute('src', 'images/radiobutton.png');
		radiobutton[i].setAttribute('class', 'smallIcon'); //Firefox
		radiobutton[i].setAttribute('className', 'smallIcon'); //IE
		radiobutton[i].style.display = "inline";
		container.appendChild(radiobutton[i]);
		
		var answer;
		if (i == 0) 
			answer = document.createTextNode(ans1[testIndex]);			
		else if (i == 1)
			answer = document.createTextNode(ans2[testIndex]);
		else if (i == 2)
			answer = document.createTextNode(ans3[testIndex]);
		else
			answer = document.createTextNode(ans4[testIndex]);
		container.appendChild(answer);
		container.appendChild(document.createElement("br"));
		
	}
	container.appendChild(document.createElement("br"));
	
	if (radiobutton[0].addEventListener)
	{
		radiobutton[0].addEventListener("click", function(e){setVal(1);}, false);
		radiobutton[1].addEventListener("click", function(e){setVal(2);}, false);
		radiobutton[2].addEventListener("click", function(e){setVal(3);}, false);
		radiobutton[3].addEventListener("click", function(e){setVal(4);}, false);
	}
	else if (radiobutton[0].attachEvent)
	{
		radiobutton[0].attachEvent('onclick', function(e){setVal(1);});
		radiobutton[1].attachEvent('onclick', function(e){setVal(2);});
		radiobutton[2].attachEvent('onclick', function(e){setVal(3);});
		radiobutton[3].attachEvent('onclick', function(e){setVal(4);});
	}
	}
}