anchor.diff:  <script
   	src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
   <script>
  -	function changeStatus(availability){
  +	var id = <%=id%>, type;
  +	function showTickets(){
  +		$("#waitinglistbody").empty();
  +		$.ajax({
  +			url : "http://<%=request.getServerName()%>:7001/rms/tickets",
  +			data: {id: <%=id%>, type: type},
  +			cache: false,
  +			success: function(data) {
  +				for (i = 0; i < data.length; i++){
  +					str = "<tr>"
  +						+ "<td>" + data[i].number + "<td>"
  +						+ "<td>" + data[i].size + "<td>"
  +						+ "<td>" + toTime(data[i].getTime) + "<td>"
  +						+ "<td>";
  +					if (data[i].callTime != null){
  +						str += toTime(data[i].callTime);
  +					}
  +					str += "</td></tr>";
  +					$("#waitinglistbody").append(str);
  +				}
  +			}
  +		});
  +	}
  +	
  +	function changeStatus(availability){ 
   		if (availability == false){
  -			$('#status').val('true');
  -			$('#status').text('Start');
  -			$('#statusSpan').attr({"title" : "Start Dispensing Tickets"});
  +			$("#status").val("true");
  +			$("#status").text("Start");
  +			$("#status").attr({"title" : "Start distributing tickets"});
   		}
   		else{
  -			$('#status').val('false');
  -			$('#status').text('Stop');
  -			$('#statusSpan').attr({"title" : "Stop Dispensing Tickets"});
  +			$("#status").val("false");
  +			$("#status").text("Stop");
  +			$("#status").attr({"title" : "Stop distributing tickets"});
   		}
  +	}
  +	
  +	var date = new Date();
  +	function toTime(timestamp){
  +		date.setTime(timestamp);
  +		return ("00" + date.getHours()).slice(-2) + ":" + ("00" + date.getMinutes()).slice(-2);
   	}
   	
   	$(document).ready(function() {
  
positive.code: 
  <body>
  	<div id="menu">
  		<span id="statusSpan"><button type="button" id="status"></button></span>
  		<span id="tickettypes"></span>
  		<button type="button">+</button>
  		<button type="button">Restaurant Info</button>
  		<button type="button" id="accountButton">Account Info</button>
  		<button type="button">Sign Out</button>
  	</div>
  	<div>
  		
  		<table class="content" id="waitinglist">
  			<tr>
  				<th>No.</th>
  				<th>Size</th>
  				<th>Get</th>
  				<th>Call</th>
  				<th></th>
  			</tr>
  		</table>
  	</div>
  </body>
  </html>
negative.code: 			data: {id: <%=id%>},
  			success: function(data) {
  				for (i = 0; i < data.length; i++)
  					$("#showtickets").append("<button value='"+ data[i].type + "' "
  						+ "title='Show "+ String.fromCharCode(data[i].type+64) +" tickets'>"
  						+ String.fromCharCode(data[i].type+64) + "</button>");
  			}
  		});
  		
  		$.ajax({
  			url: "http://<%=request.getServerName()%>:7001/rms/restaurant",
  			data: {id: id},
  			cache: false,
  			success: function(data) {
  				changeStatus(data.availability);
  				$("h2").append("Welcome to the Reservation Management System for " + data.name + ".");
  			}
  		});
  		
  		$(".content").hide();
  		
  		$("#showtickets").on("click", "button", function(){
  			type = $(this).val();
  			$("h2").text($(this).text() + " Tickets");
  			$(".content").hide();
  			$("#waitinglist").show();
  			showTickets();
  			$.ajax({
  				url : "http://<%=request.getServerName()%>:7001/rms/tickettypes",
  				data: {id: id},
  				cache: false,
  				success: function(data) {
  					if (type == 1) i = 1;
  					else i = data[type-2].maxSize + 1;
  					$("#add").empty();
  					$("#add").append("<option>Add Ticket</option>")
  					for (; i <= data[type-1].maxSize; i++)
  						$("#add").append("<option>" + i + "</option>");
  				}
  			});
  			$("#call").val($(this).val());
  		});
  		
  		$("#add").hover(function(){
  		    $("#add option:first-child").text("Select Size");
  		}, function(){
  		    $("#add option:first-child").text("Add Ticket");
  		});
  		
  		$("#add").change(function(){
  			$.ajax({
  				url : "http://<%=request.getServerName()%>:7001/rms/ticket/create",
  				data: {id: id, type: type, size: $("#add").val()},
  				cache: false,
  				success: function(data) {
  					$("#waitinglistbody").empty();
  					showTickets();
  				}
  			});
  			$("#add")[0].selectedIndex = 0;
  		});
  		
  		$("#status").click(function(){
  			$.ajax({
  				url : "http://<%=request.getServerName()%>:7001/rms/restaurant/waitinglist",
  				data: {id: id, status: $("#status").val()},
  				cache: false,
  				success: function(data) {
  					if (data == true) changeStatus($("#status").val() == "true");
  				}
  			});
  		});
  