
  /*Start of form validation:*/
  function validateForm(formElement) {
    
  
    if (formElement.SESSION_TITLE.value.length < 2)
      return focusElement(formElement.SESSION_TITLE,
       'Please enter an appropriate session title');
    
 	if (formElement.INTENDED_AUDIENCE.value.length < 1)
      return focusElement(formElement.INTENDED_AUDIENCE,
       'Please select the intended audience for this session');
	  
	if (formElement.ABSTRACT_SUMMARY.value.length < 10)
      return focusElement(formElement.ABSTRACT_SUMMARY,
       'You have not provided us with an abstract summary');
	  
	if (formElement.BEHAV_OBJ_1.value.length < 10)
      return focusElement(formElement.BEHAV_OBJ_1,
       'Behavioral Objective 1 cannot be empty');
	  
	 if (formElement.BEHAV_OBJ_2.value.length < 10)
      return focusElement(formElement.BEHAV_OBJ_2,
       'Behavioral Objective 2 cannot be empty');
	  
	 if (formElement.BEHAV_OBJ_3.value.length < 10)
      return focusElement(formElement.BEHAV_OBJ_3,
       'Behavioral Objective 3 cannot be empty');
	  
	if (formElement.PRESENTATION_TYPE.value.length < 1)
      return focusElement(formElement.PRESENTATION_TYPE,
       'Presentation type is required');
	  
	if (formElement.ROLE_IN_SESSION.value.length < 1)
      return focusElement(formElement.ROLE_IN_SESSION,
       'Please select your role in this session');
	  
	if (formElement.NUM_PRESENTERS.value.length < 1)
      return focusElement(formElement.NUM_PRESENTERS,
       'Please select the number of presenters for this session');
	  
	if (formElement.PRESENTATION_TIME.value.length < 1)
      return focusElement(formElement.PRESENTATION_TIME,
       'Please select the presentation time');
	  
	if (formElement.TRACK_OPTIONS.value.length < 1)
      return focusElement(formElement.TRACK_OPTIONS,
       'Please select the track options for this session');
	

    //If all is OK, return true and let the form submit
    return true;
  }
  /*End of form validation.*/

  /*Below are various functions that can be
   re-used in your own validation scripts:*/
  function focusElement(element, errorMessage) {
    //Tell the user an error has been made
    alert((errorMessage.length > 0) ? errorMessage :
      'You did not enter valid data; Please try again');
    //Select the text in the input box, and focus it (if possible)
    if (element.select) element.select();
    if (element.focus) element.focus();
  
    return false;
  }
  function countSelected(formElement, inputType, inputName) {
    //If there is no input type, make it checkbox
    if (inputType == null) inputType = 'checkbox';
    var returnValue = 0;
    //Loop for all elements in this form
    for (var loopCounter = 0; loopCounter < formElement.length; loopCounter++) {
      //If this element is the wanted type
      var element = formElement.elements[loopCounter];
      if (element.type == inputType && element.checked == true) {
        //If we have the correct control name, increment the count
        if (inputName.length > 0)
          if (element.name == inputName)
            returnValue++;
        else
          returnValue++
      }
    }
    //Return the count
    return returnValue;
  }
  function countSelectedOptions(selectElement) {
    var returnValue = 0;
    //Loop for all options
    for (var loopCounter = 0; loopCounter < selectElement.options.length; loopCounter++)
      if (selectElement.options[loopCounter].selected == true)
        returnValue++;
    return returnValue;
  }
  function validEmail(email) {
    var emailRE = new RegExp(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/);
    return emailRE.test(email);
  }
  /*End of functions.*/
  
  