function validateForm(){

  if  (document.form1.courseName.value == "blank") 
  {                                         
	alert("You must provide the course name.");   
	document.form1.courseName.focus();                                      
	return false;                                         
  }
  
  if  (document.form1.courseSection.value == "blank") 
  {                                         
	alert("You must provide the course section.");   
	document.form1.courseSection.focus();                                      
	return false;                                         
  }

  if  (document.form1.instructor.value == "") 
  {                                         
	alert("You must provide the instructor's name.");   
	document.form1.instructor.focus();                                      
	return false;                                         
  }

  if  (document.form1.instructorEmail.value == "") 
  {                                         
	alert("You must provide the instructor's email address.");   
	document.form1.instructorEmail.focus();                                      
	return false;                                         
  }
  

  if ( (document.form1.instructorEmail.value.indexOf("@") == "-1") || (document.form1.instructorEmail.value.indexOf(".") == "-1") ) 
  {
  	alert ("Please enter a valid email address.");	
    document.form1.instructorEmail.focus();                                      
	return false; 
  }

  if  (document.form1.semester.value == "blank") 
  {                                         
	alert("You must provide the semester.");   
	document.form1.semester.focus();                                      
	return false;                                         
  }

  if  (document.form1.student1.value == "") 
  {                                         
	alert("You must provide a student name for student 1.");   
	document.form1.student1.focus();                                      
	return false;                                         
  }
  
    if  (document.form1.username1.value == "") 
  {                                         
	alert("You must provide a username for student 1.");   
	document.form1.username1.focus();                                      
	return false;                                         
  }

  if ( (document.form1.username1.value.indexOf("@") == "-1") || (document.form1.username1.value.indexOf(".") == "-1") ) 
  {
  	alert ("Please enter a valid username for student 1.");	
    document.form1.username1.focus();                                      
	return false; 
  }
  
  if ((document.form1.student2.value != "") || (document.form1.username2.value != "")) 
  {
	  if  (document.form1.student2.value == "") 
	  {                                         
		alert("You must provide a student name for student 2.");   
		document.form1.student2.focus();                                      
		return false;                                         
	  }
	  
		if  (document.form1.username2.value == "") 
	  {                                         
		alert("You must provide a username for student 2.");   
		document.form1.username2.focus();                                      
		return false;                                         
	  }
	
	  if ( (document.form1.username2.value.indexOf("@") == "-1") || (document.form1.username2.value.indexOf(".") == "-1") ) 
	  {
		alert ("Please enter a valid username for student 2.");	
		document.form1.username2.focus();                                      
		return false; 
	  }
  }
  
  if ((document.form1.student3.value != "") || (document.form1.username3.value != "")) 
  {
	  if  (document.form1.student3.value == "") 
	  {                                         
		alert("You must provide a student name for student 3.");   
		document.form1.student3.focus();                                      
		return false;                                         
	  }
	  
		if  (document.form1.username3.value == "") 
	  {                                         
		alert("You must provide a username for student 3.");   
		document.form1.username3.focus();                                      
		return false;                                         
	  }
	
	  if ( (document.form1.username3.value.indexOf("@") == "-1") || (document.form1.username3.value.indexOf(".") == "-1") ) 
	  {
		alert ("Please enter a valid username for student 3.");	
		document.form1.username3.focus();                                      
		return false; 
	  }
  }
  
  if ((document.form1.student4.value != "") || (document.form1.username4.value != "")) 
  {
	  if  (document.form1.student4.value == "") 
	  {                                         
		alert("You must provide a student name for student 4.");   
		document.form1.student4.focus();                                      
		return false;                                         
	  }
	  
		if  (document.form1.username4.value == "") 
	  {                                         
		alert("You must provide a username for student 4.");   
		document.form1.username4.focus();                                      
		return false;                                         
	  }
	
	  if ( (document.form1.username4.value.indexOf("@") == "-1") || (document.form1.username4.value.indexOf(".") == "-1") ) 
	  {
		alert ("Please enter a valid username for student 4.");	
		document.form1.username4.focus();                                      
		return false; 
	  }
  }
  
  if ((document.form1.student5.value != "") || (document.form1.username5.value != "")) 
  {
	  if  (document.form1.student5.value == "") 
	  {                                         
		alert("You must provide a student name for student 5.");   
		document.form1.student5.focus();                                      
		return false;                                         
	  }
	  
		if  (document.form1.username5.value == "") 
	  {                                         
		alert("You must provide a username for student 5.");   
		document.form1.username5.focus();                                      
		return false;                                         
	  }
	
	  if ( (document.form1.username5.value.indexOf("@") == "-1") || (document.form1.username5.value.indexOf(".") == "-1") ) 
	  {
		alert ("Please enter a valid username for student 5.");	
		document.form1.username5.focus();                                      
		return false; 
	  }
  }
  
  if ((document.form1.student6.value != "") || (document.form1.username6.value != "")) 
  {
	  if  (document.form1.student6.value == "") 
	  {                                         
		alert("You must provide a student name for student 6.");   
		document.form1.student6.focus();                                      
		return false;                                         
	  }
	  
		if  (document.form1.username6.value == "") 
	  {                                         
		alert("You must provide a username for student 6.");   
		document.form1.username6.focus();                                      
		return false;                                         
	  }
	
	  if ( (document.form1.username6.value.indexOf("@") == "-1") || (document.form1.username6.value.indexOf(".") == "-1") ) 
	  {
		alert ("Please enter a valid username for student 6.");	
		document.form1.username6.focus();                                      
		return false; 
	  }
  }
  
  if ((document.form1.student7.value != "") || (document.form1.username7.value != "")) 
  {
	  if  (document.form1.student7.value == "") 
	  {                                         
		alert("You must provide a student name for student 7.");   
		document.form1.student7.focus();                                      
		return false;                                         
	  }
	  
		if  (document.form1.username7.value == "") 
	  {                                         
		alert("You must provide a username for student 7.");   
		document.form1.username7.focus();                                      
		return false;                                         
	  }
	
	  if ( (document.form1.username7.value.indexOf("@") == "-1") || (document.form1.username7.value.indexOf(".") == "-1") ) 
	  {
		alert ("Please enter a valid username for student 7.");	
		document.form1.username7.focus();                                      
		return false; 
	  }
  }
  
  if ((document.form1.student8.value != "") || (document.form1.username8.value != "")) 
  {
	  if  (document.form1.student8.value == "") 
	  {                                         
		alert("You must provide a student name for student 8.");   
		document.form1.student8.focus();                                      
		return false;                                         
	  }
	  
		if  (document.form1.username8.value == "") 
	  {                                         
		alert("You must provide a username for student 8.");   
		document.form1.username8.focus();                                      
		return false;                                         
	  }
	
	  if ( (document.form1.username8.value.indexOf("@") == "-1") || (document.form1.username8.value.indexOf(".") == "-1") ) 
	  {
		alert ("Please enter a valid username for student 8.");	
		document.form1.username8.focus();                                      
		return false; 
	  }
  }
  
  if ((document.form1.student9.value != "") || (document.form1.username9.value != "")) 
  {
	  if  (document.form1.student9.value == "") 
	  {                                         
		alert("You must provide a student name for student 9.");   
		document.form1.student9.focus();                                      
		return false;                                         
	  }
	  
		if  (document.form1.username9.value == "") 
	  {                                         
		alert("You must provide a username for student 9.");   
		document.form1.username9.focus();                                      
		return false;                                         
	  }
	
	  if ( (document.form1.username9.value.indexOf("@") == "-1") || (document.form1.username9.value.indexOf(".") == "-1") ) 
	  {
		alert ("Please enter a valid username for student 9.");	
		document.form1.username9.focus();                                      
		return false; 
	  }
  }
  
  if ((document.form1.student10.value != "") || (document.form1.username10.value != "")) 
  {
	  if  (document.form1.student10.value == "") 
	  {                                         
		alert("You must provide a student name for student 10.");   
		document.form1.student10.focus();                                      
		return false;                                         
	  }
	  
		if  (document.form1.username10.value == "") 
	  {                                         
		alert("You must provide a username for student 10.");   
		document.form1.username10.focus();                                      
		return false;                                         
	  }
	
	  if ( (document.form1.username10.value.indexOf("@") == "-1") || (document.form1.username10.value.indexOf(".") == "-1") ) 
	  {
		alert ("Please enter a valid username for student 10.");	
		document.form1.username10.focus();                                      
		return false; 
	  }
  }

  if  (document.form1.accept.checked == false) 
  {                                         
	alert("You must certify that you have read and understand the entire form.");   
	document.form1.accept.focus();                                      
	return false;                                         
  }


document.form1.submit();
}
