anchor.diff:                  if (!clicked) {
                       var typeInput = $('<select id="sourceTypes" name="sourceTypes">')
                       for (var i =0; i < activityTypes.length; i++) {
  -                        var activityTypeId = activityTypes[i].activity_type_id
                           var activityTypeName = activityTypes[i].activity_type_name
  -                        var row = $('<option id="type" class="type" value="'+ activityTypeId +'"/>').text(activityTypeName);
  +                        var row = $('<option id="type" class="type" value="'+ activityTypeName +'"/>').text(activityTypeName);
                           typeInput.append(row);
                       }
   
  
positive.code:                 var activitySource= $('#sources').val()
  
                  var element = '<Activity name=\"' + activityName +'\" code=\"' + activityCode +'\" description=\"'
                          + activityName +'\" type=\"'+activityTypeName+'\" type-id=\"' + activityTypeId +'\" source=\"'
                          + activitySource + '\"/>'
  
                  clearErrorMessage();
                  $.ajax({
  
negative.code:                     // Build custom request
                      var parms = "";
                      if (sort != null) {
                          parms += "sort=" + sort;
                      }
                      return  parms +
                              "&order=" + dir +
  