<!--
// Global variables
// =======================================================================================================

// Modules
// -----------------
QArray = new Array();       	// Array to hold subject questions
AArray = new Array();	    	// Array to hold answers to questions
DArray = new Array();     		// Array to hold word definitions
QAnsArray = new Array();		// Array to hold values for whether a question has been previously answered
ACorrectArray = new Array();	// Array to hold values for whether a question had been answered correctly
InputFldArray = new Array();	// Array to hold flag if an input type question has been answered
InputFldValArray = new Array(); // Array to hold the value contained in input question fields

dobj		 = "";				// Element of Dragable item
qImageSrc    = "";				// Used to source any images associates with questions
canswer		 = 0; 				// Element number of correct answer
scoreHolder  = 0; 				// Keeps track of score
numberOfQuestions = 0; 			// Number of questions 
qAnswered 	 = 0; 				// Number of questions answered
numCorrect   = 0;				// Number of correctly answered questions
questionId   = 0; 				// Id specific to a question
xMousePos    = 0; 				// Horizontal position of the mouse on the screen
yMousePos    = 0; 				// Vertical position of the mouse on the screen
xMousePosMax = 0; 				// Width of the page
yMousePosMax = 0; 				// Height of the page
isdrag 		 = false;			// Determines the drag state of dragable items	

// Fade Effect
// -----------------
fadePage    = "";				// Stores the name of the page that uses the Fade effect
imgCounter  = 0;				// Stores the number of pictures to be used for the Fade effect
swapCounter = 2;				// Controls the picture swapping from background to div for Fade effect
preloadChk  = 1;				// Flags the pre-loading of images to be used in the Fade effect

// Cross-Browser variables
// =========================================================================================================
ie = document.all;								// Internet Explorer Check
ff = document.getElementById&&!document.all;	// Mozilla Firefox Check

document.onmousemove = captureMousePosition;
document.onmouseup = new Function("isdrag=false");

function validateCalendar()
{
	var initStr  = "Click here to select start date";
	var initStr2 = "Click here to select end date";
	var errorMsg = document.getElementById('error');
	var date1 = document.getElementById('date');
	var date2 = document.getElementById('date2');
	if(date1.value == initStr || date2.value == initStr2)
	{
		errorMsg.style.display = "inline";
		errorMsg.innerHTML = "Select Start &amp; End date";
		return false;
	}else{
		var dateArr1 = date1.value.split("-");
		var dateArr2 = date2.value.split("-");
		if(dateArr1[0] > dateArr2[0])
		{
			errorMsg.style.display = "inline";
			errorMsg.innerHTML = "Start date greater than End date";
			return false;
		}else{
			if(dateArr1[1] > dateArr2[1])
			{
				errorMsg.style.display = "inline";
				errorMsg.innerHTML = "Start date greater than End date";
				return false;
			}else{
				if((dateArr1[1] == dateArr2[1]) && (dateArr1[2] > dateArr2[2]))
				{
					errorMsg.style.display = "inline";
					errorMsg.innerHTML = "Start date greater than End date";
					return false;
				}else{
					return true;
				}
			}
		}
	}
}

// [FORM] Function that handles the reset of forms.
// ---------------------------------------------------------------------
function clearFrm()
{    
  	var type = null;   
	if(document.getElementById('errorRow')) document.getElementById('errorRow').style.display = "none";
  	for(x=0; x<document.forms.length; x++)
	{     
    	for(y=0; y<document.forms[x].elements.length; y++)
		{   
      		type = document.forms[x].elements[y].type;    
     		switch(type)
			{   
        		case "text":   
        		case "textarea":   
        		case "password":   
          				document.forms[x].elements[y].value = "";   
          				break;   
        		case "radio":   
        		case "checkbox":   
          				document.forms[x].elements[y].checked = "";   
         				break;   
        		case "select-one":   
          				document.forms[x].elements[y].options[0].selected = true;   
          				break;   
        		case "select-multiple":   
          				for (z=0; z<document.forms[x].elements[y].options.length; z++)
						{   
            				document.forms[x].elements[y].options[z].selected = false;   
          				}   
        				break;   
      		}   
    	}   
  	}   
}  

// Filters a table-list based on what is entered in an input field.
// ---------------------------------------------------------------------
function filter(term, _id, cellNr)
{
	var suche = term.value.toLowerCase();
	var table = document.getElementById(_id);
	var ele;
	var recordCnt = 0;
	
	for(var r = 1; r < table.rows.length; r++)
	{
		ele = table.rows[r].cells[cellNr].innerHTML.replace(/<[^>]+>/g,"");
		if(ele.toLowerCase().indexOf(suche)>=0 )
		{
			table.rows[r].style.display = '';
			recordCnt++;
		}else{
			table.rows[r].style.display = 'none';
		}
	}
	document.getElementById("filtCount").innerHTML = recordCnt;
}

// Function that enables/disables a checkbox based on parent status.
// ---------------------------------------------------------------------
function enableCheckBox_1(parent,id)
{
	if(document.getElementById(parent).checked==true)
	{
		document.getElementById(id).checked = true;
		document.getElementById(id).disabled = true;
	}else{
		document.getElementById(id).disabled = false;
	}
}

function enableCheckBox(msg,chkbox1,chkbox2)
{
	document.getElementById(chkbox1).disabled = false;
	document.getElementById(chkbox2).disabled = false;
	return confirmBox(msg);
}

// [ADMIN] Function that handles altering edit frm to add event frm.
// ---------------------------------------------------------------------
function editToAdd()
{
	clearFrm();
	if(document.getElementById('addEFrm'))
	{
		document.getElementById('site').value = "http://";
		document.getElementById('addEFrm').action='add-edit-events.php';
		document.getElementById('submitForm').value='Create Event';
		genericHide('activeCell');
		genericHide('deleteEventCell');
		genericHide('groupOptions');
	}else{
		document.getElementById('addTFrm').action='add-edit-tutor.php';
		document.getElementById('submitForm').value='Add Tutor';
		document.getElementById('hiddenFld').value='0';
		genericHide('view_schedule');
		genericHide('saveTxt');
		genericHide('deleteTutorCell');
		genericHide('activeCell');
		genericHide('usernameDiv');
		genericHide('deleteTutorCell');
		genericHide('studentIdDiv');
		genericHide('programDiv');
		genericHide('emailDiv');
		genericHide('numberDiv');
		genericHide('focusDiv');
		genericHide('specialTutoringFldSet');
	}
}

// [ADMIN] Function that handles altering the tutee frm.
// ---------------------------------------------------------------------
function tuteeFrmChange()
{
	if(document.getElementById('tuteeProgramList').selectedIndex==0)
	{
		genericHide('phoneNumberDiv');
		genericHide('eMailDiv');
		genericHide('sessionDateDiv');
	}
	if(document.getElementById('tuteeProgramList').value=="n" || document.getElementById('tuteeProgramList').value=="r" || document.getElementById('tuteeProgramList').value=="p")
	{
		genericShow('phoneNumberDiv');
		genericShow('eMailDiv');
		genericHide('sessionDateDiv');
		if(document.getElementById('tuteeProgramList').value=="p")
		{
			if(document.getElementById('numberStar')) document.getElementById('numberStar').innerHTML = "*&nbsp;";
			if(document.getElementById('emailStar')) document.getElementById('emailStar').innerHTML = "*&nbsp;";
		}else{
			if(document.getElementById('numberStar')) document.getElementById('numberStar').innerHTML = "";
			if(document.getElementById('emailStar')) document.getElementById('emailStar').innerHTML = "";
		}
	}
	if(document.getElementById('tuteeProgramList').value=="a")
	{
		genericShow('phoneNumberDiv');
		genericShow('eMailDiv');
		genericShow('sessionDateDiv');
		if(document.getElementById('numberStar')) document.getElementById('numberStar').innerHTML = "";
		if(document.getElementById('emailStar')) document.getElementById('emailStar').innerHTML = "";
	}
}

// Function that handles confirmation prompt messages.
// ---------------------------------------------------------------------
function confirmBox(msg)
{
	var r=confirm(msg);
	if(r==false) return false;
	return true;
}

function confirm_redirect(msg,redirecturl)
{
	if(confirmBox(msg) == true)
		location.href=redirecturl
}

// Function that handles prompts for event deletion.
// ---------------------------------------------------------------------
function alterDisplay(id,flag)
{
	var str = id.substr(0,1);
	if(flag==1) 
	{
		genericShow(id);
		document.getElementById(str).innerHTML = 'Hide Hours Form';
		document.getElementById(str).title = 'Hide';
		document.getElementById(str).href = 'javascript:alterDisplay("'+id+'",0);';
	}
	if(flag==0)
	{
		genericHide(id);
		document.getElementById(str).innerHTML = 'Show Hours Form';
		document.getElementById(str).title = 'Show';
		document.getElementById(str).href = 'javascript:alterDisplay("'+id+'",1);';
	}
}

// Function that hides all elements and displays selected element.
// ---------------------------------------------------------------------
function alterHideDisplay(id,cnt)
{
	for(var i=1;i<=cnt;i++)
	{
		genericHide("div"+i);
	}
	genericShow(id);
}

