anchor.diff:                      var time = hour+":"+min+" "+ampm;
                       var btime = hour+":"+min+" "+ampm+" "+weekDay+"<br>"+month+" "+dayOfMonth+", "+year
                       message = "<p><strong>" + show["name"] + "<br />" + btime + "<br />" + show["location"] + "</strong>.</p>";
  -                    $("#deletionBody").html(message)
  -                    
  +                    $("#deletionBuyBody").html(message)    
  +                    $("#deleteBuyButton").attr("show-id", allData["buyrequests"][index]["id"]);
                       });
                   })(i);
               }
  -            $("#deleteButton").on('click', function(e){
  -                $("#" + deletionId).replaceWith("<p>Request deleted.</p>")
  -            });
           });
       
  -    $("#logout").click(function(){
  -        $.post('logout');
  -    });
  +    }
  +
  +    function deleteSellRequest(element) {
  +        console.log("you are cancelling a sell request")
  +        $.ajax({
  +            url : "/cancel-sell",
  +            type: "POST",
  +            data: JSON.stringify({sell_request_id: element.getAttribute('show-id')}),
  +            contentType: "application/json; charset=utf-8",
  +            dataType   : "json",
  +            success    : function(data){
  +                if (data['status']=="ok") {
  +                    window.location = '/my-tix'
  +                }
  +                else {
  +                    window.alert("There was an error cancelling your sell request: " + data['reason'])
  +                }
  +            }
  +        })
  +        $("#" + deleteSellId).replaceWith("<p>Request deleted.</p>")
  +    }
  +
  +    function deleteBuyRequest(element) {
  +        console.log("you are cancelling a buy request")
  +        $.ajax({
  +            url : "/cancel-buy",
  +            type: "POST",
  +            data: JSON.stringify({buy_request_id: element.getAttribute('show-id')}),
  +            contentType: "application/json; charset=utf-8",
  +            dataType   : "json",
  +            success    : function(data){
  +                if (data['status']=="ok") {
  +                    window.location = '/my-tix'
  +                }
  +                else {
  +                    window.alert("There was an error cancelling your buy request: " + data['reason'])
  +                }
  +            }
  +        })
  +        $("#" + deleteBuyId).replaceWith("<p>Request deleted.</p>")
  +    }
  +
  +    var text = "<a id='logout' href='javascript:void(0)'> Logout </a>"
  +  if(netid === ""){
  +    text = "<a href='login'> Login </a>"
  +  }
  +
  +  $("#logoutLink").html(text);
  +  
  +  $("#logout").click(function(){
  +    $.post('logout');
  +  });
  +
  +  $(document).ready(function(){
  +  });
       
  -    }
  +    
   </script>
positive.code:             if(sgroup.search("SOLD OUT") >= 0){
                  sgroup = "";
              }
              sellRequests_html += "<div class='row' id='buying"+i+"'>"+
                      "<div class='col-md-2'>"+
                          "<a href='#'>" +
                              "<img class = 'center-block' src="+show["image"]+" alt='' style='height:150px'>"+
  
negative.code:                         "<h4>"+bgroup+"</h4>"+
                      "</div>"+
                      "<div class='col-md-2'>"+
                          "<button class='btn btn-primary' data-target='#confirm-buy-delete' data-toggle='modal' id = 'deleteBuying"+i+"'>Delete <span class='glyphicon'></span></button>"+
                      "</div>"+
                  "</div>"+
              "<hr>"
  