	
	function doSave_organize() {
		$("#right").html("");
		$("ul.koppel").each(function(k) {
			ser = $(this).sortable("serialize");
			att = $(this).attr("rel");
			$.post("/ajax/save.tags-organize.php?parent="+att, { tags: ser }, function(data) {
				$("#right").html($("#right").html()+data);
			});
		});

	}
	
	function doSave_feed_organize() {
		$("#right").html("");
		$("ul.koppel").each(function(k) {
			ser = $(this).sortable("serialize");
			att = $(this).attr("rel");
			$.post("/ajax/save.feeds-organize.php?parent="+att, { feeds: ser }, function(data) {
				$("#right").html($("#right").html()+data);
			});
		});

	}
	
	function doSave_show() {
		ser = $("#showtags").sortable("serialize");

		$.post("/ajax/save.tags-show.php?show=true", { tags: ser }, function(data) {
			ser = $("#noshowtags").sortable("serialize");
			$.post("/ajax/save.tags-show.php?show=false", { tags: ser }, function(data) {
				$("#right").html(data);
			});
		});
		
	}		
	
	function doSave_parent() {
		ser = $("#parenttags").sortable("serialize");

		$.post("/ajax/save.tags-parent.php?parent=true", { tags: ser }, function(data) {
			ser = $("#childrentags").sortable("serialize");
			$.post("/ajax/save.tags-parent.php?parent=false", { tags: ser }, function(data) {
				$("#right").html(data);
			});
		});
		
	}		

	function doSave_selectedProducts() {
		$.post("/ajax/save.product-select.clean.php", { truncate: 'true' }, function(data) {
			$("#selected span").each(function (e) {
				reller = $(this).attr('rel');
				$.post("/ajax/save.product-select.add.php", { pid: reller }, function(data) {
					$("#right").html(data);
				});
			});
			
			refreshSelected(0);
		});
		
		
	}		

	function refreshSelected() {
		$.get("/ajax/save.product-select.php?ajax=true",  function(data) {
			$("#selected").html(data);
		});
	}
	
	
	function delete_selected(reller) {
		$.post("/ajax/save.product-select.delete.php?ajax=true", { del: reller }, function(data) {
			refreshSelected(0);
		});
	}
	
	
		function doFindProduct(j) {
			srch = $("#f"+j).val();
			
			$("#r"+j).slideUp(function() {
				if (srch.length > 0) {
					$.post("/ajax/admin.search.php?ajax=true", { zoek: srch, list: j }, function(data) {
						$("#r"+j).html(data).slideDown(function() {
						stopAnimate("animate");
						});
					});
				} else {
					$("#f"+j).addClass("error");
					stopAnimate("animate");
					statusOff();
				}
			});

		}