// [FORM] Function that handles form validation.
// ---------------------------------------------------------------------
function validFrm()
{
	var errorStr = "";
	var errorArray = new Array(0,0,0,0,0,0,0,0,0,0,0);
	if(document.getElementById('studentID') && document.getElementById("g_type").value == "i")
	{
		// EVENTS (individual registration)
		// ------------------------------------------
		
		// First Name Field
		if(document.getElementById('firstName').value=="")
			errorArray[0]=1;
		// Last Name Field
		if(document.getElementById('lastName').value=="")
			errorArray[1]=1;
		// Student ID Field
		if((document.getElementById('studentID').value=="")||(!(/^[0-9]{7}$/.test(document.getElementById('studentID').value))))
			errorArray[2]=1;
		// E-Mail Field
		if((document.getElementById('eMail').value=="")||(!(/^[-+.\w]{1,64}@[-.\w]{1,64}\.[-.\w]{2,6}$/.test(document.getElementById('eMail').value))))
			errorArray[3]=1;
		// Phone Number Field
		if((document.getElementById('phoneNumber').value=="")||(!(/^\d{10}$|^\d{3}\-\d{3}\-\d{4}$|^\d{3}\s\d{3}\s\d{4}$|^\(\d{3}\)\d{3}\-\d{4}$|^\(\d{3}\)\s\d{3}\-\d{4}$/.test(document.getElementById('phoneNumber').value))))
			errorArray[4]=1;
		// Birth Month Field
		if(document.getElementById('month').selectedIndex==0)
			errorArray[6]=1;
		// Birth Day Field
		if(document.getElementById('day').selectedIndex==0)
			errorArray[6]=1;
		// Birth Year Field
		if(document.getElementById('year').selectedIndex==0)
			errorArray[6]=1;
		// Security Code
		if(document.getElementById('security_code').value=="")
			errorArray[10]=1;
			
		if(errorArray[0]==1) errorStr = errorStr + "Please enter your First Name<br>";
		if(errorArray[1]==1) errorStr = errorStr + "Please enter your Last Name<br>";
		if(errorArray[2]==1) errorStr = errorStr + "Please enter your Student ID<br>";
		if(errorArray[3]==1) errorStr = errorStr + "Please enter your Email Address<br>";
		if(errorArray[4]==1) errorStr = errorStr + "Please enter your Phone Number<br>";
		if(errorArray[6]==1) errorStr = errorStr + "Please enter your Date of Birth<br>";
		if(errorArray[10]==1) errorStr = errorStr + "Please enter the Security Code<br>";
	}else if(document.getElementById('firstName-1') && document.getElementById("g_type").value == "g") {
		
		// EVENTS (group registration)
		// ------------------------------------------
		
		groupMembers = document.getElementById('groupCount').value;

		for(var k=1;k<=groupMembers;k++)
		{
			
			// First Name Field
			if(document.getElementById('firstName-'+k).value=="")
				errorArray[0]=1;
				
			// Last Name Field
			if(document.getElementById('lastName-'+k).value=="")
				errorArray[1]=1;
				
			// Student ID
			if(g_studentid == "1") 
			{
				if((document.getElementById('studentID-'+k).value=="")||(!(/^[0-9]{7}$/.test(document.getElementById('studentID-'+k).value))))
				errorArray[2]=1;
			}
			
			// Email
			if(g_email == "1") 
			{
				if((document.getElementById('eMail-'+k).value=="")||(!(/^[-+.\w]{1,64}@[-.\w]{1,64}\.[-.\w]{2,6}$/.test(document.getElementById('eMail-'+k).value))))
				errorArray[3]=1;
			}
			
			// Phone Number
			if(g_phonenumber == "1") 
			{
				if((document.getElementById('phoneNumber-'+k).value=="")||(!(/^\d{10}$|^\d{3}\-\d{3}\-\d{4}$|^\d{3}\s\d{3}\s\d{4}$|^\(\d{3}\)\d{3}\-\d{4}$|^\(\d{3}\)\s\d{3}\-\d{4}$/.test(document.getElementById('phoneNumber-'+k).value))))
				errorArray[4]=1;
			}
			
		}
		
		// Security Code
		if(document.getElementById('security_code').value=="")
			errorArray[10]=1;
		
		if(errorArray[0]==1) errorStr = errorStr + "Please enter all group member First Names<br>";
		if(errorArray[1]==1) errorStr = errorStr + "Please enter all group member Last Names<br>";
		if(errorArray[2]==1) errorStr = errorStr + "Please enter all group member Student IDs<br>";
		if(errorArray[3]==1) errorStr = errorStr + "Please enter all group member Email Addresses<br>";
		if(errorArray[4]==1) errorStr = errorStr + "Please enter all group member Phone Numbers<br>";
		if(errorArray[10]==1) errorStr = errorStr + "Please enter the Security Code<br>";

	}else if(document.getElementById('oth')){
		// Hour Logging Field
		var regExp = /^\d{1,2}$|^\d{1,2}\.5$/;
		for(var i=1;i<=14;i++)
		{
			if(document.getElementById('d-1'))
			{
				if((document.getElementById('d-'+i).value!="") && !(regExp.test(document.getElementById('d-'+i).value)))
				{
					errorArray[0]=1;
					break;
				}
			}
			if(document.getElementById('p-1'))
			{
				if((document.getElementById('p-'+i).value!="") && !(regExp.test(document.getElementById('p-'+i).value)))
				{
					errorArray[0]=1;
					break;
				}
			}
			if(document.getElementById('n-1'))
			{
				if((document.getElementById('n-'+i).value!="") && !(regExp.test(document.getElementById('n-'+i).value)))
				{
					errorArray[0]=1;
					break;
				}
			}
			if(document.getElementById('r-1'))
			{
				if((document.getElementById('r-'+i).value!="") && !(regExp.test(document.getElementById('r-'+i).value)))
				{
					errorArray[0]=1;
					break;
				}
			}
			if(document.getElementById('a-1'))
			{
				if((document.getElementById('a-'+i).value!="") && !(regExp.test(document.getElementById('a-'+i).value)))
				{
					errorArray[0]=1;
					break;
				}
			}
		}
		regExp = /^\d{1,2}$/;
		if(document.getElementById('d-ccount'))
		{
			if((document.getElementById('d-ccount').value!="") && !(regExp.test(document.getElementById('d-ccount').value)))
				errorArray[1]=1;
		}
		if(document.getElementById('p-ccount'))
		{
			if((document.getElementById('p-ccount').value!="") && !(regExp.test(document.getElementById('p-ccount').value)))
				errorArray[1]=1;
		}
		if(document.getElementById('n-ccount'))
		{
			if((document.getElementById('n-ccount').value!="") && !(regExp.test(document.getElementById('n-ccount').value)))
				errorArray[1]=1;
		}
		if(document.getElementById('r-ccount'))
		{
			if((document.getElementById('r-ccount').value!="") && !(regExp.test(document.getElementById('r-ccount').value)))
				errorArray[1]=1;
		}
		if(document.getElementById('a-ccount'))
		{
			if((document.getElementById('a-ccount').value!="") && !(regExp.test(document.getElementById('a-ccount').value)))
				errorArray[1]=1;
		}
		if(document.getElementById('d-pcount'))
		{
			if((document.getElementById('d-pcount').value!="") && !(regExp.test(document.getElementById('d-pcount').value)))
				errorArray[1]=1;
		}
		if(document.getElementById('p-pcount'))
		{
			if((document.getElementById('p-pcount').value!="") && !(regExp.test(document.getElementById('p-pcount').value)))
				errorArray[1]=1;
		}
		if(document.getElementById('n-pcount'))
		{
			if((document.getElementById('n-pcount').value!="") && !(regExp.test(document.getElementById('n-pcount').value)))
				errorArray[1]=1;
		}
		if(document.getElementById('r-pcount'))
		{
			if((document.getElementById('r-pcount').value!="") && !(regExp.test(document.getElementById('r-pcount').value)))
				errorArray[1]=1;
		}
		if(document.getElementById('a-pcount'))
		{
			if((document.getElementById('a-pcount').value!="") && !(regExp.test(document.getElementById('a-pcount').value)))
				errorArray[1]=1;
		}
		if(errorArray[0]==1) errorStr = errorStr + "Please input a correct hour format<br>";
		if(errorArray[1]==1) errorStr = errorStr + "Please enter a valid format for Students Helped<br>";
	}else if(document.getElementById('tuteeFName')){
		// Tutor Select Field
		if(document.getElementById('tutorList').value=="empty")
			errorArray[0]=1;
		// Tutee Type Select Field
		if(document.getElementById('tuteeProgramList').value=="empty")
			errorArray[1]=1;
		// First Name Field
		if(document.getElementById('tuteeFName').value=="")
			errorArray[2]=1;
		// Last Name Field
		if(document.getElementById('tuteeLName').value=="")
			errorArray[3]=1;
		if(document.getElementById('sessionDateDiv').style.display!="none")
		{
			// Session Month/Day Field
			if(document.getElementById('smonth').selectedIndex==0 || document.getElementById('sday').selectedIndex==0)
				errorArray[4]=1;
		}
		if(document.getElementById('eMailDiv').style.display!="none")
		{
			// E-Mail Field
			if(document.getElementById('tuteeEMail').value!="" || document.getElementById('tuteeProgramList').value=="p")
				if(!(/^[-+.\w]{1,64}@[-.\w]{1,64}\.[-.\w]{2,6}$/.test(document.getElementById('tuteeEMail').value)))
					errorArray[5]=1;
			// Phone Number Field
			if(document.getElementById('tuteePNum').value!="" || document.getElementById('tuteeProgramList').value=="p")
				if(!(/^\d{10}$|^\d{3}\-\d{3}\-\d{4}$|^\d{3}\s\d{3}\s\d{4}$|^\(\d{3}\)\d{3}\-\d{4}$|^\(\d{3}\)\s\d{3}\-\d{4}$/.test(document.getElementById('tuteePNum').value)))
					errorArray[6]=1;
		}
		if(errorArray[0]==1) errorStr = errorStr + "Please select a Tutor<br>";
		if(errorArray[1]==1) errorStr = errorStr + "Please select a Tutee Type<br>";
		if(errorArray[2]==1) errorStr = errorStr + "Please enter Tutees First Name<br>";
		if(errorArray[3]==1) errorStr = errorStr + "Please enter Tutees Last Name<br>";
		if(errorArray[4]==1) errorStr = errorStr + "Please enter the session date for which you tutored<br>";
		if(errorArray[5]==1) errorStr = errorStr + "Please enter Tutees E-Mail Address<br>";
		if(errorArray[6]==1) errorStr = errorStr + "Please enter Tutees Phone Number<br>";
	}else if(document.getElementById('tuteeFirstName')){
		// Tutee Program List
		if(document.getElementById('tuteeProgramList').value=="empty")
			errorArray[0]=1;
		// First Name Field
		if(document.getElementById('tuteeFirstName').value=="")
			errorArray[1]=1;
		// Last Name Field
		if(document.getElementById('tuteeLastName').value=="")
			errorArray[2]=1;
		if(document.getElementById('sessionDateDiv').style.display!="none")
		{
			// Session Month/Day Field
			if(document.getElementById('smonth').selectedIndex==0 || document.getElementById('sday').selectedIndex==0)
				errorArray[3]=1;
		}
		if(document.getElementById('eMailDiv').style.display!="none")
		{
			// E-Mail Field
			if(document.getElementById('tuteeEMail').value!="" || document.getElementById('tuteeProgramList').value=="p")
				if(!(/^[-+.\w]{1,64}@[-.\w]{1,64}\.[-.\w]{2,6}$/.test(document.getElementById('tuteeEMail').value)))
					errorArray[4]=1;
			// Phone Number Field
			if(document.getElementById('tuteePNum').value!="" || document.getElementById('tuteeProgramList').value=="p")
				if(!(/^\d{10}$|^\d{3}\-\d{3}\-\d{4}$|^\d{3}\s\d{3}\s\d{4}$|^\(\d{3}\)\d{3}\-\d{4}$|^\(\d{3}\)\s\d{3}\-\d{4}$/.test(document.getElementById('tuteePNum').value)))
					errorArray[5]=1;
		}
		if(errorArray[0]==1) errorStr = errorStr + "Please select Tutees Academic Program<br>";
		if(errorArray[1]==1) errorStr = errorStr + "Please enter Tutees First Name<br>";
		if(errorArray[2]==1) errorStr = errorStr + "Please enter Tutees Last Name<br>";
		if(errorArray[3]==1) errorStr = errorStr + "Please enter the session date for which you tutored<br>";
		if(errorArray[4]==1) errorStr = errorStr + "Please enter Tutees Phone Number<br>";
		if(errorArray[5]==1) errorStr = errorStr + "Please enter Tutees E-Mail Address<br>";
	}else if(document.getElementById('FName')){
		// First Name Field
		if(document.getElementById('FName').value=="")
			errorArray[0]=1;
		// Last Name Field
		if(document.getElementById('LName').value=="")
			errorArray[1]=1;
		if(errorArray[0]==1) errorStr = errorStr + "Please enter Tutors First Name<br>";
		if(errorArray[1]==1) errorStr = errorStr + "Please enter Tutors Last Name<br>";
	}else if(document.getElementById('eventName')){
		// Event Name Field
		if(document.getElementById('eventName').value=="")
			errorArray[0]=1;
		// Deadline Month Field
		if(document.getElementById('dmonth').selectedIndex==0)
			errorArray[1]=1;
		// Deadline Day Field
		if(document.getElementById('dday').selectedIndex==0)
			errorArray[1]=1;
		// Event Month Field
		if(document.getElementById('month').selectedIndex==0)
			errorArray[2]=1;
		// Event Day Field
		if(document.getElementById('day').selectedIndex==0)
			errorArray[2]=1;
		// Event Hour Field
		if(document.getElementById('hour').selectedIndex==0)
			errorArray[3]=1;
		// Event Minutes Field
		if(document.getElementById('minutes').selectedIndex==0)
			errorArray[3]=1;
		// Event Location
		if(document.getElementById('location').value=="")
			errorArray[4]=1;
		if(errorArray[0]==1) errorStr = errorStr + "Please enter an Event Name<br>";
		if(errorArray[1]==1) errorStr = errorStr + "Please select the Event Sign-up Deadline<br>";
		if(errorArray[2]==1) errorStr = errorStr + "Please select the Event Date<br>";
		if(errorArray[3]==1) errorStr = errorStr + "Please select the Event Time<br>";
		if(errorArray[4]==1) errorStr = errorStr + "Please enter the Event Location<br>";
	}else if(document.getElementById('tutPwd')){
		// Student ID Field
		if((document.getElementById('student_ID').value=="")||(!(/[0-9]{7}/.test(document.getElementById('student_ID').value))))
			errorArray[0]=1;
		// E-Mail Field
		if((document.getElementById('eMail').value=="")||(!(/^[-+.\w]{1,64}@[-.\w]{1,64}\.[-.\w]{2,6}$/.test(document.getElementById('eMail').value))))
			errorArray[1]=1;
		// Phone Number Field
		if((document.getElementById('phoneNum').value=="")||(!(/^\d{10}$|^\d{3}\-\d{3}\-\d{4}$|^\d{3}\s\d{3}\s\d{4}$|^\(\d{3}\)\d{3}\-\d{4}$|^\(\d{3}\)\s\d{3}\-\d{4}$/.test(document.getElementById('phoneNum').value))))
			errorArray[2]=1;
		// Password Field
		if(document.getElementById('tutPwd').value!="")
		{
			if(document.getElementById('tutPwd').value!=document.getElementById('tutPwd2').value)
				errorArray[4]=1;
			if(!(/[a-z0-9A-Z]/.test(document.getElementById('tutPwd').value)))
			    errorArray[5]=1;
		}
		// Academic Program Field
		if(document.getElementById('program').selectedIndex==0)
			errorArray[6]=1;
		if(errorArray[0]==1) errorStr = errorStr + "Please enter your Student ID<br>";
		if(errorArray[1]==1) errorStr = errorStr + "Please enter your Email Address<br>";
		if(errorArray[2]==1) errorStr = errorStr + "Please enter your Phone Number<br>";
		if(errorArray[4]==1) errorStr = errorStr + "Password must match in both fields<br>";
		if(errorArray[5]==1) errorStr = errorStr + "Password must be Alphanumeric<br>";
		if(errorArray[6]==1) errorStr = errorStr + "Please select your Academic Program<br>";
	}else{
		// Username Field
		if(document.getElementById('userName').value=="")
			errorArray[0]=1;
		// Password Field
		if(document.getElementById('pwd').value=="")
			errorArray[1]=1;
		if(errorArray[0]==1) errorStr = errorStr + "Please enter your Username<br>";
		if(errorArray[1]==1) errorStr = errorStr + "Please enter your Password<br>";
	}
	if(errorStr!="")
	{
		document.getElementById('errorRow').style.display = "inline";
		document.getElementById('errorMsg').innerHTML = errorStr;
		return false;
	}else{
		document.getElementById('errorRow').style.display = "none";
		return true;
	}
}

