/* 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(34);
var ans1 = new Array(34);
var ans2 = new Array(34);
var ans3 = new Array(34);
var ans4 = new Array(34);
var correct = new Array(34);

question[0]="Arrange the following in the order of which should be first done.";
ans1[0]="Target Audience, Objectives, Site map, Research";
ans2[0]="Research, Site map, Objectives, Target Audience";
ans3[0]="Objectives, Target Audience, Research, Site map";
ans4[0]="Objectives, Target Audience, Site map, Research";
correct[0]=4;

question[1]="How many percent of internet-users speak English as their first language?";
ans1[1]="16%";
ans2[1]="26%";
ans3[1]="36%";
ans4[1]="46%";
correct[1]=3;

question[2]="Jargons are ";
ans1[2]="Technical words used by a group of people, usually a profession";
ans2[2]="Technical words used by technicians";
ans3[2]="Difficult words that no one understands";
ans4[2]="A bunch of clowns who juggle";
correct[2]=1;

question[3]="What is used to protect yourself from any liability due to any information presented in your web site?";
ans1[3]="Acknowledgement";
ans2[3]="Glossary";
ans3[3]="References and Citations";
ans4[3]="Disclaimer";
correct[3]=4;

question[4]="Which of the following is true?";
ans1[4]="Plagiarism will result in a deduction of points upon judging";
ans2[4]="Sites in other languages are not evaluated";
ans3[4]="Content can be copied without stating the source";
ans4[4]="Email address of any member can be given out to readers";
correct[4]=2;

question[5]="What do you need to consider regarding your Target Audience?";
ans1[5]="Experience in using the internet/computer";
ans2[5]="How much they earn";
ans3[5]="Gender and interests";
ans4[5]="All of the above";
correct[5]=4;

question[6]="What is needed to create a content jump?";
ans1[6]="CSS only";
ans2[6]="Javascript only";
ans3[6]="HTML only";
ans4[6]="Flash only";
correct[6]=3;

question[7]="What attribute do you use to show roll-over definitions for jargons?";
ans1[7]="name";
ans2[7]="title";
ans3[7]="jargon";
ans4[7]="class";
correct[7]=2;

question[8]="In what order should the glossary be arranged?";
ans1[8]="Alphabetical order";
ans2[8]="Length of word/words";
ans3[8]="Order of importance";
ans4[8]="No particular order";
correct[8]=1;

question[9]="In what order should your site index be arranged?";
ans1[9]="Alphabetical order";
ans2[9]="Length of word(s)";
ans3[9]="Order of importance";
ans4[9]="No particular order";
correct[9]=3;

question[10]="What must you not do?";
ans1[10]="Include photographs of your team members";
ans2[10]="Give out your personal email addresses";
ans3[10]="Tell more about how your team worked together";
ans4[10]="Inform your readers how to make use of special features in your website";
correct[10]=2;

question[11]="Plagiarism counts when";
ans1[11]="the source is copyrighted";
ans2[11]="the source is not copyrighted";
ans3[11]="there is lifting from the source without quoting";
ans4[11]="there is lifting from the source with quoting";
correct[11]=3;

question[12]="What does HTML do?";
ans1[12]="It processes code to form a program";
ans2[12]="It interprets code and display it on screen";
ans3[12]="It contains instructions for the browser to work";
ans4[12]="It is the language used to create websites";
correct[12]=4;

question[13]="What does XHTML stands for?";
ans1[13]="EXtensible Markup Language";
ans2[13]="EXtension Markup Language";
ans3[13]="EXtensional Markup Language";
ans4[13]="EXtentl Markup Language";
correct[13]=1;

question[14]="The simplest tool to start with HTML for Windows is";
ans1[14]="Notepad";
ans2[14]="SimpleText";
ans3[14]="Microsoft Word";
ans4[14]="FrontPage";
correct[14]=1;

question[15]="The tool to start HTML on Macintosh is";
ans1[15]="FrontPage";
ans2[15]="Notepad";
ans3[15]="SimpleText";
ans4[15]="TextMate";
correct[15]=3;

question[16]="The most recommended file name to \"save as\" for your homepage is";
ans1[16]="home.html";
ans2[16]="index.html";
ans3[16]="page.html";
ans4[16]="front.html";
correct[16]=2;

question[17]="The first version of HTML?";
ans1[17]="HTML2.0";
ans2[17]="HTML1.0";
ans3[17]="HTML3.0";
ans4[17]="HTML4.0";
correct[17]=1;

question[18]="In XHTML, all the elements must be in";
ans1[18]="lowercase";
ans2[18]="uppercase";
ans3[18]="bold";
ans4[18]="italic";
correct[18]=1;

question[19]="Which of the following are web primary colors?";
ans1[19]="Red, Blue, Black";
ans2[19]="Red, Yellow, Blue";
ans3[19]="Red, Green, Blue";
ans4[19]="Blue, Yellow, Green";
correct[19]=3;

question[20]="What does typography deal with?";
ans1[20]="Types of graphs";
ans2[20]="Text";
ans3[20]="Typewriters";
ans4[20]="Graphics";
correct[20]=2;

question[21]="Which file format should you save a full color photograph in?";
ans1[21]="GIF";
ans2[21]="BMP";
ans3[21]="JPEG";
ans4[21]="TXT";
correct[21]=3;

question[22]="Colors in your site";
ans1[22]="should be as colorful as possible";
ans2[22]="must be warm and vibrant";
ans3[22]="must be cool and dull";
ans4[22]="should follow a color scheme";
correct[22]=4;

question[23]="Color on different pages";
ans1[23]="should be kept different";
ans2[23]="must be exactly the same";
ans3[23]="should follow the color scheme";
ans4[23]="must follow the your preference";
correct[23]=3;

question[24]="What colors are best for background and text";
ans1[24]="Both light colors";
ans2[24]="Both dark colors";
ans3[24]="Both contrasting colors";
ans4[24]="Both very colorful";
correct[24]=3;

question[25]="Leading is";
ans1[25]="the vertical space between text";
ans2[25]="the horizontal space between words";
ans3[25]="the space from paragraph to paragraph";
ans4[25]="the space from text to the side of the screen";
correct[25]=1;

question[26]="A splash page is";
ans1[26]="the index page";
ans2[26]="the page prior to the main page";
ans3[26]="the main page";
ans4[26]="a sub-page";
correct[26]=2;

question[27]="Which type of scripting is allowed in TQ?";
ans1[27]="Client-side only";
ans2[27]="Server-side only";
ans3[27]="All of the above";
ans4[27]="None of the above";
correct[27]=1;

question[28]="JavaScript allows sites to have";
ans1[28]="search engine";
ans2[28]="form validation";
ans3[28]="dynamic content like random fact";
ans4[28]="All of the above";
correct[28]=4;

question[29]="Interactivity should be used because";
ans1[29]="it makes learning fun";
ans2[29]="it engages the user";
ans3[29]="it helps the user remember content better";
ans4[29]="All of the above";
correct[29]=4;

question[30]="Flash, compared to JavaScript, offers";
ans1[30]="client-side scripting";
ans2[30]="dynamic content";
ans3[30]="video and audio";
ans4[30]="interactive content";
correct[30]=3;

question[31]="Dreamweaver is a";
ans1[31]="commercial web-building program";
ans2[31]="open-source web-building program";
ans3[31]="commercial image-editing program";
ans4[31]="open-source image-editing program";
correct[31]=1;

question[32]="GIMP is a";
ans1[32]="commercial web-building program";
ans2[32]="open-source web-building program";
ans3[32]="commercial image-editing program";
ans4[32]="open-source image-editing program";
correct[32]=4;

question[33]="Amaya is developed by";
ans1[33]="Adobe";
ans2[33]="Amaya";
ans3[33]="W3C";
ans4[33]="W3Schools";
correct[33]=3;

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);});
	}
	}
}
