 			Source: <strong>#d.source#</strong>
 		</p>
 		<p>
-			comments: <strong>#d.comments#</strong>
+			<form id="f_ds_filter" method="post" action="taxonomyTree.cfm">
+				<input type="hidden" name="dataset_id" value="#d.dataset_id#">
+				<input type="hidden" name="dataset_name" value="#d.dataset_name#">
+				<input type="hidden" name="action" value="saveCommentUpdate">
+				<textarea name="comments" rows="50" cols="10">#d.comments#</textarea>
+				<br><input type="submit" value="save comment changes" class="savBtn">
+			</form>
 		</p>
 
 		<hr>



</cfif>
<!------------------------------------------------------------------------------------------------->

<cfif action is "noSuccessimport">
	<cfoutput>
		<cfquery name="d" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">

			$("#statusDiv").html('ready');
		}

		jQuery(document).ready(function() {
			myTree = new dhtmlXTreeObject('treeBox', '100%', '100%', 0);
			myTree.setImagesPath("/includes/dhtmlxTree_v50_std/codebase/imgs/dhxtree_material/");
			myTree.enableDragAndDrop(true);
			myTree.enableCheckBoxes(true);
			myTree.enableTreeLines(true);
			myTree.enableTreeImages(false);
			myTree.enableItemEditor(false);
			initTree();
			myTree.attachEvent("onCheck", function(id){
			    var guts = "/form/hierarchicalTaxonomyEdit.cfm?tid=" + id;
				$("<iframe src='" + guts + "' id='dialog' class='popupDialog' style='width:800px;height:600px;'></iframe>").dialog({
					autoOpen: true,
					closeOnEscape: true,
					height: 'auto',
					modal: true,
					position: ['center', 'center'],
					title: 'Edit Term',
						width:800,
			 			height:600,
					close: function() {
						$( this ).remove();
					}
				}).width(800-10).height(600-10);
				$(window).resize(function() {
					$(".ui-dialog-content").dialog("option", "position", ['center', 'center']);
				});
				$(".ui-widget-overlay").click(function(){
				    $(".ui-dialog-titlebar-close").trigger('click');
				});
			    // uncheck everything
			    var ids=myTree.getAllSubItems(0).split(",");
	    		for (var i=0; i<ids.length; i++){
	       			myTree.setCheck(ids[i],0);
	    		}
			});

			myTree.attachEvent("onDblClick", function(id){
				expandNode(id);
			});

			myTree.attachEvent("onRightClick", function(id){
				myTree.closeItem(id);
			});

			myTree.attachEvent("onDrop", function(sId, tId, id, sObject, tObject){
				$("#statusDiv").html('working....');
			    $.getJSON("/component/test.cfc",
					{
						method : "saveParentUpdate",
						dataset_id: $("#dataset_id").val(),
						tid : sId,
						parent_tid : tId,
						returnformat : "json",
						queryformat : 'column'
					},
					function (r) {
						console.log(r);
						if (r=='success') {
							$("#statusDiv").html('successful save');
						}else{
							alert(r);
							$("#statusDiv").html(r);
						}
					}
				);
			});

			$( "#srch" ).change(function() {
				performSearch();
			});

			$( "#srchBtn" ).click(function() {
				performSearch();
			});
		});
		// end ready function

	</script>
	<p>
		<strong>Doubleclick</strong> terms to expand.
		<br><strong>Check</strong> the box to edit.
		<br><strong>Drag</strong> to re-order.
		<br><strong>Rightclick</strong> to close a node.
		<br>All edits propagate to all children.
		<br>Searches which return >1K records will fail; expand/browse instead.
	</p>
