anchor.diff:  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 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') {
  +        if (draggable.className == 'newMarker') {
               var div = Builder.node("div", { className: 'newMarker' })
               div.innerHTML = 'X';
  -            new Draggable(div, { revert: true } );
  +            new Draggable(div, { revert: true });
               $('newMarkerArea').appendChild(div);
           }
       }
  -}    
  +}
   
   
   function setUpMovingMarker(draggable, dropZone) {
  -    draggable.innerHTML='';
  +    draggable.innerHTML = '';
       var element = dropZone.getElementsBySelector("span")[0];
  -    element.innerHTML='X';
  -}
  -
  -function deleteEvent(draggable,dropZone) {
  +    element.innerHTML = 'X';
  +}
  +
  +function deleteEvent(draggable, dropZone) {
       var element = draggable.parentNode.getElementsBySelector("span")[0].id
       ajaxform(null, element, false, null, null)
   
  
positive.code:     Event.observe('add-activity-button', 'click', addActivityRow)
      Event.observe('add-activity-button', 'click', resetActivitiesAutocompleter)
      Event.observe('return-to-template', 'click', function() {
          location.href='<c:url value="/pages/cal/template?studySegment=${studySegment.id}&study=${study.id}&amendment=${study.developmentAmendment.id}"/>'
      })
  }
  
  function makeCellDraggableAndDroppable(input) {
      document.getElementsByClassName('marker').each(
          function(item) {
              new Draggable(item,{revert: true});
              item.currentDurationIndex = item.parentNode.durationIndex;
              item.activity = item.parentNode.parentNode.getElementsByClassName('activity')[0].innerHTML.strip();
          }
          );
  
      Droppables.add( $('deleteDrop'), {accept:'marker',hoverclass: 'hoverActive',onDrop:deleteEvent})
  }
  
  function registerDraggablesAndDroppables() {
      document.getElementsByClassName('newMarker').each(
          function(item) {new Draggable(item, {revert: true});
        }
      );
  
      var x=0;
      document.getElementsByClassName('counter').each(
          function(item) {Droppables.add(item, {
                      accept:['marker','newMarker'],
                      hoverclass: 'hoverActive',
                      onDrop: moveEvent })
              item.durationIndex = x;
              x = (x == PERIOD_DURATION-1) ? 0 : (x+1);
          }
      );
  
      document.getElementsByClassName('marker').each(
          function(item) {new Draggable(item,{revert: true});
              item.currentDurationIndex = item.parentNode.durationIndex;
              item.activity = item.parentNode.parentNode.getElementsByClassName('activity')[0].innerHTML.strip();
          }
      );
  
      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
  
  
negative.code:     } else {
          //means we are moving event from one cell to another
          var parentElementId = parentElement.id
          var parentRC = extractRowAndColumn(parentElementId)
          var childRC = extractRowAndColumn(elementId)
          if (parentRC[0] == childRC[0]) {
              //need to set up ajax call for move
              if (wholeElement.firstChild == null) {
                  moveAjaxForm(parentRC, childRC)
                  setUpMovingMarker(draggable, dropZone)
              }
          }
  