// [ADMIN] Handles the form submition to display editable events
// ---------------------------------------------------------------------
function submitFrm(id)
{
	document.getElementById(id).submit();
}

// Handles onchange event from add/edit events form (signup type)
// ---------------------------------------------------------------------
function signupTypeOnChange(selectList)
{
	if(selectList == "group")
	{
		var list = document.getElementById("groupCount");
		if(document.getElementById("group").selectedIndex == 0) {
			list.selectedIndex = 0;
			genericHide("groupOptions");
	    } else {
			list.selectedIndex = 1;
			genericShow("groupOptions");
		}
	}
	
	if(selectList == "groupCount")
	{
		var list = document.getElementById("group");
		if(document.getElementById("groupCount").selectedIndex == 0) {
			list.selectedIndex = 0;
			genericHide("groupOptions");
		} else {
			list.selectedIndex = 1;
			genericShow("groupOptions");
		}
	}
}

// Clear text input field on focus
// ---------------------------------------------------------------------
function clearOnFocus(id)
{
	document.getElementById(id).value = "";
}

// Add group member fields to registration form
// ---------------------------------------------------------------------
function addGroupMembers(val)
{
	var div = document.getElementById('teamates');
	
	    div.innerHTML = "";
		str = "";
		for(var k=2; k<=val; k++)
		{
			str += '<div class="infoBox-title">GROUP MEMBER #'+k+'</div>' +
				'<br><br><p class="grayText-dark bold inline">FIRST NAME</p><br>' +
				'<input type="text" id="firstName-'+k+'" name="firstName-'+k+'" class="txtFld-2" size="50px" maxlength="50">' +
				'<br><br><p class="grayText-dark bold inline">LAST NAME</p><br>' +
				'<input type="text" id="lastName-'+k+'" name="lastName-'+k+'" class="txtFld-2" size="50px" maxlength="50">' +
				'<br><br>';
				
		    if(g_studentid == "1") {
				str += '<div id="show_studentid">' +
                   '<br><br><p class="grayText-dark bold inline">STUDENT ID</p><br>' +
                   '<input type="text" id="studentID-'+k+'" name="studentID-'+k+'" class="txtFld-2" size="50px" maxlength="7">' +
                '</div>';
			}
			
			if(g_email == "1") {
                str += '<div id="show_email">' +
                   '<br><br><p class="grayText-dark bold inline">EMAIL</p><br>' +
                   '<input type="text" id="eMail-'+k+'" name="eMail-'+k+'" class="txtFld-2" size="50px" maxlength="100">' +
                '</div>';
			}
			
			if(g_phonenumber == "1") {
                str += '<div id="show_phonenumber">' +
                   '<br><br><p class="grayText-dark bold inline">PHONE NUMBER - WITH AREA CODE</p><br>' +
                   '<input type="text" id="phoneNumber-'+k+'" name="phoneNumber-'+k+'" class="txtFld-2" size="50px" maxlength="20">' +
                '</div>';
			}
		}
		div.innerHTML = str;
}

// Displays the event information based on which was selected by user
// ---------------------------------------------------------------------

var g_email;
var g_studentid;
var g_phonenumber;

function showEventInfo(id)
{
	genericHide("individualDiv");
	genericHide("groupDiv");
	genericHide("spaceDiv");
	
	for(var i=0;i<arr.length;i++)
	{
		document.getElementById(arr[i]).style.display = "none";
	}
	if(id != "empty") {
		document.getElementById(id+"-info").style.display = "block";
		signup_type   = document.getElementById(id+"-type").innerHTML;
		document.getElementById("g_type").value = signup_type;
		signup_limit  = document.getElementById(id+"-limit").innerHTML;
		document.getElementById("g_count").value = signup_limit;
		g_email       = document.getElementById(id+"-g_email").innerHTML;
		document.getElementById("g_email").value = g_email;
		g_studentid   = document.getElementById(id+"-g_studentid").innerHTML;
		document.getElementById("g_studentid").value = g_studentid;
		g_phonenumber = document.getElementById(id+"-g_phonenumber").innerHTML;
		document.getElementById("g_phonenumber").value = g_phonenumber;
		
		if(signup_type == "g") {
			str = '<select id="groupCount" name="groupCount" class="selectSmall-2" onchange="addGroupMembers(this.value)">';
			genericShow("groupDiv");
			
			if(g_studentid == "0") genericHide("show_studentid");
			if(g_email == "0") genericHide("show_email");
			if(g_phonenumber == "0") genericHide("show_phonenumber");
			
			limit = document.getElementById("g_count").value;

			for(var k = 1; k <= limit; k++)
			{
            	str += '<option value="'+k+'">'+k+'</option>';
			}
			str += '</select>';
			document.getElementById("groupCountDiv").innerHTML = str;
		}else{
			genericShow("individualDiv");
		}
	}
	
	if(id == "empty") {
		genericHide("miscDiv");
		genericShow("spaceDiv");
	}else 
		genericShow("miscDiv");
}

// Handles the switching of avatar displays for the tutors section
// ---------------------------------------------------------------------
function switchAvatar()
{
	var selected = document.getElementById("avatar"); 
	var val = selected.options[selected.selectedIndex].value; 
	document.getElementById('image').src='../images/miscellaneous/avatars/' + val;
}

// Parameter 1: Partial Image Path
// Parameter 2: Numbero of pictures
// [IMAGE-RANDOMIZER] Function that handles the randomizer effect on load.
// ---------------------------------------------------------------------
function imageRandomizer(path, picCount)
{
	var randomNumber = Math.ceil(Math.random()*(picCount))  // Random number between 1 and picCount
	var srcStr = "images/" + path + "-" + randomNumber + ".jpg";
	document.getElementById("imgChg").src = srcStr;
}

// Parameter 1: Page Identifier (name)
// Parameter 2: Numbero of pictures
// [FADE] Function to initilizes the images to be used in the Fade.
// ---------------------------------------------------------------------
function initImage(page, picCount) 
{
		// Initilize Globals
		// -------------------------------------
		fadePage = page;		
		imgCounter = picCount;
		
		// Pre-load Images
		// -------------------------------------
		if(preloadChk == 1)
		{ 
			var fadeImg = new Array(picCount+1);
			for(var i = 1; i <= picCount; i++)
			{
				fadeImg[i] = new Image();
				fadeImg[i].src = page + "-slide-" + i + ".jpg";
			}
			preloadChk = 0;
		}
		
  		image = document.getElementById("fade");
  		setOpacity(image, 0);
  		image.style.visibility = 'visible';
  		fadeIn("fade",0);
		swapCounter++;
}

// Parameter 1: Image Object
// Parameter 2: Opacity percentage
// [FADE] Function to set the opacity for the Fading images.
// =========================================================================================================
function setOpacity(obj, opacity) 
{
  	if(ie) obj.style.filter = "alpha(opacity:"+ opacity +")";
  	if(ff) obj.style.opacity = opacity/100;
}

// Parameter 1: Image Object ID
// Parameter 2: opacity percentage
// [FADE] Function to handles the Fade effect.
// =========================================================================================================
function fadeIn(objId,opacity) 
{
  	if(document.getElementById) 
	{
		var str;
   		obj = document.getElementById(objId);
    	if(opacity < 100) 
		{
      		setOpacity(obj, opacity);
      		opacity += 10;
      		window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
		}else if(opacity == 100){
			// Keep image in div for longer if it's full opacity
			// ----------------------------------------------------
			setOpacity(obj, opacity);
			opacity += 10;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 1000);
    	}else{
			if(swapCounter > imgCounter)
			{
				swapCounter = 1;
				str = "url(images/miscellaneous/msc-general/" + fadePage + "-slide-" + imgCounter + ".jpg) 50% 50% no-repeat";
				document.getElementById("fadeHolder").style.background = str;
				document.getElementById("fade").src = "images/miscellaneous/msc-general/" + fadePage + "-slide-" + swapCounter + ".jpg";
			}else{
				str = "url(images/miscellaneous/msc-general/" + fadePage + "-slide-" + (swapCounter - 1) + ".jpg) 50% 50% no-repeat";
				document.getElementById("fadeHolder").style.background = str;
				document.getElementById("fade").src = "images/miscellaneous/msc-general/" + fadePage + "-slide-" + swapCounter + ".jpg";
			}
			initImage(fadePage,imgCounter);
		}
  	}
}

// Function to determine the mouse coordinates relative to the viewable screen as well as to determine
// the overall screen size.
// =========================================================================================================
function captureMousePosition(e) 
{ 
   if(isdrag)
   {
		dobj.style.left = ff ? tx + e.clientX - xMousePos : tx + event.clientX - xMousePos;
		dobj.style.top  = ff ? ty + e.clientY - yMousePos : ty + event.clientY - yMousePos;
		return false;
   }else{
		if(ie) 
		{
			xMousePos = window.event.x;
			yMousePos = window.event.y;
			xMousePosMax = document.body.clientWidth;
			yMousePosMax = document.body.clientHeight;
		}
		else if(ff) 
		{
			xMousePos = e.clientX;
			yMousePos = e.clientY;
			xMousePosMax = window.innerWidth+window.pageXOffset;
			yMousePosMax = window.innerHeight+window.pageYOffset;
		}
  }
}

// Function to determine the current date & time.
// =========================================================================================================
function outDate()
{
	var dateVar;
	dateVar = new Date();
	
	var day   = dateVar.getDate();
	var month = dateVar.getMonth();
	var year  = dateVar.getFullYear();
	
	// Get Month name
	var monthArray = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
	var monthName = monthArray[month];
	var str = monthName + " " + day + ", " + year;
	
	return str;
}

// [SCIENCE-FAIR] Function to handle the deployment and operation of the important dates event module.
// =========================================================================================================
/*function eventModule()
{
	
}*/

// Parameter1: Element ID
// Function used to create a generic drag and drop effect.
// =========================================================================================================
function genericDragDrop(id)
{
  	 var fobj = document.getElementById(id);
  	 var topelement = ff ? "HTML" : "BODY";

 	 while((fobj.tagName != topelement)&&(fobj.className != id))
  	 {
		fobj = ff ? fobj.parentNode : fobj.parentElement;
 	 }

  	 if(document.getElementById(id))
     {
    	isdrag = true;
		dobj = document.getElementById(id);
		tx = parseInt(dobj.style.left);
		ty = parseInt(dobj.style.top);
		document.onmousemove = captureMousePosition;
    	return false;
  	 }
}

// Parameter1: Element ID
// Function used to hide an element.
// =========================================================================================================
function invisible(id)
{
	document.getElementById(id).style.visibility="hidden";
}

// Parameter1: Element ID
// Function used to reveal an element.
// =========================================================================================================
function visible(id)
{
	document.getElementById(id).style.visibility="visible";
}

// Parameter1: Element ID
// Parameter2: Flag (Integer accepted)
// Function used to create a generic displaying of a certain element.
// =========================================================================================================
function genericShow(id,flag)
{
	document.getElementById(id).style.display="inline";
	
	if(flag==1)
	{
		document.getElementById("questionsDisplay").innerHTML='<a href="javascript:genericHide(\'questions\',1);" class="body">Click here to hide questions</a>';
	}
}

// Parameter1: Element ID
// Parameter2: Flag (Integer accepted)
// Function used to create a generic hidding of a certain element.
// =========================================================================================================
function genericHide(id,flag)
{
	document.getElementById(id).style.display="none";
	
	if(flag==1)
	{
		document.getElementById("questionsDisplay").innerHTML='<a href="javascript:genericShow(\'questions\',1);" class="body">Click here to answer questions</a>';
	}
}

