Index: SPARQLBuilderWWW/web/newsparqlbuilder.js
===================================================================
--- SPARQLBuilderWWW/web/newsparqlbuilder.js (revision 244)
+++ SPARQLBuilderWWW/web/newsparqlbuilder.js (revision 245)
@@ -60,5 +60,5 @@
 	$(".SBStartClassSelect").change(function() {
 		startClass = $(".SBStartClassSelect").val();
-		loadPathList();
+		loadEndClassList();
 	});
 	$(".SBEndClassSelect").change(function() {
@@ -104,9 +104,7 @@
 	if(defendpoint != "" && defstartclass != "" && defendclass != ""){
 
-		$('.SBStartClassSelect').on('lccomplete', function(){
+		$('.SBStartClassSelect').on('lsccomplete', function(){
 			$('.SBStartClassSelect').val(defstartclass);
 			defstartclass = "";
-			$('.SBEndClassSelect').val(defendclass);
-			defendclass = "";
 
 			$(".SBEndPointSelect").select2();
@@ -114,5 +112,17 @@
 			$(".SBEndClassSelect").select2();
 
-			$('.SBStartClassSelect').unbind('lccomplete');
+			$('.SBStartClassSelect').unbind('lsccomplete');
+			loadEndClassList();
+		});
+
+		$('.SBEndClassSelect').on('leccomplete', function(){
+			$('.SBEndClassSelect').val(defendclass);
+			defendclass = "";
+
+			$(".SBEndPointSelect").select2();
+			$(".SBStartClassSelect").select2();
+			$(".SBEndClassSelect").select2();
+
+			$('.SBEndClassSelect').unbind('leccomplete');
 		});
 
@@ -125,5 +135,5 @@
 				$('.SBEndPointSelect').val(defendpoint);
 				defendpoint = "";
-				loadClassList();
+				loadStartClassList();
 				$('.SBEndPointSelect').unbind('epcomplete');
 			});
@@ -131,5 +141,5 @@
 			$('.SBEndPointSelect').val(defendpoint);
 			defendpoint = "";
-			loadClassList();
+			loadStartClassList();
 		}
 	}
@@ -212,9 +222,9 @@
 	endpoint = $(".SBEndPointSelect").val();
 	if(endpoint != "SBDefault"){
-		loadClassList();
+		loadStartClassList();
 	}
 };
 
-loadClassList = function() {
+loadStartClassList = function() {
 	$('.SBPermaLinkButton').attr('disabled', true);
 	var url = "http://www.sparqlbuilder.org/api/clist?ep=" + encodeURIComponent(endpoint);
@@ -227,13 +237,32 @@
 			$(".SBStartClassSelect").empty();
 			$(".SBEndClassSelect").empty();
-			$(".SBStartClassSelect").append('<option value="SBDefault">SELECT StartClass</option>');
-			$(".SBEndClassSelect").append('<option value="SBDefault">SELECT EndClass</option>');
+			$(".SBStartClassSelect").append('<option value="SBDefault">SELECT StartClass (From ' + list.length + ' below)</option>');
 			for (var i = 0; i < list.length; ++i) {
 				$(".SBStartClassSelect").append('<option value="' + list[i]['uri'] + '">' + list[i]['label'] + ' (' + list[i]['number'] + ')' + '</option>');
-				$(".SBEndClassSelect").append('<option value="' + list[i]['uri'] + '">' + list[i]['label'] + ' (' + list[i]['number'] + ')' + '</option>');
 			}
 			$(".SBStartClassSelect").select2();
 			$(".SBEndClassSelect").select2();
-			$(".SBStartClassSelect").trigger(new $.Event('lccomplete'));
+			$(".SBStartClassSelect").trigger(new $.Event('lsccomplete'));
+		}
+	});
+};
+
+loadEndClassList = function() {
+	$('.SBPermaLinkButton').attr('disabled', true);
+	var url = "http://www.sparqlbuilder.org/api/clist?ep=" + encodeURIComponent(endpoint) + '&class=' + encodeURIComponent($(".SBStartClassSelect").val());
+	$.ajax({
+		type : "GET",
+		url : url,
+		async : false,
+		success : function(data) {
+			var list = eval(data);
+			$(".SBEndClassSelect").empty();
+			$(".SBEndClassSelect").append('<option value="SBDefault">SELECT EndClass (From ' + list.length + ' below)</option>');
+			for (var i = 0; i < list.length; ++i) {
+				$(".SBEndClassSelect").append('<option value="' + list[i]['uri'] + '">' + list[i]['label'] + ' (' + list[i]['number'] + ')' + '</option>');
+			}
+			$(".SBStartClassSelect").select2();
+			$(".SBEndClassSelect").select2();
+			$(".SBEndClassSelect").trigger(new $.Event('leccomplete'));
 		}
 	});
@@ -533,5 +562,5 @@
 			.attr("y", function(d) { return d.y + 4; })
 			.text(function(d) { return d.score; })
-			.style("fill", '#ff0000')
+			.style("fill", 'hsl(0, 50%, 75%)')
 			.style("text-anchor", 'middle')
 			.style("pointer-events", "none");
