<!-- 
			var errMsg = "";							//represents error message displayed if form validation fails.
			var errDisplayedOnce = false;				//set to true if form information invalid and if still true when
																//continuing (post form) then display messagebox aswell
			var formPosted = false; 					//do not individually mark textbox's until user has decided to 
															//continue (post form), so doesn't possibly get annoying the 
															//first time with red highlights appearing
            var text = "TEXT";
            var email = "EMAIL ADDRESS";
            var select = "SELECT";
            
			function validateRegistrationForm(formName)
			{
			    var field;
			    
				errDefault = "Not all fields are valid!\n\n";
				
				errMsg = errDefault;
				
				formPosted = true;
				
			    for(i = 0; i < document.forms[formName].length; i++)
			    {
			        field = document.forms[formName][i];
				    
			        if(field.type.toUpperCase() == text)
			        {
			            if(field.name.toUpperCase() == email)
			            {
			                if(!checkEmailTextBox(field))
			                    addError(field.name + " must be valid.");
			            }
			            else
			            {
			                if(!checkTextBox(field))
			                    addError(field.name + " cannot be blank.");
			            }
			        }
			        else if(field.nodeName.toUpperCase() == select)
			        {
			            if(!checkSelect(field))
			                addError(field.name + " must contain a valid selection.");
			        }
			    }
                
				if(!(errMsg == errDefault))
				{
					showTextWarning(true);
					return false;
				}
				else
				{
					showTextWarning(false);
					return true;
				}
			}		
			
			//concatenate line (addMessage) to current error message
			function addError(addMessage)
			{
				addMessage = addMessage.replace("_", " ");
				
				errMsg = errMsg + addMessage + "\n";
			}
			
			function showTextWarning(display)
			{
				if(display)
				{
					if(!errDisplayedOnce)
					{
						document.getElementById("formWarningID").style.display = "block";
						errDisplayedOnce = true;
					}
					else
					{
						alert(errMsg);
					}
				}
				else
				{
					document.getElementById("formWarningID").style.display = "none";
					errDisplayedOnce = false;
				}
			}
			
			function checkTextBox(textBox)
			{
				if(!formPosted)
					return true;
					
				var notBlank = stringNotBlank(textBox.value);
				
				if(notBlank)
					objectBackRed(textBox, false);
				else
					objectBackRed(textBox, true);

				return notBlank;
			}
			
			function checkEmailTextBox(textBox)
			{
				if(!formPosted)
					return true;
					
				var validEmail = checkEmail(textBox.value);

				if(validEmail)
					objectBackRed(textBox, false);
				else
					objectBackRed(textBox, true);

				return validEmail;
			}
			
			function checkSelect(selectObject)
			{
				if(!formPosted)
					return true;
					
				var notFirstIndexSelected = (selectObject.selectedIndex != 0);
					
				if(notFirstIndexSelected)
				    objectBackRed(selectObject, false);
				else
				    objectBackRed(selectObject, true);
				    
				return notFirstIndexSelected;
			}

			function clearBackTextBox(textBox)
			{
			    objectBackRed(textBox, false);
			}
			
			function objectBackRed(textObject, makeRed)
			{
				if(makeRed)
					textObject.style.backgroundColor = "red";
				else
					textObject.style.backgroundColor = "white";
			}
			
			function stringNotBlank(strInput)
			{
				if(strInput.length > 0)
					return true;
				else
					return false;
			}
			
			function checkEmail(strInput)
			{
				var email = strInput;
	
				contains1 = "@";
				contains2 = ".";

				contains1IndexFound = 0;
				contains2IndexFound = 0;

				if(email.indexOf(contains1) == -1)
					return false;
				else
				{
					contains1IndexFound = email.indexOf(contains1);
					email = email.replace(contains1, "");
				}
				
				if(email.indexOf(contains2) == -1)
					return false;
				else
					contains2IndexFound = email.lastIndexOf(contains2);

				if(contains1IndexFound < contains2IndexFound)
					return true;
				else
					return false;
			}
		
		    function resetForm()
		    {
		        var field;
				for(i = 0; i < document.forms.length; i++)
				{
				    for(ii = 0; ii < document.forms[i].length; ii++)
				    {
				        field = document.forms[i][ii];
    				    
				        if(field.type.toUpperCase() == text)
				        {
				            clearBackTextBox(field);
				            field.value = "";
				        }
				        else if(field.nodeName.toUpperCase() == select)
				        {
				            clearBackTextBox(field);
				            field.selectedIndex = 0;
				        }
			        }
    			}
				
			    formPosted = false;
			    showTextWarning(false);
		    }
	    
// --> 