			function makeComment(oid) {
				$("#make-comment-" + oid).show();
				$("#comment-" + oid).focus();
			}

			function cancelComment(oid) {
				$("#make-comment-" + oid).hide();
				$("#comment-" + oid).val("");
			}
			
			function attemptComment(oid) {
				var comment = $("#comment-" + oid).val();
				cancelComment(oid);
				$("#comment-waiting-" + oid).show();
				postComment(oid, comment, updateComment);
				
			}
			
var comment_block = "\
	<div class=comment>\
		<img class=owner src=\"/images/up/{{ comment.owner_link.oid }}.jpg\" style=\"height:12px; width:12px;\">\
		{{ comment.comment|safe }} -\
		<a href=\"{{comment.owner_link.oid}}\">{{comment.owner_link.name}}</a>\
	</div>"
			

			function updateComment(data) {
										  
				var content = "<div class=comment>";
				content += "<img class=owner src='/images/up/" + data.user.id + ".jpg' style='height:12px; width:12px;'> ";
				content += data.comment;
				content += " - <a href='/" + data.user.id + "'>" + data.user.name + "</a>";
				content += "</div>";
				$("#comment-waiting-" + data.oid).hide();		
				addComment(data.oid, content);
			}

			function addComment(oid, content) {
				$("#comment-container-" + oid).append(content);
			}
			
			function editEntry(oid) {
				$.get("/api/entry.u/" + oid, null,  function(data){displayEditEntry(oid, data);}, "html");
			}

			function cancelEditEntry(oid) {
				$("#e_title_" + oid).html($("#old_e_title_" + oid).html())
			}

			function saveEntry(oid, message) {
				$.post("/api/entry.u/" + oid, {message:message},  function(data){displayUpdatedEntry(oid, data);}, "html");
			}
			
			function displayEditEntry(oid, data) {
				var old_contents = $("#e_title_" + oid).html() 
				$("#e_title_" + oid).html(data + "<div id='old_e_title_" + oid + "' style='display:none;'>" + old_contents + "</div>");
			}
			
			function displayUpdatedEntry(oid, data) {
				$("#entry_container_" + oid).html(data);
			}
			
			
			
			

			