// Parameter1: Subject ID (integer accepted)
// Parameter2: Section Name (String accepted)
// [MODULES] Function used to create and build an array to store questions specific to a certain reading.
// =========================================================================================================
function buildQuestions(sid,sct)
{	
	subjectId = sid;
	section = sct;
	// Populate QArray with questions
	switch(sid)
	{
		// Biology
		case 1:
			if(sct=="bio1")
			{
				numberOfQuestions = 5;
				QArray[0] = "1. Many species live in a community.";
				QArray[1] = "2. Abiotic Factors are:";
				QArray[2] = "3. Plants are called decomposers.";
				QArray[3] = "4. Which type of symbiosis is beneficial to only one partner?";
				QArray[4] = "5. Plants convert the energy of the sun into glucose through which process?";
			}else if(sct=="bio2"){
				numberOfQuestions = 5;
				QArray[0] = "1. Without reproduction, there would still be life on Earth.";
				QArray[1] = "2. DNA is a type of fatty acid.";
				QArray[2] = "3. Protein sequences on the DNA molecule are called:";
				QArray[3] = "4. Simple organisms reproduce by:";
				QArray[4] = "5. When a cell contains only half of the genetic material needed for an organism, it is called a:";
			}else if(sct=="bio3"){
				numberOfQuestions = 3;
				QArray[0] = "1. There are only two systems that regulate the body:";
				QArray[1] = "2. The Central Nervous System (CNS) contains:";
				QArray[2] = "3. When a protein imbedded into a cell membrane transports material across a cell membrane and up the concetration gradient, this is called:";
			}else{
				numberOfQuestions = 10;
				QArray[0] = "1. I do not have the same DNA as my mother.";
				QArray[1] = "2. Meiosis occurs in asexual reproduction.";
				QArray[2] = "3. Organisms that obtain their energy by feeding on other organisms are called:";
				QArray[3] = "4. A small fish called a remora attached itself on a shark. When the shark feeds, the remora eats the scraps. The shark does not benefit from this relationship but will not eat the remora. This relationship is called:";
				QArray[4] = "5. The nose, the lungs, the diaphragm and the alveoli belong to which system?";
				QArray[5] = "6. Amino acids make polypetides using what type of bonds?";
				QArray[6] = "7. What is the basic unit of life?";
				QArray[7] = "8. When does fermentation occur?";
				QArray[8] = "9. Worms are a good example of:";
				QArray[9] = "10. Which organism is at the top of the following food chain: Grass---> Mouse----> Snake----> Eagle";
			}
			break;
		// Chemistry
		case 2:
			if(sct=="chem1")
			{
				numberOfQuestions = 3;
				QArray[0] = "1. What type of errors are responsible for reducing the percent yield?";
				QArray[1] = "2. A stock solution is:";
				QArray[2] = "3. The percent yield shows:";
			}else if(sct=="chem2"){
				numberOfQuestions = 5;
				QArray[0] = "1. Fossil fuels are the major cause of the Greenhouse Effect.";
				QArray[1] = "2. Eutrophication is caused by free radicals.";
				QArray[2] = "3. Detergents contain nitrogen.";
				QArray[3] = "4. Most people think that we should use nuclear energy.";
				QArray[4] = "5. By planting trees in cities, we can diminish the effects of black body radiation.";
			}else{
				numberOfQuestions = 7;
				QArray[0] = "1. How many elements are present in HCN?";
				QArray[1] = "2. In the periodic table, elements are arranged in order of increasing:";
				QArray[2] = "3. Which of the following is not an empirical formula? ";
				QArray[3] = "4. Which of the following elements is non reactive?";
				QArray[4] = "5. Alkaline metals will usually react in the following way:";
				QArray[5] = "6. When measuring temperatures in chemistry, we use:";
				QArray[6] = "7. Carbon and Chlorine are two non-metals. What type of bonding will occur between them?";
			}
			break;
		// Mathematics
		case 3:
			if(sct=="math1")
			{
				numberOfQuestions = 3;
				QArray[0] = "1. Natural numbers are positive.";
				QArray[1] = "2. Negative numbers are whole numbers.";
				QArray[2] = "3. Rational numbers include all numbers.";
			}else if(sct=="math2"){
				numberOfQuestions = 3;
				QArray[0] = "1. In 8^5, 5 is the base.";
				QArray[1] = "2. 8^3 means the number 8 is multiplied 8 times (8x8x8).";
				QArray[2] = "3. Deviation means how much a number will not change from a certain distribution.";
			}else if(sct=="math3"){
				numberOfQuestions = 3;
				QArray[0] = "1. y = mx+c is an example of a quadratic formula.";
				QArray[1] = "2. A graph represents a formula.";
				QArray[2] = "3. In a function, for every solution in y, there are many solutions in x.";
			}else if(sct=="math4"){
				numberOfQuestions = 3;
				QArray[0] = "1. The y-intercept is the point at which the graph intersects with the y- axis.";
				QArray[1] = "2. In the image below, there are two x-intercepts.";
				QArray[2] = "3. In the image below, A is on the:";
			}else{
				numberOfQuestions = 11;
				QArray[0] = "1. Which of the following numbers are integers? -4, 3/2, 18, -7/8, 0. If there is more than one answer, separate them by a comma (virgule).";
				QArray[1] = "2. 2^6 = ?";
				QArray[2] = "3. Which of the following inequalities is true?";
				QArray[3] = "4. On the following line segment, which letter represents the midpoint? ";
				QArray[4] = "5. Solve for x: x<sup>2</sup>-x-6. Express your answer in the form ..., ...";
				QArray[5] = "6. Solve for x: (x-4)<sup>2</sup>-1.Express your answer in the form ..., ... Hint: Square the binomial and simplify, then factorize.";
				QArray[6] = "7. How many axes exist in the coordinate plane?";
				QArray[7] = "8. This is the graph of a function.";
				QArray[8] = "9. Write an equation in the form y=mx+c for the following graph:";
				QArray[9] = "10. In Question 9, what is the slope?";
				QArray[10] = "11. In Question 9, what is the y-intercept?";
			}
			break;
		// Physics
		case 4:
			if(sct=="phys1")
			{
				numberOfQuestions = 5;
				QArray[0] = "1. Because it has a distance and a direction, displacement is a _____?";
				QArray[1] = "2. Which force insures that the roller coaster stays on the loop?";
				QArray[2] = "3. Jen's position at any one time during rotation is called _____?";
				QArray[3] = "4. If Valerie used a different type of bungee cord, what would be different?";
				QArray[4] = "5. Torque is produced...";
			}else{
				numberOfQuestions = 10;
				QArray[0] = "1. A 15kg box is moving to the right across the floor being pushed by a force directed downwards at an angle of 30º to the horizontal as shown in the image below. It takes a force F=50N just to keep it going at a constant velocity of 2m/s. What is the force of friction between the box and the floor? (Use 3 significant figures and watch your units!)";
				QArray[1] = "2. A 15kg box is moving to the right across the floor being pushed by a force directed downwards at an angle of 30º to the horizontal as shown in the image below. Is it kinetic or static friction?";
				QArray[2] = "3. A 15kg box is moving to the right across the floor being pushed by a force directed downwards at an angle of 30º to the horizontal as shown in the image below. Determine the normal force N. (Use 3 significant figures).";
				QArray[3] = "4. A 15kg box is moving to the right across the floor being pushed by a force directed downwards at an angle of 30º to the horizontal as shown in the image below. If the pushing force F is increased to 125N, what is the acceleration of the box? (Watch your significant figures and units!) ";
				QArray[4] = "5. If you push an object just as far while applying twice the force, you do:";
				QArray[5] = "6. Which requires more work: lifting a 50kg sack vertically 2m or lifting a 25kg sack vertically 4m?";
				QArray[6] = "7. A 2kg mass has 40J of potential energy with respect to the ground. Approximately how far is it located above the ground? Use g= 10N/kg";
				QArray[7] = "8. A car moves 4 times as fast as another identical car. Compared to the slower car, the faster has:";
				QArray[8] = "9. When a book acted upon by a force of 60N moves a distance of 0.3m in the direction of the force, what is the work done? (Don't forget your units!)";
				QArray[9] = "10. A car is travelling at 36m/s when it passes a police car at rest. The policewoman immediately accelerates at 1.67m/s^2. How long does it take her to catch up with the speeder? (Don't forget your units!)";
			}
			break;
		default:	
	}
	QandAArray = new Array(numberOfQuestions);
	document.getElementById("questhere").innerHTML=QArray[0];
	buildAnswers(sid,sct,0);
}

