  /*if the document has finished loading*/
  $(document).ready(function () {
    /*when the sector option changes set the value for the listName and sector
    required by pure*/
    $("#accName").change(function(event) {
      var optionvalue;
      optionvalue = $("#accName").val();
      $("#sector").val($("#accName").val());    
      if(optionvalue == 'primarye-assemblies') {        
        $("#listName").val("non_paf_sub");
      } else {
        $("#listName").val("non_saf_sub");
      }
    });
    
    /*some form validation */
    $("form").submit(function(event) {
      if($("#email").val() == "") {
        alert("You must enter an email.");
        return false;
      } else if($("#job_title").val() == "") {
        alert("Please select you role.");
        return false;        
      }
    });
    /*end form validation */
    
  });  
