anchor.diff:  <%@taglib prefix="templ" tagdir="/WEB-INF/tags/template"%>
   <html>
   <head>
  -<%--<title>Set up Period ${period.name} of ${studySegment.qualifiedName} in ${study.name}</title>--%>
  +<title>Set up ${period.displayName} of ${studySegment.qualifiedName} in ${study.name}</title>
   <tags:includeScriptaculous/>
   <script type="text/javascript">
  -var activitiesAutocompleter;
  -        function currentActivityCount() {
  -            return $$('.input-row').length;
  -        }
  +function currentActivityCount() {
  +    return $$('.input-row').length;
  +}
   
   function selectedActivity() {
       return selectedValue('add-activity')
  
positive.code:         width:400px;
          background-color:white;
          border:1px solid #ccc;
          margin:0px;
          padding:0px;
          font-size:0.8em;
          text-align:left;
          max-height:200px;
  
negative.code: 
      Droppables.add( $('deleteDrop'), {accept:'marker',hoverclass: 'hoverActive',onDrop:deleteEvent})
  }
  
  
  	var PERIOD_DURATION = 7;
  
  function moveEvent(draggable,dropZone) {
      var wholeElement = dropZone.getElementsBySelector("span")[0]
      var elementId = dropZone.getElementsBySelector("span")[0].id
  
      var parentElement = draggable.parentNode.getElementsBySelector("span")[0]
      if (parentElement == null) {
          //means we are drugging a new event
          if (wholeElement.firstChild == null) {
              ajaxform(null, elementId, true, null, null)
              setUpMarker(draggable, dropZone)
          }
      } else {
          //means we are moving event from one cell to another
          var parentElementId = parentElement.id
          var arrayOfIndisesForParent = parseInput(parentElementId)
          var arrayOfIndisesForChild = parseInput(elementId)
          if (arrayOfIndisesForParent[0]== arrayOfIndisesForChild[0]) {
              //need to set up ajax call for move
              if (wholeElement.firstChild == null) {
                  moveAjaxForm(arrayOfIndisesForParent, arrayOfIndisesForChild, false)
                  setUpMovingMarker(draggable, dropZone)
              }
          }
      }
  }
  
  
  function setUpMarker(draggable, dropZone) {
      var prevDurationIndex = draggable.currentDurationIndex;
      var newDurationIndex = dropZone.durationIndex;
      var activity = (typeof(draggable.activity) != 'undefined')? draggable.activity : dropZone.parentNode.getElementsByClassName('activity')[0].innerHTML.strip();
      if(prevDurationIndex != newDurationIndex && activity == dropZone.parentNode.getElementsByClassName('activity')[0].innerHTML.strip()) {
          var marker = createMarker(newDurationIndex, activity);
          dropZone.appendChild(marker);
  
          draggable.parentNode.removeChild(draggable);
          if(draggable.className=='newMarker') {
              var div = Builder.node("div", { className: 'newMarker' })
              div.innerHTML = 'X';
              new Draggable(div, { revert: true } );
              $('newMarkerArea').appendChild(div);
          }
      }
  }    
  
  
  function setUpMovingMarker(draggable, dropZone) {
      draggable.innerHTML='';
      var element = dropZone.getElementsBySelector("span")[0];
      element.innerHTML='X';
  }
  
  function deleteEvent(draggable,dropZone) {
      var element = draggable.parentNode.getElementsBySelector("span")[0].id
      ajaxform(null, element, false, null, null)
  
      var prevDurationIndex = draggable.currentDurationIndex;
      var prevActivity = draggable.activity;
      draggable.innerHTML = '';
  }
  
  
  function createMarker(currentDurationIndex, activityName) {
      var marker = document.createElement('span');
      marker.innerHTML = 'X';
      marker.className='marker';
      marker.currentDurationIndex = currentDurationIndex;
      marker.activity = activityName;
      new Draggable(marker,{revert: true});
      return marker;
  }
  
  
  Event.observe(window, "load", registerHandlers)
  Event.observe(window, "load", showEmptyMessage)
  Event.observe(window, "load", registerDraggablesAndDroppables)
  
  </script>
  
  <!-- ////// ACTIVITIES AUTOCOMPLETER -->
  <script type="text/javascript">
  var activitiesAutocompleter;
  
  function resetActivitiesAutocompleter() {
      activitiesAutocompleter.reset();
  