anchor.diff:              SC.slideAndShow(rowId)
           }
   
  +        function updateActivitySelector() {
  +            var selector = $('add-activity')
  +            selector.options.length = 0
  +            var selectedTypeId = selectedValue('select-activity-type').id
  +            var activities = activitiesByType[selectedTypeId]
  +            activities.each(function(elt) {
  +                var opt = new Option(elt.name, elt.id)
  +                if (elt.id == initiallySelectedActivity) opt.selected = true
  +                selector.options[selector.options.length] = opt
  +            })
  +        }
  +
           function showEmptyMessage() {
               if (currentActivityCount() > 0) {
                   SC.slideAndHide('no-activities-message');
  
positive.code:         <c:forEach items="${activityTypes}" var="activityType"><option value="${activityType.id}" <c:if test="${selectedActivity.type.id == activityType.id}">selected="selected"</c:if>>${activityType.name}</option></c:forEach>
      </select>
      <select id="add-activity">
          <c:forEach items="${activities}" var="activity"><option value="${activity.id}" <c:if test="${selectedActivity.id == activity.id}">selected="selected"</c:if>>${activity.name}</option></c:forEach>
      </select>
      <input type="button" id="add-activity-button" value="Add to period"/>
      <a id="newActivityLink" href="<c:url value="/pages/newActivity?returnToPeriodId=${period.id}"/>">Create new activity</a>
  
negative.code:         }
  
          function selectedActivity() {
              return selectedValue('add-activity')
          }
  
          function selectedValue(selectorName) {
              var selector = $(selectorName)
              var selected = selector.options[selector.selectedIndex]
              return {
                  name: selected.text,
  