function doSubmitInfo(form)
{
  try
  {
    var orderArray = new Array();//an array of the fields that will be included in the email
    var arrayIndex = 0;
    var orderString = "";
    var itmname;

    trimTextElements(form);

    if (document.mailform.Course_Name.value=="")
    {
      alert("Please enter the course name.");
      document.mailform.Course_Name.focus();
      return false;
    }
    if (document.mailform.Course_Number.value=="")
    {
      alert("Please enter the course number.");
      document.mailform.Course_Number.focus();
      return false;
    }
    if (document.mailform.Present_Text_Used.value=="")
    {
      alert("Please enter the present text used in the course.");
      document.mailform.Present_Text_Used.focus();
      return false;  
    }
    if (document.mailform.Enrolment.value=="")
    {
      alert("Please enter the enrolment details.");
      document.mailform.Enrolment.focus();
      return false;  
    }
    if (document.mailform.Course_Start_Date.value=="")
    {
      alert("Please enter the course start date.");
      document.mailform.Course_Start_Date.focus();
      return false;  
    }

    detailsExists=false;
    detailsOptions=document.mailform.Details;
    for (i=0; i<detailsOptions.length; i++)
      if (detailsOptions.item(i).checked)
        detailsExists=true;
    if (document.mailform.Details_Other.value!="")
        detailsExists=true;
    
    if (!detailsExists)
    {
      alert("Please enter the reason for requesting.");
      document.mailform.Details[0].focus();
      return false;  
    }

    if (document.mailform.Instructors_Name.value=="")
    {
      alert("Please enter the instructor's name.");
      document.mailform.Instructors_Name.focus();
      return false;  
    }
    if (document.mailform.Department.value=="")
    {
      alert("Please enter the department.");
      document.mailform.Department.focus();
      return false;  
    }
    if (document.mailform.Institution.value=="")
    {
      alert("Please enter the institution's name.");
      document.mailform.Institution.focus();
      return false;  
    }
    if (document.mailform.Address.value=="")
    {
      alert("Please enter the instructor's address.");
      document.mailform.Address.focus();
      return false;  
    }
    if (document.mailform.addressType.selectedIndex==0)
    {
      alert("Please select the address type for the instructor's address.");
      document.mailform.addressType.focus();
      return false;  
    }  
    
    if (document.mailform.City.value=="")
    {
      alert("Please enter the instructor's city.");
      document.mailform.City.focus();
      return false;  
    }  
    if (document.mailform.Province.value=="")
    {
      alert("Please enter the instructor's province.");
      document.mailform.Province.focus();
      return false;  
    }
    if (document.mailform.Postal.value=="")
    {
      alert("Please enter the instructor's postal code.");
      document.mailform.Postal.focus();
      return false;    
    }
    if (document.mailform.Country.selectedIndex<1)
    {
      alert("Please select the instructor's country.");
      document.mailform.Country.focus();
      return false;  
    }
    if (document.mailform.SenderEmail.value=="")
    {
      alert("Please enter the instructor's email address!");
      document.mailform.SenderEmail.focus();
      return false;
    }
    if (document.mailform.SenderEmail.value.indexOf("@") == -1 || document.mailform.SenderEmail.value.indexOf(".") == -1)
    {
      alert("You do not have a valid email address.");
      document.mailform.SenderEmail.focus();
      return false;
    }
    if (document.mailform.Phone.value=="")
    {
      alert("Please enter the instructor's phone number.");
      document.mailform.Phone.focus();
      return false;
    }

    titleExists=false;
    for (i=1; i<=5; i++)
      if (document.getElementById("Title"+i).value=="" && document.getElementById("Title"+i+"_ISBN").value=="" && document.getElementById("Title"+i+"_Quantity").value=="")
        continue;
      else
      if (document.getElementById("Title"+i).value=="" || document.getElementById("Title"+i+"_ISBN").value=="" || document.getElementById("Title"+i+"_Quantity").value=="")
      {
        if (document.getElementById("Title"+i).value=="")
          document.getElementById("Title"+i).focus();
        else
        if (document.getElementById("Title"+i+"_ISBN").value=="")
          document.getElementById("Title"+i+"_ISBN").focus();
        else
        if (document.getElementById("Title"+i+"_Quantity").value=="")
          document.getElementById("Title"+i+"_Quantity").focus();

        alert("Please enter the title, ISBN and quantity for the inspection copy.");
        return false;  
      }
      else
        titleExists=true;

    if (!titleExists)
    {
      alert("Please enter the title, ISBN and quantity for the inspection copy.");
      document.getElementById("Title1").focus();
      return false;  
    }


    for(var i = 0; i < form.elements.length; i++ )
    {//do not include hidden fields or buttons in the form evaluation
      if(form.elements[i].type != "hidden" && form.elements[i].type != "button" && form.elements[i].type != "reset" && form.elements[i].type != "submit")
      {
        itmname = form.elements[i].name;
        orderArray[arrayIndex++] = itmname;//add name of this item to the array at next open index
      }
    }

    var lastItemIdx = orderArray.length;
    for(var ctr = 0; ctr < lastItemIdx; ctr++)
    {
      if(orderString.indexOf(orderArray[ctr]) == -1)
        orderString += orderArray[ctr] + ',';
    }
    orderString = orderString.substring(0, orderString.length-1);//lop off the last character (",")
    form.FieldOrder.value = orderString;
    //form.submit();
    return true; 
  }
  catch (e)
  {
    alert("Form could not be submitted due to an error:"+e.message);
    return false;
  }
}