// Parameter1: Subject ID (Integer accepted)
// Parameter2: Section Name (String accepted)
// Parameter3: Question ID (Integer accepted)
// [MODULES] Function used to create and build an array to hold all possible answers relating to a certain question.
// =========================================================================================================
function buildAnswers(sid,sct,qid)
{
	var counter = 0;	// Counter to keep track of how many answer listings exist per question
	var answer;
	var str = "";
	var inputId;
	var chkBtn;
	questionId = qid;
	qImageSrc = "";
	
	// Populate AArray with answer to questions
	switch(sid)
	{
		// Biology
		case 1:
			if(sct=="bio1")
			{
				switch(qid)
				{
					case 0:
						counter = 2;
						canswer = 0;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 1:
						counter = 2;
						canswer = 0;
						AArray[0] = "Non-living variables";
						AArray[1] = "Living variables";
						break;
					case 2:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 3:
						counter = 2;
						canswer = 0;
						AArray[0] = "Commensalism";
						AArray[1] = "Mutualism";
						break;
					case 4:
						counter = 2;
						canswer = 1;
						AArray[0] = "Cellular respiration";
						AArray[1] = "Photosynthesis";
						break;
					default:
				}
			}else if(sct=="bio2"){
				switch(qid)
				{
					case 0:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 1:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 2:
						counter = 2;
						canswer = 1;
						AArray[0] = "Molecules";
						AArray[1] = "Genes";
						break;
					case 3:
						counter = 2;
						canswer = 0;
						AArray[0] = "Mitosis";
						AArray[1] = "Meiosis";
						break;
					case 4:
						counter = 2;
						canswer = 0;
						AArray[0] = "Gamete";
						AArray[1] = "Embryo";
						break;
					default:
				}
			}else if(sct=="bio3"){
				switch(qid)
				{
					case 0:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 1:
						counter = 4;
						canswer = 2;
						AArray[0] = "The brain";
						AArray[1] = "The spine and neurons";
						AArray[2] = "The brain and spine";
						AArray[3] = "Neurons";
						break;
					case 2:
						counter = 3;
						canswer = 0;
						AArray[0] = "Active transport";
						AArray[1] = "Diffusion";
						AArray[2] = "Facilitated transport";
						break;
					default:
				}
			}else{
				switch(qid)
				{
					case 0:
						counter = 2;
						canswer = 0;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 1:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 2:
						counter = 2;
						canswer = 1;
						AArray[0] = "Producers";
						AArray[1] = "Consumers";
						break;
					case 3:
						counter = 2;
						canswer = 1;
						AArray[0] = "Mutalism";
						AArray[1] = "Commensalism";
						break;
					case 4:
						counter = 4;
						canswer = 3;
						AArray[0] = "Nervous System";
						AArray[1] = "Digestive System";
						AArray[2] = "Circulatory System";
						AArray[3] = "Respiratory System";
						break;
					case 5:
						counter = 2;
						canswer = 0;
						AArray[0] = "Peptide bonds";
						AArray[1] = "Hydrogen bonds";
						break;
					case 6:
						counter = 2;
						canswer = 1;
						AArray[0] = "The sun";
						AArray[1] = "The cell";
						break;
					case 7:
						counter = 2;
						canswer = 0;
						AArray[0] = "When there is not enough oxygen available for cellular respiration";
						AArray[1] = "In plants during photosynthesis";
						break;
					case 8:
						counter = 4;
						canswer = 2;
						AArray[0] = "Primary Producers";
						AArray[1] = "Parasites";
						AArray[2] = "Decomposers";
						AArray[3] = "Snakes";
						break;
					case 9:
						counter = 4;
						canswer = 3;
						AArray[0] = "Grass";
						AArray[1] = "Mouse";
						AArray[2] = "Snake";
						AArray[3] = "Eagle";
						break;
					default:
				}
			}
			break;
		// Chemistry
		case 2:
			if(sct=="chem1")
			{
				switch(qid)
				{
					case 0:
						counter = 4;
						canswer = 2;
						AArray[0] = "Random";
						AArray[1] = "Systematic";
						AArray[2] = "Both A and B";
						AArray[3] = "None of the above";
						break;
					case 1:
						counter = 4;
						canswer = 1;
						AArray[0] = "A very big solution";
						AArray[1] = "A solution that has been prepared in advance";
						AArray[2] = "A chemical reaction";
						AArray[3] = "Copper";
						break;
					case 2:
						counter = 2;
						canswer = 0;
						AArray[0] = "The percent yield relates the actual yield (or actual amount of product obtained) to the theoretical yield (calculated/expected amount of products)";
						AArray[1] = "The products";
						break;
					default:
				}
			}else if(sct=="chem2"){
				switch(qid)
				{
					case 0:
						counter = 2;
						canswer = 0;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 1:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 2:
						counter = 2;
						canswer = 0;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 3:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 4:
						counter = 2;
						canswer = 0;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					default:
				}
			}else{
				switch(qid)
				{
					case 0:
						counter = 3;
						canswer = 2;
						AArray[0] = "1";
						AArray[1] = "2";
						AArray[2] = "3";
						break;
					case 1:
						counter = 4;
						canswer = 0;
						AArray[0] = "Atomic number";
						AArray[1] = "Atomic mass";
						AArray[2] = "Number of valence electrons";
						AArray[3] = "Electronegativity";
						break;
					case 2:
						counter = 2;
						canswer = 0;
						AArray[0] = "Na<sub>2</sub>S<sub>2</sub>O<sub>8</sub>";
						AArray[1] = "CCl<sub>4</sub>";
						break;
					case 3:
						counter = 4;
						canswer = 2;
						AArray[0] = "Lithium";
						AArray[1] = "Oxygen";
						AArray[2] = "Neon";
						AArray[3] = "Carbon";
						break;
					case 4:
						counter = 2;
						canswer = 0;
						AArray[0] = "Lose one valence electron";
						AArray[1] = "Gain one valence electron";
						break;
					case 5:
						counter = 2;
						canswer = 0;
						AArray[0] = "Kelvin";
						AArray[1] = "Celcius";
						break;
					case 6:
						counter = 2;
						canswer = 1;
						AArray[0] = "Ionic";
						AArray[1] = "Covalent";
						break;
					default:
				}
			}
			break;
		// Mathematics
		case 3:
			if(sct=="math1")
			{
				switch(qid)
				{
					case 0:
						counter = 2;
						canswer = 0;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 1:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 2:
						counter = 2;
						canswer = 0;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					default:
				}
			}else if(sct=="math2"){
				switch(qid)
				{
					case 0:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 1:
						counter = 2;
						canswer = 0;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 2:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					default:
				}
			}else if(sct=="math3"){
				switch(qid)
				{
					case 0:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 1:
						counter = 2;
						canswer = 0;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 2:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					default:
				}
			}else if(sct=="math4"){
				switch(qid)
				{
					case 0:
						counter = 2;
						canswer = 0;
						AArray[0] = "True";
						AArray[1] = "False";
						break;
					case 1:
						counter = 2;
						canswer = 0;
						AArray[0] = "True";
						AArray[1] = "False";
						qImageSrc = "math-graph.jpg";
						break;
					case 2:
						counter = 2;
						canswer = 1;
						AArray[0] = "X-Axis";
						AArray[1] = "Y-Axis";
						qImageSrc = "math-graph.jpg";
						break;
					default:
				}
			}else{
				switch(qid)
				{
					case 0:
						canswer = 99;
						AArray[0] = "-4, 18, 0";
						break;
					case 1:
						canswer = 99;
						AArray[0] = "64";
						break;
					case 2:
						counter = 2;
						canswer = 1;
						AArray[0] = "7 < 2^2 + 3";
						AArray[1] = "7 &le; 2^2 + 3";
						break;
					case 3:
						counter = 3;
						canswer = 2;
						AArray[0] = "A";
						AArray[1] = "B";
						AArray[2] = "C";
						qImageSrc = "math-midpoint.jpg";
						break;
					case 4:
						canswer = 99;
						AArray[0] = "3, - 2";
						break;
					case 5:
						canswer = 99;
						AArray[0] = "3, 5";
						break;
					case 6:
						canswer = 99;
						AArray[0] = "2";
						break;
					case 7:
						counter = 2;
						canswer = 1;
						AArray[0] = "True";
						AArray[1] = "False";
						qImageSrc = "math-function-graph.jpg";
						break;
					case 8:
						canswer = 99;
						AArray[0] = "y=2/3x + 1";
						qImageSrc = "math-graph-2.jpg";
						break;
					case 9:
						canswer = 99;
						AArray[0] = "2/3";
						break;
					case 10:
						canswer = 99;
						AArray[0] = "1";
						break;
					default:
				}
			}
			break;
		// Physics
		case 4:
			if(sct=="phys1")
			{
				switch(qid)
				{
					case 0:
						counter = 2;
						canswer = 1;
						AArray[0] = "Scalar";
						AArray[1] = "Vector";
						break;
					case 1:
						counter = 2;
						canswer = 0;
						AArray[0] = "Centripetal acceleration";
						AArray[1] = "Gravitational potential energy";
						break;
					case 2:
						counter = 2;
						canswer = 1;
						AArray[0] = "Spring constant";
						AArray[1] = "Angular position";
						break;
					case 3:
						counter = 2;
						canswer = 1;
						AArray[0] = "Gravitational potential energy";
						AArray[1] = "Spring constant";
						break;
					case 4:
						counter = 4;
						canswer = 2;
						AArray[0] = "When a person jumps in the air";
						AArray[1] = "During an impulse";
						AArray[2] = "By applying force on a length";
						AArray[3] = "When a roller coaster goes up to a great height";
						break;
					default:
				}
			}else{
				switch(qid)
				{
					case 0:
						canswer = 99;
						AArray[0] = "43.3N";
						qImageSrc = "physics-angle.jpg";
						break;
					case 1:
						counter = 2;
						canswer = 1;
						AArray[0] = "Kinetic";
						AArray[1] = "Static";
						qImageSrc = "physics-angle.jpg";
						break;
					case 2:
						canswer = 99;
						AArray[0] = "125N";
						qImageSrc = "physics-angle.jpg";
						break;
					case 3:
						canswer = 99;
						AArray[0] = "4.3m/s^2";
						qImageSrc = "physics-angle.jpg";
						break;
					case 4:
						counter = 3;
						canswer = 0;
						AArray[0] = "Twice as much work";
						AArray[1] = "The same amount of work";
						AArray[2] = "Four times as much work";
						break;
					case 5:
						counter = 4;
						canswer = 2;
						AArray[0] = "Lifting the 25kg sack";
						AArray[1] = "Lifting the 50kg sack";
						AArray[2] = "Both require the same amount of work";
						AArray[3] = "More information is needed before I can answer";
						break;
					case 6:
						counter = 4;
						canswer = 1;
						AArray[0] = "1m";
						AArray[1] = "2m";
						AArray[2] = "3m";
						AArray[3] = "4m";
						break;
					case 7:
						counter = 4;
						canswer = 3;
						AArray[0] = "4 times the Kinetic Energy";
						AArray[1] = "8 times the Kinetic Energy";
						AArray[2] = "12 times the Kinetic Energy";
						AArray[3] = "16 times the Kinetic Energy";
						break;
					case 8:
						canswer = 99;
						AArray[0] = "18J";
						break;
					case 9:
						canswer = 99;
						AArray[0] = "43s";
						break;
					default:
				}
			}
			break;
		default:	
	}
	
	if(!QandAArray[questionId])
	{
		QandAArray[questionId] = new Array(counter);
	}
	
	// Check to verify is answer type is radio or input
	if(canswer==99)
	{
		inputId = "input" + qid;
		chkBtn  = "chk" + qid;
		str = "<input type='text' size='15' id='"+ inputId +"'><br><input type='button' id='"+ chkBtn +"' onClick='chkIfCorrect(\""+ inputId +"\");' value='Check'>&nbsp;<input type='button' id='"+ qid +"' onClick='showInputAnswer(this.id);' value='Show Answer'>";
	}else{
		for(var j=0;j<counter;j++)
		{
			answer = "ans" + j;
			str += "<input type='radio' name='"+ questionId +"' id='"+ j +"' value='' onClick='chkAnswer(this.id);'><span id='"+ answer +"'></span><br>";
		}
	}
	document.getElementById("answerSec").innerHTML=str;
	for(var i=0;i<counter;i++)
	{
		answer = "ans" + i;
		document.getElementById(answer).innerHTML=AArray[i];
	}
	
	// Enable and display an image associated to a question
	if(qImageSrc!="")
	{
		document.getElementById("questImg").src="../images/miscellaneous/" + qImageSrc;
		document.getElementById("questionImage").style.display="block";
	}else{
		document.getElementById("questionImage").style.display="none";
	}
}

// Parameter1: Question ID (Integer accepted)
// [MODULES] Function used to display the correct answer based on a question that is of 'input type'.
// =========================================================================================================
function showInputAnswer(qid)
{
	var inputId = "input" + qid;
	var chkBtn = "chk" + qid;
	document.getElementById(inputId).value = AArray[0];
	InputFldArray[qid] = 1;
	
	// Disable buttons and field
	document.getElementById(inputId).disabled=true;
	document.getElementById(qid).disabled=true;
	document.getElementById(chkBtn).disabled=true;
	document.getElementById("hlpMsgRow").style.display='none';
	ACorrectArray[qid]=1;
	updateScore(0);
}

// Parameter1: Answer ID (Integer accepted)
// [MODULES] Function used to set verify if a correct answer has been chosen for a certain question.
// =========================================================================================================
function chkAnswer(id)
{
	var ansFlag = 0;
	ansLabel = "ans" + id; 
	ans = id;
	
	// Question has not previously been answered
	if(id==canswer)
	{
		// Selected answer is correct
		ansFlag = 1;
	}else{
		// Selected answer is incorrect
		ansFlag = 0;
	}
		
	if(ACorrectArray[questionId]!=1)
	{
		QandAArray[questionId][id] = ansFlag;
	}
	chkIfCorrect(ansFlag);
	updateScore(ansFlag);
}

// Parameter1: Flag ID (Integer accepted)
// [MODULES] Function used to set colors specific to whether a question was answered correctly or not. If question
// is of input type, helpful indicator text is displayed based on the correctness of the input.
// =========================================================================================================
function chkIfCorrect(id)
{
	// Check to see whether question is of type 'input' or 'radio'
	if(canswer==99)
	{
		var retrievedVal = document.getElementById(id).value;
		var correctAns = AArray[0];
		if(retrievedVal=="")
		{
			document.getElementById("hlpMsg").innerHTML='Please enter a value!';
			document.getElementById("hlpMsg").style.color='#FF9900';
		}else{
			if(retrievedVal==correctAns)
			{
				var chkBtn = "chk" +questionId;
				
				InputFldArray[questionId] = 1;
				ACorrectArray[questionId] = 1;
				document.getElementById("hlpMsg").innerHTML='Correct!';
				document.getElementById("hlpMsg").style.color='#339933';
				
				// Disable buttons and field
				document.getElementById(id).disabled=true;
				document.getElementById(questionId).disabled=true;
				document.getElementById(chkBtn).disabled=true;
				updateScore(1);	// Update score if correct
			}else{
				var retrieveFirstChar = retrievedVal.charAt(0);
				var correctFirstChar  = correctAns.charAt(0);
				
				if(retrieveFirstChar!=correctFirstChar)
				{
					// If the first character in the input string is incorrect, give no score and incorrect answer
					document.getElementById("hlpMsg").innerHTML='Incorrect Answer!<br>To view the correct answer, click on the "Show Answer" button.';
					document.getElementById("hlpMsg").style.color='#CC0000';
					updateScore(0);	// Update score if incorrect
				}else{
					// All the following scenarios do not deduct score and give helpful hints to solve the question
					document.getElementById("hlpMsg").innerHTML='Answer is partially correct!<br>Be sure not to forget significant digits or units.';
					document.getElementById("hlpMsg").style.color='#FF9900';
				}
			}
		}
		document.getElementById("hlpMsgRow").style.display='block';
	}else{
		if(id==1)
		{
			ACorrectArray[questionId]=id;
			document.getElementById(ansLabel).style.color='#339933';
		}else{
			if(ACorrectArray[questionId]==1)
			{
				document.getElementById(canswer).checked=true;
			}else{
				document.getElementById(ansLabel).style.color='#CC0000';
			}
		}
	}
}

// Parameter1: Flag ID (Integer accepted)
// [MODULES] Function used to update the quiz score based on the correctness of the answer.
// =========================================================================================================
function updateScore(id)
{
	var scoreStr = '';
	if(QAnsArray[questionId]==undefined)
	{
		// Enable Score cell for Set Question Pages
		if(document.getElementById("scoreTd"))
		{
			document.getElementById("scoreTd").style.display="block";
		}
		
		qAnswered =(qAnswered + 1>numberOfQuestions)?qAnswered=numberOfQuestions:++qAnswered; 
		if(id==1)
		{
			// Update score if correct answer
			++numCorrect;
			scoreHolder =(scoreHolder + 1>qAnswered)?scoreHolder = scoreHolder:++scoreHolder;
			scoreStr = "Answered: <span class='blueText'>" + qAnswered + "/" + numberOfQuestions + "</span><br />";
			scoreStr += "Correct: <span class='blueText'>" + numCorrect + "</span><br />";
			scoreStr += "Score: <span class='blueText'><u>" + Math.round(scoreHolder/qAnswered * 100) + "%</u></span>";
			document.getElementById("score").innerHTML = scoreStr;
		}else{
			// Update score if incorrect answer
			scoreHolder =(scoreHolder - 1<0)?scoreHolder = 0:scoreHolder = scoreHolder;
			scoreStr = "Answered: <span class='blueText'>" + qAnswered + "/" + numberOfQuestions + "</span><br />";
			scoreStr += "Correct: <span class='blueText'>" + numCorrect + "</span><br />";
			scoreStr += "Score: <span class='blueText'><u>" + Math.round(scoreHolder/qAnswered * 100) + "%</u></span>";
			document.getElementById("score").innerHTML = scoreStr;
		}
		QAnsArray[questionId] = "T";
	}
}

