anchor.diff:          }
   
           function selectedActivity() {
  -            var selector = $('add-activity')
  +            return selectedValue('add-activity')
  +        }
  +
  +        function selectedValue(selectorName) {
  +            var selector = $(selectorName)
               var selected = selector.options[selector.selectedIndex]
               return {
                   name: selected.text,
  
positive.code:             SC.slideAndShow(rowId)
          }
  
          function showEmptyMessage() {
              if (currentActivityCount() > 0) {
                  SC.slideAndHide('no-activities-message');
  
negative.code:     <title>Set up Period ${period.name} of ${study.name}</title>
      <tags:includeScriptaculous/>
      <script type="text/javascript">
          var activitiesByType = { }
          <c:forEach items="${activityTypes}" var="activityType">
          activitiesByType[${activityType.id}] = []
          </c:forEach>
          <c:forEach items="${activities}" var="activity">
          activitiesByType[${activity.type.id}].push({ name: '${activity.name}', id: ${activity.id} })
          </c:forEach>
          var initiallySelectedActivity = ${empty selectedActivity ? 0 : selectedActivity.id}
  
          function currentActivityCount() {
              return $$('.input-row').length;
          }
  