// Parameter1: Question ID (Integer accepted)
// Parameter2: Number of questions (Integer accepted)
// Parameter3: Subject ID (Integer accepted)
// Parameter4: Section Name (String accepted)
// [MODULES] Function used to navigate through different questions and display them, and their corresponding
// possible answers to the screen.
// =========================================================================================================
function moveQuest(q,num,sid,sct)
{
	var inputId;
	var chk;
	
	inputId = "input" + questionId;
	chk = document.getElementById(inputId);
	if(chk)
	{
		// If previous question was of input-type, store the input in array for later use
		InputFldValArray[questionId] = document.getElementById(inputId).value;
	}
	
	if(q!=99)
	{
		var nextStr='';
		var prevStr='';
		var upQ=q+1;
		var downQ=q-1;
		var flag=0;
		var storeVal='';
		var label='';
		
		// Handle Previous token
		if(downQ<0)
		{
			downQ=99;
			flag=1;
		}
		prevStr='<a href="javascript:moveQuest('+ downQ +','+ num +','+ sid +',' + '&quot;' + sct + '&quot;' + ');"><img src="../images/miscellaneous/left-arrow.jpg" alt="Previous" id="LArrow"></a>';
		
		// Handle Next token
		if(q==num)
		{
			nextStr='<a href="javascript:moveQuest(99,'+ num +','+ sid +',' + '&quot;' + sct + '&quot;' + ');"><img src="../images/miscellaneous/right-arrow.jpg" alt="Next" id="RArrow"></a>';
		}else{
			nextStr='<a href="javascript:moveQuest('+ upQ +','+ num +','+ sid +',' + '&quot;' + sct + '&quot;' + ');"><img src="../images/miscellaneous/right-arrow.jpg" alt="Next" id="RArrow"></a>';
		}
		buildAnswers(sid,sct,q);
		document.getElementById("questhere").innerHTML=QArray[q];
		document.getElementById("nextArrow").innerHTML=nextStr;
		document.getElementById("prevArrow").innerHTML=prevStr;
		if(document.getElementById("hlpMsgRow"))
		{
			document.getElementById("hlpMsgRow").style.display='none';
		}
		
		// Re-build previously selected answers
		inputId = "input" + q;
		chk = document.getElementById(inputId);
		if(chk)
		{
			if(InputFldArray[q]==1)
			{
				chk="chk"+q;
				document.getElementById(inputId).value = AArray[0];
				
				// Disable buttons and field
				document.getElementById(inputId).disabled=true;
				document.getElementById(q).disabled=true;
				document.getElementById(chk).disabled=true;
			}else{
				if(InputFldValArray[questionId]!=undefined)
				{
					document.getElementById(inputId).value = InputFldValArray[questionId];
				}
			}
		}else{
			for(var i=0;i<QandAArray[q].length;i++)
			{
				if(QandAArray[q][i]!=undefined)
				{
					storeVal = QandAArray[q][i];
					label = "ans"+i;
					if(storeVal==1)
					{
						if(ACorrectArray[q]==1)
						{
							document.getElementById(canswer).checked=true;
							document.getElementById(label).style.color='#339933';
						}
					}else{
						document.getElementById(label).style.color='#CC0000';
					}
				}
			}
		}
		
		// Handle visibility of question moving arrows
		if(q==num)
		{
			document.getElementById('RArrow').style.display="none";
		}else{
			document.getElementById('RArrow').style.display="block";
		}
		
		if(flag==1)
		{
			document.getElementById('LArrow').style.display="none";
		}else{
			document.getElementById('LArrow').style.display="block";
		}
	}
}

// Parameter1: Word Name (String accepted)
// [MODULES] Function used to create and build an array for a specific definition and then display it to the screen.
// =========================================================================================================
function buildDefine(wid)
{
	switch(wid)
	{
		// PHYSICS - A DAY AT LARONDE DEFINITIONS
		// ----------------------------------------------------------------------------------------------------------------
		case "area": 
						DArray[0] = "AREA";
					 	DArray[1] = "The extent of a 2-dimensional surface enclosed within a boundary.";
		            	DArray[2] = "AIRE";
						break;
		
		case "position": 
						DArray[0] = "POSITION";
					 	DArray[1] = "A location in relation to another.";
		             	DArray[2] = "POSITION";
						break;
					
		case "displacement": 
						DArray[0] = "DISPLACEMENT";
					 	DArray[1] = "A change in position.";
		             	DArray[2] = "DÉPLACEMENT";
						break;
						
		case "direction": 
						DArray[0] = "DIRECTION";
					 	DArray[1] = "The distance-independent relationship between two points in space that specifies the angular position of either with respect to the other; the relationship by which the alignment or orientation of any position with respect to any other position is established.";
		             	DArray[2] = "DIRECTION";
						break;
						
		case "vector": 
						DArray[0] = "VECTOR";
					 	DArray[1] = "A quantity with magnitude, direction and usually a unit of measure.";
		             	DArray[2] = "VECTEUR";
						break;
						
		case "instSpeed": 
						DArray[0] = "INSTANTANEOUS SPEED";
					 	DArray[1] = "The speed at a particular instance in time.";
		             	DArray[2] = "VITESSE INSTANTANÉE";
						break;
						
		case "distance": 
						DArray[0] = "DISTANCE";
					 	DArray[1] = "The spatial separation of two points, measured by the length of a hypothetical line joining them.";
		             	DArray[2] = "DISTANCE";
						break;
						
		case "gpe": 
						DArray[0] = "GRAVITATIONAL POTENTIAL ENERGY";
					 	DArray[1] = "The energy an object has because of its vertical separation from the earth.";
		             	DArray[2] = "ÉNERGIE POTENTIELLE GRAVITATIONNELLE";
						break;
						
		case "height": 
						DArray[0] = "HEIGHT";
					 	DArray[1] = "The vertical dimension of extension.";
		             	DArray[2] = "HAUTEUR";
						break;
						
		case "accGravity": 
						DArray[0] = "TO ACCELERATE DUE TO GRAVITY";
					 	DArray[1] = "Constant acceleration and vertical motion caused by the gravitational force of the earth pulling down on the objects.";
		             	DArray[2] = "ACCÉLÉRATION DUE A LA PESANTEUR/GRAVITÉ";
						break;
						
		case "kinetic": 
						DArray[0] = "KINETIC ENERGY";
					 	DArray[1] = "The energy an object has because it is moving.";
		             	DArray[2] = "ÉNERGIE CINÉTIQUE";
						break;
						
		case "centripAccel": 
						DArray[0] = "CENTRIPETAL ACCELERATION";
					 	DArray[1] = "The acceleration of objects moving in a circular path at a constant speed.";
		             	DArray[2] = "ACCÉLÉRATION CENTRIPÈTE";
						break;
						
		case "centerMass": 
						DArray[0] = "CENTER OF MASS";
					 	DArray[1] = "A point at or near the centre of the body at which we consider all of the weight force as acting.";
		             	DArray[2] = "CENTRE DE MASSE";
						break;
						
		case "angularPos": 
						DArray[0] = "ANGULAR POSITION";
					 	DArray[1] = "The position of an object moving in a circular path.";
		             	DArray[2] = "POSITION ANGULAIRE";
						break;
						
		case "angularVelo": 
						DArray[0] = "ANGULAR VELOCITY";
					 	DArray[1] = "Ratio of the change in the object's position and the time required for this change when the object is moving in a circular path.";
		             	DArray[2] = "VÉLOCITÉ ANGULAIRE";
						break;
						
		case "angularAccel": 
						DArray[0] = "ANGULAR ACCELERATION";
					 	DArray[1] = "Ratio of the object's change in angular velocity and the time required for that change when the object is moving in a circle or rotating about an axis.";
		             	DArray[2] = "ACCÉLÉRATION ANGULAIRE";
						break;
						
		case "elasticPE": 
						DArray[0] = "ELASTIC POTENTIAL ENERGY";
					 	DArray[1] = "The energy stored in a stretched or compressed elastic material such as a spring.";
		             	DArray[2] = "ÉNERGIE POTENTIELLE ÉLASTIQUE";
						break;
						
		case "springconstant": 
						DArray[0] = "SPRING CONSTANT";
					 	DArray[1] = "Constant that varies depending on how stiff the spring is: its value is large for a stiff spring and small for an easily stretched spring.";
		             	DArray[2] = "CONSTANTE DU RESSORT";
						break;
		
		case "forceSpring": 
						DArray[0] = "FORCE OF SPRING";
					 	DArray[1] = "The spring force is the force exerted by a compressed or stretched spring upon any object which is attached to it. An object which compresses or stretches a spring is always acted upon by a force which restores the object to its rest or equilibrium position.";
		             	DArray[2] = "FORCE DU RESSORT";
						break;
						
		case "length": 
						DArray[0] = "LENGTH";
					 	DArray[1] = "The measuement or extent of something from end to end.";
		             	DArray[2] = "LONGUEUR";
						break;
						
		case "torque": 
						DArray[0] = "TORQUE";
					 	DArray[1] = "The tendency of a force to cause an object to turn or rotate.";
		             	DArray[2] = "COUPLE";
						break;
						
		case "force": 
						DArray[0] = "FORCE";
					 	DArray[1] = "A push or pull acting upon an object as a result of its interaction with another object.";
		             	DArray[2] = "FORCE";
						break;
						
		case "accelerate": 
						DArray[0] = "ACCELERATE";
					 	DArray[1] = "Change in velocity divided by the time required for that change.";
		             	DArray[2] = "ACCÉLÉRER";
						break;
						
		case "impulse": 
						DArray[0] = "IMPULSE";
					 	DArray[1] = "Product of the force and the time.";
		             	DArray[2] = "IMPULSION";
						break;
			
		// CHEMISTRY - NATALIE'S EXPERIMENT DEFINITIONS	
		// ----------------------------------------------------------------------------------------------------------------
		case "copper": 
						DArray[0] = "COPPER";
					 	DArray[1] = "(Symbol: <strong>Cu</strong>) A ductile, malleable, reddish-brown metallic element that is an excellent conductor of heat and electricity and is widely used for electrical wiring, water piping, and corrosion-resistant parts, either pure or in alloys such as brass and bronze.<br><br>Atomic number 29; atomic weight 63.54; melting point 1,083°C; boiling point 2,595°C.";
		             	DArray[2] = "CUIVRE";
						break;
						
		case "weighed": 
						DArray[0] = "WEIGHED";
					 	DArray[1] = "To take the weight of.";
		             	DArray[2] = "PESER";
						break;
						
		case "chemicals": 
						DArray[0] = "CHEMICALS";
					 	DArray[1] = "A substance with a distinct molecular composition that is produced by or used in a chemical process.";
		             	DArray[2] = "PRODUITS CHIMIQUES";
						break;
						
		case "stockSolution": 
						DArray[0] = "STOCK SOLUTION";
					 	DArray[1] = "Large volume of a common reagent at a standardized concentration.";
		             	DArray[2] = "SOLUTION MÈRE";
						break;
						
		case "byProducts": 
						DArray[0] = "BY-PRODUCTS";
					 	DArray[1] = "Materials generated incidentally to the production of a principal product in an industry or industrial enterprise.";
		             	DArray[2] = "SOUS-PRODUITS ou PRODUITS SECONDAIRES";
						break;
						
		case "random": 
						DArray[0] = "RANDOM ERRORS";
					 	DArray[1] = "Random error is the irreproducibility in making replicate measurements and affects the precision of a result. The distribution of random errors follows a Gaussian-shape 'bell' curve.";
		             	DArray[2] = "ERREURS FORTUITES";
						break;
						
		case "sysErrors": 
						DArray[0] = "SYSTEMATIC ERRORS";
					 	DArray[1] = "Systematic errors are errors that produce a result that differs from the true value by a fixed amount. These errors result from biases introduced by instrumental method, or human factors.";
		             	DArray[2] = "ERREURS SYSTÉMATIQUES";
						break;
						
		case "percentYield": 
						DArray[0] = "PERCENT YIELD";
					 	DArray[1] = "The percentage yield which serves to measure the effectiveness of a synthetic procedure, is calculated by dividing the amount of the obtained product in moles by the theoretical yield in moles.";
		             	DArray[2] = "POURCENTAGE DE RENDEMENT";
						break;
		// CHEMISTRY - THE ENVIRONMENT DEFINITIONS		
		// ----------------------------------------------------------------------------------------------------------------
		case "envIssues": 
						DArray[0] = "ENVIRONMENTAL ISSUES";
					 	DArray[1] = "Point or matter of discussion, debate, or dispute on the subject of the Environment.";
		             	DArray[2] = "QUESTIONS ENVIRONNEMENTALES";
						break;
						
		case "fossilFuels": 
						DArray[0] = "FOSSIL FUELS";
					 	DArray[1] = "A hydrocarbon deposit, such as petroleum, coal, or natural gas, derived from living matter of a previous geologic time and used for fuel.";
		             	DArray[2] = "COMBUSTIBLES FOSSILES";
						break;
						
		case "carbonDioxyde": 
						DArray[0] = "CARBONDIOXYDE";
					 	DArray[1] = "Chemical composed of one atom of Carbon and two atoms of oxygen.";
		             	DArray[2] = "DIOXYDE DE CARBONE";
						break;
						
		case "greenhouseEffect": 
						DArray[0] = "GREENHOUSE EFFECT";
					 	DArray[1] = "The phenomenon whereby the earth\'s atmosphere traps solar radiation, caused by the presence in the atmosphere of gases such as carbon dioxide, water vapor, and methane that allow incoming sunlight to pass through but absorb heat radiated back from the earth's surface.";
		             	DArray[2] = "EFFET DE SERRE";
						break;
						
		case "combustion": 
						DArray[0] = "COMBUSTION";
					 	DArray[1] = "A chemical change, especially oxidation, accompanied by the production of heat and light.";
		             	DArray[2] = "COMBUSTION";
						break;
						
		case "gasoline": 
						DArray[0] = "GASOLINE";
					 	DArray[1] = "A volatile mixture of flammable liquid hydrocarbons derived chiefly from crude petroleum and used principally as a fuel for internal-combustion engines.";
		             	DArray[2] = "ESSENCE ou HYDROCARBURE";
						break;
						
		case "charcoal": 
						DArray[0] = "CHARCOAL";
					 	DArray[1] = "A black, porous, carbonaceous material, 85 to 98 percent carbon, produced by the destructive distillation of wood and used as a fuel, filter, and absorbent.";
		             	DArray[2] = "CHARBON DE BOIS";
						break;
						
		case "nitrousOxides": 
						DArray[0] = "NITROUS OXIDES";
					 	DArray[1] = "A colorless, sweettasting gas composed of two atoms of nitrogen and one atom of oxygen.";
		             	DArray[2] = "OXYDES D'AZOTE";
						break;
						
		case "acidRain": 
						DArray[0] = "ACID RAIN";
					 	DArray[1] = "Precipitation that incorporates anthropogenic acids and acidic materials.";
		             	DArray[2] = "PLUIE ACIDE";
						break;
						
		case "lead": 
						DArray[0] = "LEAD";
					 	DArray[1] = "(Symbol: <strong>Pb</strong>) A soft, malleable, ductile, bluish-white, dense metallic element, extracted chiefly from galena and used in containers and pipes for corrosives, solder and type metal, bullets, radiation shielding, paints, and antiknock compounds.<br><br>Atomic number 82; atomic weight 207.2; melting point 327.5°C; boiling point 1,744°C.";
		             	DArray[2] = "PLOMB";
						break;
						
		case "mercury": 
						DArray[0] = "MERCURY";
					 	DArray[1] = "(Symbol <strong>Hg</strong>) A silvery-white poisonous metallic element, liquid at room temperature and used in thermometers, barometers, vapor lamps, and batteries and in the preparation of chemical pesticides. <br><br>Atomic number 80; atomic weight 200.59; melting point -38.87°C; boiling point 356.58°C.";
		             	DArray[2] = "MERCURE";
						break;
						
		case "detergents": 
						DArray[0] = "DETERGENTS";
					 	DArray[1] = "Cleansing substance that acts similarly to soap but is made from chemical compounds rather than fats and lye.";
		             	DArray[2] = "DÉTERGENTS";
						break;
						
		case "water": 
						DArray[0] = "WATER";
					 	DArray[1] = "A clear, colorless, odorless, and tasteless liquid, <strong>H2O</strong>, essential for most plant and animal life and the most widely used of all solvents.<br><br>Freezing point 0°C; boiling point 100°C.";
		             	DArray[2] = "EAU";
						break;
						
		case "nitrogen": 
						DArray[0] = "NITROGEN";
					 	DArray[1] = "(Symbol: <strong>N</strong>) A nonmetallic element,<br><br>Atomic number 7; atomic weight 14.0067; melting point -209.86°C; boiling point -195.8°C; valence 3, 5.";
		             	DArray[2] = "AZOTE";
						break;
						
		case "eutrophication": 
						DArray[0] = "EUTROPHICATION";
					 	DArray[1] = "Having waters rich in mineral and organic nutrients that promote a proliferation of plant life, especially algae, which reduces the dissolved oxygen content and often causes the extinction of other organisms. Used of a lake or pond.";
		             	DArray[2] = "EUTROPHISATION";
						break;
						
		case "freeRadicals": 
						DArray[0] = "FREE RADICALS";
					 	DArray[1] = "An atom or group of atoms that has at least one unpaired electron and is therefore unstable and highly reactive.";
		             	DArray[2] = "RADICAUX LIBRES";
						break;
						
		case "chainReaction": 
						DArray[0] = "CHAIN REACTIONS";
					 	DArray[1] = "A series of reactions in which one product of a reacting set is a reactant in the following set.";
		             	DArray[2] = "RÉACTIONS EN CHAÎNE";
						break;
						
		case "bonds": 
						DArray[0] = "BOND(S)";
					 	DArray[1] = "Two atoms will form a chemical bond when the net attractive forces make it more favorable for the atoms to be close to each other than to be apart.";
		             	DArray[2] = "LIAISON(S)";
						break;
						
		case "radiocarbonDating": 
						DArray[0] = "RADIOCARBON DATING";
					 	DArray[1] = "The determination of the approximate age of an ancient object, such as an archaeological specimen, by measuring the amount of carbon 14 it contains. Also called carbon dating, carbon-14 dating.";
		             	DArray[2] = "DATATION AU CARBONE RADIOACTIF";
						break;
						
		case "petroleumProducts": 
						DArray[0] = "PETROLEUM PRODUCTS";
					 	DArray[1] = "Materials derived from petroleum, natural gas, or asphalt deposits; includes gasolines, diesel and heating fuels, liquefied petroleum gases (LPG and bugas), lubricants, waxes, greases, petroleum coke, petrochemicals, and (from sour crudes and natural gases) sulfur.";
		             	DArray[2] = "PRODUITS PÉTROLIERS";
						break;
						
		case "naturalGas": 
						DArray[0] = "NATURAL GAS";
					 	DArray[1] = "A mixture of hydrocarbon gases that occurs with petroleum deposits, principally methane together with varying quantities of ethane, propane, butane, and other gases, and is used as a fuel and in the manufacture of organic compounds.";
		             	DArray[2] = "GAZ NATUREL";
						break;
						
		case "nuclearEnergy": 
						DArray[0] = "NUCLEAR ENERGY";
					 	DArray[1] = "The energy released by a nuclear reaction, especially by fission or fusion.";
		             	DArray[2] = "ÉNERGIE NUCLÉAIRE";
						break;
						
		case "recycle": 
						DArray[0] = "RECYCLE";
					 	DArray[1] = "To extract and reuse.";
		             	DArray[2] = "RECYCLE";
						break;
						
		case "metal": 
						DArray[0] = "METAL";
					 	DArray[1] = "A hard, shiny, solid material which is able to be shaped and can conduct electricity.";
		             	DArray[2] = "MÉTAL";
						break;
		// BIOLOGY - ECOLOGY DEFINITIONS
		// ----------------------------------------------------------------------------------------------------------------
		case "species": 
						DArray[0] = "SPECIES";
					 	DArray[1] = "A particular kind of organism; members possess similar anatomical characteristics and have the ability to interbreed.";
		             	DArray[2] = "ESPÈCE";
						break;
		case "community": 
						DArray[0] = "COMMUNITY";
					 	DArray[1] = "All the organisms that inhabit a particular area; an assemblage of populations of different species living close enough together for potential interaction.";
		             	DArray[2] = "COMMUNAUTÉ";
						break;
		case "abioticFactors": 
						DArray[0] = "ABIOTIC FACTORS";
					 	DArray[1] = "Nonliving chemical and physical factors such as temperature, light, water and nutrients.";
		             	DArray[2] = "FACTEURS ABIOTIQUES";
						break;
		case "primaryProducers": 
						DArray[0] = "PRIMARY PRODUCERS";
					 	DArray[1] = "Photosynthetic organisms that use light energy to synthesize sugars and other organic compounds, which they then use as fuel for cellular respiration and as building material for growth.";
		             	DArray[2] = "PRODUCTEURS PRIMAIRES";
						break;
		case "photosynthesis": 
						DArray[0] = "PHOTOSYNTHESIS";
					 	DArray[1] = "The conversion of light energy to chemical energy that is stored in glucose or other organic compounds; occurs in plants, algea and certain prokaryotes.";
		             	DArray[2] = "PHOTOSYNTHÈSE";
						break;
		case "consumers": 
						DArray[0] = "CONSUMERS";
					 	DArray[1] = "Organisms that depend on other organisms for their energy.";
		             	DArray[2] = "CONSOMMATEURS";
						break;
		case "decomposers": 
						DArray[0] = "DECOMPOSERS";
					 	DArray[1] = "Consumers that derive their energy from nonliving organic material such as feces, fallen leaves and the remains of dead organisms from all trophic levels.";
		             	DArray[2] = "DÉCOMPOSEURS ou DÉTRIVORES";
						break;
		case "foodChain": 
						DArray[0] = "FOOD CHAIN";
					 	DArray[1] = "The pathway along which food is transferred from trophic level to trophic level, beginning with producers.";
		             	DArray[2] = "CHAÎNE ALIMENTAIRE";
						break;
		case "parasite": 
						DArray[0] = "PARASITE";
					 	DArray[1] = "An organism that absorbs nutrients from the body fluids of living hosts.";
		             	DArray[2] = "PARASITE";
						break;
		case "parasitism": 
						DArray[0] = "PARASITISM";
					 	DArray[1] = "A symbiotic relationship in which the parasite benefits at the expense of the host by living either within the host or outside the host.";
		             	DArray[2] = "PARASITISME";
						break;
		case "symbiosis": 
						DArray[0] = "SYMBIOSIS";
					 	DArray[1] = "An ecological relationship between organisms of two different species that live together in direct contact.";
		             	DArray[2] = "SYMBIOSE";
						break;
		case "mutualism": 
						DArray[0] = "MUTUALISM";
					 	DArray[1] = "A symbiotic relationship in which both the host and the symbiont benefit.";
		             	DArray[2] = "MUTALISME";
						break;
		case "commensalism": 
						DArray[0] = "COMMENSALISM";
					 	DArray[1] = "A symbiotic relationship in which the symbiont benefits buts the host is neither helped nor harmed.";
		             	DArray[2] = "COMMENSALISME";
						break;
		// BIOLOGY - REPRODUCTION DEFINITIONS
		// ----------------------------------------------------------------------------------------------------------------
		case "dna": 
						DArray[0] = "DNA";
					 	DArray[1] = "Deoxyribonucleic acid, A double- stranded, helical nucleic acid molecule capable of replicating and determining the inherited structure of a cell's proteins.";
		             	DArray[2] = "ADN";
						break;
		case "nucleicAcid": 
						DArray[0] = "NUCLEIC ACID";
					 	DArray[1] = "A polymer consisting of many nucleotide monomers; serves as a blueprint for proteins and, through the actions of proteins, for all cellular activities. The two types are DNA and RNA.";
		             	DArray[2] = "ACIDE NUCLÉIQUE";
						break;
		case "geneticEngineering": 
						DArray[0] = "GENETIC ENGINEERING";
					 	DArray[1] = "Manipulation or Modification of the genes of an organism.";
		             	DArray[2] = "GÉNIE GÉNÉTIQUE";
						break;
		case "cloning": 
						DArray[0] = "CLONING";
					 	DArray[1] = "To make one or more genetic replicas of an individual or cell.";
		             	DArray[2] = "CLONAGE";
						break;
		case "asexualReproduction": 
						DArray[0] = "ASEXUAL REPRODUCTION";
					 	DArray[1] = "A type of reproduction involving only one parent that produces genetically identical offspring by budding or by the division of a single cell or the entire organism into two or more parts.";
		             	DArray[2] = "REPRODUCTION ASEXUÉE";
						break;
		case "mitosis": 
						DArray[0] = "MITOSIS";
					 	DArray[1] = "A process of nuclear division in eukaryotic cells. Mitosis conserves chromosome number by equally allocating replicated chromosomes to each of the daighter nuclei.";
		             	DArray[2] = "MITOSE";
						break;
		case "sexualReproduction": 
						DArray[0] = "SEXUAL REPRODUCTION";
					 	DArray[1] = "A mode of reproduction involving the fusion of female gamete(ovum) and male gamete(spermatozoon), which forms a zygote that potentially develops into genetically distinct offspring.";
		             	DArray[2] = "REPRODUCTION SEXUÉE";
						break;
		case "ovaries": 
						DArray[0] = "OVARIES";
					 	DArray[1] = "In animals, the structure that produces female gametes and reproductive hormones.";
		             	DArray[2] = "OVAIRES";
						break;
		case "oogenesis": 
						DArray[0] = "OOGENESIS";
					 	DArray[1] = "The process in the ovary that results in the production of female gametes.";
		             	DArray[2] = "OVOGENÈSE";
						break;
		case "ovarian": 
						DArray[0] = "OVARIAN";
					 	DArray[1] = "Situated in the ovaries.";
		             	DArray[2] = "(ADJ) OVARIEN (m), OVARIENNE (f)";
						break;
		case "sperm": 
						DArray[0] = "SPERM";
					 	DArray[1] = "A reproductive cell produced by the male of an animal species which, when united with an egg (of the same species), results in conception and the development of an embryo.";
		             	DArray[2] = "SPERME";
						break;
		case "spermatogenesis": 
						DArray[0] = "SPERMATOGENESIS";
					 	DArray[1] = "The continuous and prolific production of mature sperm cells in the testis.";
		             	DArray[2] = "SPERMATOGÉNÈSE";
						break;
		case "meiosis": 
						DArray[0] = "MEIOSIS";
					 	DArray[1] = "A two- stage type of cell division in sexually reproducing organisms that results in gametes with half the chromosome number of the original cell.";
		             	DArray[2] = "MEIOSE";
						break;
		case "fertilisation": 
						DArray[0] = "FERTILISATION";
					 	DArray[1] = "The union of haploid gametes to produce a diploid zygote.";
		             	DArray[2] = "FERTILISATION";
						break;
		case "gametes": 
						DArray[0] = "GAMETES";
					 	DArray[1] = "A halpid egg or sperm cell; gametes unite during sexual reproduction to produce a diploid zygote.";
		             	DArray[2] = "GAMÈTE";
						break;
		case "embryo": 
						DArray[0] = "EMBRYO";
					 	DArray[1] = "An organism in early stages of development.";
		             	DArray[2] = "EMBRYON";
						break;
		case "fetus": 
						DArray[0] = "FETUS";
					 	DArray[1] = "The unborn offspring from the end of the 8th week after conception (when the major structures have formed) until birth.";
		             	DArray[2] = "FOETUS";
						break;
		// BIOLOGY - REPRODUCTION DEFINITIONS
		// ----------------------------------------------------------------------------------------------------------------
		case "nervousSystem": 
						DArray[0] = "NERVOUS SYSTEM";
					 	DArray[1] = "Nervous systems perform three overlapping functions: sensory input, integration and motor output.";
		             	DArray[2] = "SYSTÈME NERVEUX";
						break;
		case "brain": 
						DArray[0] = "BRAIN";
					 	DArray[1] = "In animals, the brain is the control center of the central nervous system, responsible for behavior.";
		             	DArray[2] = "CERVEAU";
						break;
		case "spinalCord": 
						DArray[0] = "SPINAL CORD";
					 	DArray[1] = "Runs lengthwise inside the vertebral column, or spine, integrates simple responses to certain kinds of stimuli and conveys information to and from the brain.";
		             	DArray[2] = "MOELLE ÉPINIÈRE";
						break;
		case "neurons": 
						DArray[0] = "NEURON";
					 	DArray[1] = "A nerve cell; the fundamental unit of the nervous system, having structure and properties that allow it to conduct signals by taking advantage of the electrical charge across its cell membranes.";
		             	DArray[2] = "NEURONE";
						break;
		case "activeTransport": 
						DArray[0] = "ACTIVE TRANSPORT";
					 	DArray[1] = "The movement of a substance across a biological membrane against its concentration or electrochemical gradient, with the help of energy input and specific transport proteins.";
		             	DArray[2] = "TRANSPORT ACTIF";
						break;
		case "respiratorySystem": 
						DArray[0] = "RESPIRATORY SYSTEM";
					 	DArray[1] = "System which allows the uptake of molecular oxygen from the environment and discharge of carbon dioxyde to the environment.";
		             	DArray[2] = "SYSTÈME RESPIRATOIRE";
						break;
		case "diaphragm": 
						DArray[0] = "DIAPHRAGM";
					 	DArray[1] = "A sheet of skeletal muscle that forms the bottom wall of the chest cavity.";
		             	DArray[2] = "DIAPHRAGME";
						break;
		case "ribcage": 
						DArray[0] = "RIBCAGE";
					 	DArray[1] = "The structure formed by the thoracic vertebrae and ribs, the sternum (breastbone), and the costal cartilages (that attach the ribs to the sternum).";
		             	DArray[2] = "CAGE THORACIQUE";
						break;
		case "inhale": 
						DArray[0] = "INHALE";
					 	DArray[1] = "The drawing of air or other substances into the lungs.";
		             	DArray[2] = "INSPIRER";
						break;
		case "lungs": 
						DArray[0] = "LUNGS";
					 	DArray[1] = "An organ for aerial respiration.";
		             	DArray[2] = "POUMONS";
						break;
		case "circulatorySystem": 
						DArray[0] = "CIRCULATORY SYSTEM";
					 	DArray[1] = "The system that moves blood throughout the body. The circulatory system is composed of the heart, arteries, capillaries, and veins.";
		             	DArray[2] = "SYSTÈME CIRCULATOIRE";
						break;
		// MATHEMATICS - QUADRATIC FUNCTION DEFINITIONS
		// ----------------------------------------------------------------------------------------------------------------
		case "parabola": 
						DArray[0] = "PARABOLA";
					 	DArray[1] = "The intersection of a cone and a plane parallel to an 'edge' of the conical surface.<br><br> Represented by the equation: <img src='../images/miscellaneous/quadratic.gif' alt=''>";
		             	DArray[2] = "PARABOLE";
						break;
		case "quadraticFormula": 
						DArray[0] = "QUADRATIC FORMULA";
					 	DArray[1] = "Represented by a parabola and by the expression<br> <img src='images/miscellaneous/general-form.gif' alt=''> (general form) or, <br><img src='../images/miscellaneous/canonical-form.gif' alt=''> (canonical form, where the vertex is at (h,k)).<br><br>For <img src='../images/miscellaneous/quadratic.gif' alt=''> , the solutions for x is given by<br> <img src='../images/miscellaneous/quadratic-equation.gif' alt=''>";
		             	DArray[2] = "FORMULE QUADRATIQUE";
						break;
		case "equation": 
						DArray[0] = "EQUATION";
					 	DArray[1] = "A statement that the values of two mathematical expressions are equal (indicated by the sign= ).";
		             	DArray[2] = "FORMULE";
						break;
		case "graph": 
						DArray[0] = "GRAPH";
					 	DArray[1] = "Diagram showing the relation between twoor more sets of numbers or quantities.";
		             	DArray[2] = "GRAPHIQUE";
						break;
		case "decreasing": 
						DArray[0] = "DECREASING";
					 	DArray[1] = "Becoming smaller or fewer in size or amount.";
		             	DArray[2] = "DÉCROISSANT";
						break;
		case "increasing": 
						DArray[0] = "INCREASING";
					 	DArray[1] = "Becoming greater in size or amount.";
		             	DArray[2] = "CROISSANT";
						break;
		case "vertex": 
						DArray[0] = "VERTEX";
					 	DArray[1] = "The highest or lowest point of a graph.";
		             	DArray[2] = "SOMMET";
						break;
		case "parallel": 
						DArray[0] = "PARALLEL";
					 	DArray[1] = "(of lines, planes or surfaces) side by side and having the same distance continuously between them.";
		             	DArray[2] = "PARALLÈLE";
						break;
		case "perpendicular": 
						DArray[0] = "PERPENDICULAR";
					 	DArray[1] = "At an angle of 90°; to a line, plane, surface or to the ground.";
		             	DArray[2] = "PERPENDICULAIRE";
						break;
		case "yAxis": 
						DArray[0] = " Y-AXIS";
					 	DArray[1] = "On a coordinate plane, the plane running vertical.";
		             	DArray[2] = "AXE DES ORDONNÉES";
						break;
		case "xAxis": 
						DArray[0] = "X-AXIS";
					 	DArray[1] = "On a coordinate plane, the plane running horizontal.";
		             	DArray[2] = "AXE DES ABCISSES";
						break;
		case "axisOfSymmetry": 
						DArray[0] = "AXIS OF SYMMETRY";
					 	DArray[1] = "An imaginary line around which shapes are symmetrical. It can be a fold line in a 2D shape or an axis around which shapes turn in rotational symmetry.";
		             	DArray[2] = "AXE DE SYMMÉTRIE";
						break;
		case "function": 
						DArray[0] = "FUNCTION";
					 	DArray[1] = "A relationship between one element and another, or between several elements and one other.";
		             	DArray[2] = "FONCTION";
						break;
		// MATHEMATICS - COORDINATE SYSTEM DEFINITIONS
		// ----------------------------------------------------------------------------------------------------------------
		case "slope": 
						DArray[0] = "SLOPE";
					 	DArray[1] = "Inclination of a function";
		             	DArray[2] = "PENTE";
						break;
		case "yIntercept": 
						DArray[0] = "Y-INTERCEPT";
					 	DArray[1] = "Coordinate that intersects with the Y-Axis.";
		             	DArray[2] = "ORDONNÉE À L'ORIGINE";
						break;
		case "xIntercept": 
						DArray[0] = "X-INTERCEPT";
					 	DArray[1] = "Coordinate that intersects with the X-Axis.";
		             	DArray[2] = "ABCISSE À L'ORIGINE";
						break;
		case "coordinates": 
						DArray[0] = "COORDINATES";
					 	DArray[1] = "Points on a graph.";
		             	DArray[2] = "COORDONNÉES";
						break;
		// MATHEMATICS - CLASSIFICATION DEFINITIONS
		// ----------------------------------------------------------------------------------------------------------------
		case "naturalNumbers": 
						DArray[0] = "NATURAL NUMBERS";
					 	DArray[1] = "";
		             	DArray[2] = "NOMBRES NATURELS";
						break;
		case "wholeNumbers": 
						DArray[0] = "WHOLE NUMBERS";
					 	DArray[1] = "";
		             	DArray[2] = "NOMBRES ENTIERS";
						break;
		case "integers": 
						DArray[0] = "INTEGERS";
					 	DArray[1] = "";
		             	DArray[2] = "ENTIERS";
						break;
		case "rationalNumbers": 
						DArray[0] = "RATIONAL NUMBERS";
					 	DArray[1] = "";
		             	DArray[2] = "NOMBRES RATIONNELS";
						break;
		// MATHEMATICS - MATH TERM DEFINITIONS
		// ----------------------------------------------------------------------------------------------------------------
		case "base": 
						DArray[0] = "BASE";
					 	DArray[1] = "";
		             	DArray[2] = "BASE";
						break;
		case "cube": 
						DArray[0] = "CUBE";
					 	DArray[1] = "";
		             	DArray[2] = "CUBE";
						break;
		case "cubeRoot": 
						DArray[0] = "CUBE ROOT";
					 	DArray[1] = "";
		             	DArray[2] = "RACINE CUBE";
						break;
		case "exponent": 
						DArray[0] = "EXPONENT";
					 	DArray[1] = "";
		             	DArray[2] = "EXPONENT";
						break;
		case "mean": 
						DArray[0] = "MEAN or AVERAGE";
					 	DArray[1] = "";
		             	DArray[2] = "MOYENNE";
						break;
		case "square": 
						DArray[0] = "SQUARE";
					 	DArray[1] = "";
		             	DArray[2] = "CARRÉ";
						break;
		case "squareRoot": 
						DArray[0] = "SQUARE ROOT";
					 	DArray[1] = "";
		             	DArray[2] = "RACINE CARRÉ";
						break;
		case "deviation": 
						DArray[0] = "DEVIATION";
					 	DArray[1] = "";
		             	DArray[2] = "DÉVIATION";
						break;
		// Error Case
		// ----------------------------------------------------------------------------------------------------------------
		default:
						DArray[0] = "N/A";
					 	DArray[1] = "The definition you are looking for, cannot be found. Please contact us at <a href='mailto:msc@vaniercollege.qc.ca' class='body'>msc@vaniercollege.qc.ca</a> to report the problem.";
		             	DArray[2] = "N/A";
						break;
		
	}
	// Dynamically position floating defination Div
	document.getElementById("showDef").style.top = yMousePos + "px";
	document.getElementById("showDef").style.left = xMousePos + "px";
	document.getElementById("showDef").style.display = "block";
	
	// Populate floating defination Div
	document.getElementById("word").innerHTML=DArray[0];
	document.getElementById("define").innerHTML=DArray[1];
	document.getElementById("wordFr").innerHTML=DArray[2];
}
//-->
