Index: /SPARQLBuilderWWW/web/sparqlbuilder.js
===================================================================
--- /SPARQLBuilderWWW/web/sparqlbuilder.js (revision 225)
+++ /SPARQLBuilderWWW/web/sparqlbuilder.js (revision 232)
@@ -232,5 +232,8 @@
         // SVG縺ｮ蟷�→鬮倥＆繧定ｨｭ螳夲ｼ亥ｹ�ｼ夂判髱｢縺�▲縺ｱ縺�鬮倥＆�壹ヱ繧ｹ縺ｮ謨ｰ縺ｫ蠢懊§險ｭ螳夲ｼ�
         var width = this.width;
-        var height = ((this.NODEHEIGHT * 1.5) * this.PATHNUM) + (this.NODEHEIGHT / 2);
+        var height = (width * 9 / 16);
+        var graphheight = ((this.NODEHEIGHT * 1.5) * this.PATHNUM) + (this.NODEHEIGHT / 2);
+
+        var scoreleftmargin = this.NODEHEIGHT * 1.5;
 
         // 繧ｫ繝ｩ繝ｼ繧貞叙蠕�
@@ -242,5 +245,22 @@
         var svg = d3.select("#sparqlBuilderGraph").append("svg")
             .attr("width", width)
-            .attr("height", height);
+            .attr("height", height)
+            .attr("viewBox", "0 0 " + width + " " + height)
+            .on("mousewheel", function(){
+            	var vb = svg.attr("viewBox");
+            	var spvb = vb.split(" ");
+
+            	var vby = (parseInt(spvb[1]) - event.wheelDelta);
+
+            	if(vby < 0){
+            		vby = 0;
+            	}else if(vby > (graphheight - height)){
+            		vby = (graphheight - height);
+            	}else{
+            		event.preventDefault();
+            	}
+
+            	svg.attr("viewBox", "0 " + vby + " " + width + " " + height);
+            });
 
         // 閭梧勹縺ｮ霑ｽ蜉
@@ -250,5 +270,5 @@
             .attr("y", 0)
             .attr("width", width)
-            .attr("height", height)
+            .attr("height", graphheight)
             .attr("fill", "#fafafa");
 
@@ -296,4 +316,17 @@
             .style("fill", function(d) { return '#000000'; })
             .style("text-anchor", function(d) { return 'middle'; });
+
+        // nodes驟榊�繧呈ｸ｡縺励ヮ繝ｼ繝峨ユ繧ｭ繧ｹ繝医�菴懈�
+        var tscore = svg.selectAll("text.score")
+            .data(json.nodes)
+            .enter().append("svg:text")
+            .attr("class", "tscore")
+            .attr("x", function(d) { return (d.x + scoreleftmargin); })
+            .attr("y", function(d) { return d.y; })
+            .text(function(d) { return d.score;
+            })
+            .style("fill", function(d) { return '#FF0000'; })
+            .style("text-anchor", function(d) { return 'middle'; })
+            .style("pointer-events", "none");
 
         // 繝槭え繧ｹ縺ｮ蜍輔″繧ｫ繧ｦ繝ｳ繝医ｒ繝ｫ繝ｼ繝医↓謖√◆縺帙ｋ
@@ -353,5 +386,7 @@
                     // 繝��繝ｫ繝√ャ繝励�蜀�ｮｹ繧呈嶌縺肴鋤縺�
                     document.getElementById("sparqlBuilderSelectpath").innerHTML=(resultText);
-                    document.getElementById("sparqlBuilderShowpath").style.display = "block";
+                    if(svg.attr("width") == width){
+                    	document.getElementById("sparqlBuilderShowpath").style.display = "block";
+                    }
 
                     // 繧ｵ繝ｼ繝悶Ξ繝�ヨ縺ｫ騾√ｊ霑斐☆繝代せ繧ｪ繝悶ず繧ｧ繧ｯ繝医ｒ菫晏ｭ�
@@ -518,77 +553,4 @@
                 });
 
-            // 縺薙％縺九ｉ蟄舌ヮ繝ｼ繝峨�逡ｳ縺ｿ霎ｼ縺ｿ蜃ｦ逅�ｼ育樟蝨ｨ縺ｯ蟒�ｭ｢縲∝ｿｵ縺ｮ縺溘ａ繧ｳ繝ｼ繝峨�谿九＠縺ｦ縺翫￥��
-            /*
-            var childs = [];
-            var prevchilds = [];
-            prevchilds.push(d.nodeid);
-
-            //
-            do{
-                var tmpchilds = [];
-                var curchilds = [];
-                for(var p = 0; p < prevchilds.length; p++){
-                    tmpchilds = this.get_children(prevchilds[p], json['links']);
-                    curchilds = curchilds.concat(tmpchilds);
-                }
-                prevchilds = curchilds;
-                childs = childs.concat(curchilds);
-
-            }while(curchilds.length != 0);
-
-            var childy = d.y;
-            for(var c = 0; c < childs.length; c++){
-                if(node.data()[childs[c]].y < childy){
-                    childy = node.data()[childs[c]].y;
-                }
-            }
-
-            d.y = childy;
-
-            var maxdy = 0;
-            var mindy = 0;
-
-            for(var c = 0; c < childs.length; c++){
-                if(node.data()[childs[c]].view != "hide"){
-                    var dy = node.data()[childs[c]].y - d.y;
-                    if(dy > maxdy){
-                        maxdy = dy;
-                    }
-                    node.data()[childs[c]].x = d.x;
-                    node.data()[childs[c]].y = d.y;
-                    node.data()[childs[c]].dy = dy;
-                    node.data()[childs[c]].view = "hide";
-                    node.data()[childs[c]].hideparent = d.nodeid;
-                }else{
-                    if(node.data()[childs[c]].hideparent == d.nodeid){
-                        node.data()[childs[c]].x = d.x + (this.TREESPACE * (node.data()[childs[c]].group - d.group));
-                        node.data()[childs[c]].y = node.data()[childs[c]].y + node.data()[childs[c]].dy;
-                        if(-node.data()[childs[c]].dy < mindy){
-                            mindy = -node.data()[childs[c]].dy;
-                        }
-                        node.data()[childs[c]].view = "appear";
-                        node.data()[childs[c]].hideparent = -1;
-                    }
-                }
-            }
-
-            node
-            .attr("r", function(d){
-                if(d.view == "appear"){
-                    d.view = "no";
-                }else if(d.y > childy){
-                    d.y = d.y - maxdy - mindy;
-                }
-                if(d.view == "hide"){
-                    d.x = node.data()[d.hideparent].x;
-                    d.y = node.data()[d.hideparent].y;
-                }
-                if(d.nodeid == 0){
-                    d.y = childy;
-                }
-                return (this.NODEHEIGHT / 2);
-            });
-            */
-
             // 蜷�Μ繝ｳ繧ｯ縺ｫ蟇ｾ縺�
             tlink
@@ -631,11 +593,4 @@
                 .attr("y2", function(d) {return node.data()[d.target].y;});
 
-            // 蜷�Μ繝ｳ繧ｯ繝�く繧ｹ繝医↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ
-            tlink
-                .transition()
-                .duration(duration)
-                .attr("x", function(d) {return (node.data()[d.source].x + node.data()[d.target].x) / 2;})
-                .attr("y", function(d) {return ((node.data()[d.source].y + node.data()[d.target].y) / 2) + 5;});
-
             // 蜷�ヮ繝ｼ繝峨↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ�医°縺､謚倥ｊ縺溘◆縺ｾ繧御ｸｭ縺ｮ蝣ｴ蜷医�謠冗判蛻�ｲ仙�逅�ｼ�
             node
@@ -643,29 +598,5 @@
                 .duration(duration)
                 .attr("cx", function(d) {return d.x;})
-                .attr("cy", function(d) {return d.y;})
-                .style("opacity", function(d){
-                    var opa = 1.0;
-                    if(d.view == "hide"){
-                        opa = 0.0;
-                    }
-                    return opa;
-                })
-                .style("fill", function(d) {
-                    var fcolor = d.nodecolor;
-
-                    for(var n = 0; n < node.data().length; n++){
-                        if(d.nodeid == node.data()[n].hideparent){
-                            fcolor = "ffaaaa";
-                        }
-                    }
-                    return fcolor;
-                })
-                .style("pointer-events", function(d){
-                    var pe = "auto";
-                    if(d.view == "hide"){
-                        pe = "none";
-                    }
-                    return pe;
-                });
+                .attr("cy", function(d) {return d.y;});
 
             // 蜷�ヮ繝ｼ繝峨ユ繧ｭ繧ｹ繝医↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ縲√ユ繧ｭ繧ｹ繝域緒逕ｻ菴咲ｽｮ繧剃ｸ贋ｸ九↓謖ｯ繧具ｼ医°縺､謚倥ｊ縺溘◆縺ｾ繧御ｸｭ縺ｮ蝣ｴ蜷医�謠冗判蛻�ｲ仙�逅�ｼ�
@@ -683,13 +614,12 @@
                 // 縺昴�蛟､繧帝ｫ倥＆縺ｫ霑斐☆縺薙→縺ｧ繝�く繧ｹ繝域緒逕ｻ菴咲ｽｮ縺御ｺ偵＞驕輔＞縺ｫ縺ｪ繧�
                 return d.y + updown;
-            })
-            // 謚倥ｊ逡ｳ縺ｿ迥ｶ諷九↑繧峨ユ繧ｭ繧ｹ繝郁｡ｨ遉ｺ繧呈ｶ医☆
-            .text(function(d){
-                var nodetext = d.name
-                if(d.view == "hide"){
-                    nodetext = "";
-                }
-                return nodetext;
             });
+
+            // 蜷�Μ繝ｳ繧ｯ繝�く繧ｹ繝医↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ
+            tlink
+                .transition()
+                .duration(duration)
+                .attr("x", function(d) {return (node.data()[d.source].x + node.data()[d.target].x) / 2;})
+                .attr("y", function(d) {return ((node.data()[d.source].y + node.data()[d.target].y) / 2) + 5;});
 
         };
@@ -723,4 +653,14 @@
                     return "#999";
                 });
+
+            if(svg.attr("width") == width){
+	            svg.attr("width", (width / 5))
+	            .attr("height", (width * 9 / 16 / 5))
+	            .attr("viewBox", "0 0 " + width + " " + (width * 9 / 16));
+            }else{
+	            svg.attr("width", width)
+	            .attr("height", height)
+	            .attr("viewBox", "0 0 " + width + " " + height);
+            }
 
         });
@@ -799,4 +739,6 @@
         // 蜈ｱ騾壹Ν繝ｼ繝亥愛螳壹ｒtrue縺ｫ
         var isCommon = true;
+
+        var score = obj[i]['score'];
 
         // classLinks縺ｮ謨ｰ縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
@@ -866,4 +808,5 @@
         }
         ret['nodes'][ret['nodes'].length - 1]['path'] = obj[i];
+        ret['nodes'][ret['nodes'].length - 1]['score'] = score;
         ret['nodes'][ret['nodes'].length - 1]['nodecolor'] = '#8cddc0';
         this.PATHNUM++;
Index: /SPARQLBuilderWWW/web/select2.css
===================================================================
--- /SPARQLBuilderWWW/web/select2.css (revision 232)
+++ /SPARQLBuilderWWW/web/select2.css (revision 232)
@@ -0,0 +1,410 @@
+.select2-container {
+  box-sizing: border-box;
+  display: inline-block;
+  margin: 0;
+  position: relative;
+  vertical-align: middle; }
+  .select2-container .select2-selection--single {
+    box-sizing: border-box;
+    cursor: pointer;
+    display: block;
+    height: 28px;
+    user-select: none;
+    -webkit-user-select: none; }
+    .select2-container .select2-selection--single .select2-selection__rendered {
+      display: block;
+      overflow: hidden;
+      padding-left: 8px;
+      padding-right: 20px;
+      text-overflow: ellipsis; }
+  .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
+    padding-right: 8px;
+    padding-left: 20px; }
+  .select2-container .select2-selection--multiple {
+    box-sizing: border-box;
+    cursor: pointer;
+    display: block;
+    min-height: 32px;
+    user-select: none;
+    -webkit-user-select: none; }
+    .select2-container .select2-selection--multiple .select2-selection__rendered {
+      display: inline-block;
+      overflow: hidden;
+      padding-left: 8px;
+      text-overflow: ellipsis; }
+  .select2-container .select2-search--inline {
+    float: left; }
+    .select2-container .select2-search--inline .select2-search__field {
+      border: none;
+      font-size: 100%;
+      margin-top: 5px; }
+
+.select2-dropdown {
+  background-color: white;
+  border: 1px solid #aaa;
+  border-radius: 4px;
+  box-sizing: border-box;
+  display: block;
+  position: absolute;
+  left: -100000px;
+  width: 100%;
+  z-index: 1051; }
+
+.select2-results {
+  display: block; }
+
+.select2-results__options {
+  list-style: none;
+  margin: 0;
+  padding: 0; }
+
+.select2-results__option {
+  padding: 6px;
+  user-select: none;
+  -webkit-user-select: none; }
+  .select2-results__option[aria-selected] {
+    cursor: pointer; }
+
+.select2-container--open .select2-dropdown {
+  left: 0; }
+
+.select2-container--open .select2-dropdown--above {
+  border-bottom: none;
+  border-bottom-left-radius: 0;
+  border-bottom-right-radius: 0; }
+
+.select2-container--open .select2-dropdown--below {
+  border-top: none;
+  border-top-left-radius: 0;
+  border-top-right-radius: 0; }
+
+.select2-search--dropdown {
+  display: block;
+  padding: 4px; }
+  .select2-search--dropdown .select2-search__field {
+    padding: 4px;
+    width: 100%;
+    box-sizing: border-box; }
+  .select2-search--dropdown.select2-search--hide {
+    display: none; }
+
+.select2-close-mask {
+  border: 0;
+  margin: 0;
+  padding: 0;
+  display: block;
+  position: fixed;
+  left: 0;
+  top: 0;
+  min-height: 100%;
+  min-width: 100%;
+  height: auto;
+  width: auto;
+  opacity: 0;
+  z-index: 99;
+  background-color: #fff;
+  filter: alpha(opacity=0); }
+
+.select2-container--default .select2-selection--single {
+  background-color: #fff;
+  border: 1px solid #aaa;
+  border-radius: 4px; }
+  .select2-container--default .select2-selection--single .select2-selection__rendered {
+    color: #444;
+    line-height: 28px; }
+  .select2-container--default .select2-selection--single .select2-selection__clear {
+    cursor: pointer;
+    float: right;
+    font-weight: bold; }
+  .select2-container--default .select2-selection--single .select2-selection__placeholder {
+    color: #999; }
+  .select2-container--default .select2-selection--single .select2-selection__arrow {
+    height: 26px;
+    position: absolute;
+    top: 1px;
+    right: 1px;
+    width: 20px; }
+    .select2-container--default .select2-selection--single .select2-selection__arrow b {
+      border-color: #888 transparent transparent transparent;
+      border-style: solid;
+      border-width: 5px 4px 0 4px;
+      height: 0;
+      left: 50%;
+      margin-left: -4px;
+      margin-top: -2px;
+      position: absolute;
+      top: 50%;
+      width: 0; }
+.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
+  float: left; }
+.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
+  left: 1px;
+  right: auto; }
+.select2-container--default.select2-container--disabled .select2-selection--single {
+  background-color: #eee;
+  cursor: default; }
+  .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
+    display: none; }
+.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
+  border-color: transparent transparent #888 transparent;
+  border-width: 0 4px 5px 4px; }
+.select2-container--default .select2-selection--multiple {
+  background-color: white;
+  border: 1px solid #aaa;
+  border-radius: 4px;
+  cursor: text; }
+  .select2-container--default .select2-selection--multiple .select2-selection__rendered {
+    list-style: none;
+    margin: 0;
+    padding: 0 5px;
+    width: 100%; }
+  .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
+    color: #999;
+    margin-top: 5px;
+    float: left; }
+  .select2-container--default .select2-selection--multiple .select2-selection__clear {
+    cursor: pointer;
+    float: right;
+    font-weight: bold;
+    margin-top: 5px;
+    margin-right: 10px; }
+  .select2-container--default .select2-selection--multiple .select2-selection__choice {
+    background-color: #e4e4e4;
+    border: 1px solid #aaa;
+    border-radius: 4px;
+    cursor: default;
+    float: left;
+    margin-right: 5px;
+    margin-top: 5px;
+    padding: 0 5px; }
+  .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
+    color: #999;
+    cursor: pointer;
+    display: inline-block;
+    font-weight: bold;
+    margin-right: 2px; }
+    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
+      color: #333; }
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder {
+  float: right; }
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
+  margin-left: 5px;
+  margin-right: auto; }
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
+  margin-left: 2px;
+  margin-right: auto; }
+.select2-container--default.select2-container--disabled .select2-selection--multiple {
+  background-color: #eee;
+  cursor: default; }
+.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
+  display: none; }
+.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
+  border-top-left-radius: 0;
+  border-top-right-radius: 0; }
+.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
+  border-bottom-left-radius: 0;
+  border-bottom-right-radius: 0; }
+.select2-container--default .select2-search--dropdown .select2-search__field {
+  border: 1px solid #aaa; }
+.select2-container--default .select2-search--inline .select2-search__field {
+  background: transparent;
+  border: none;
+  outline: 0; }
+.select2-container--default .select2-results > .select2-results__options {
+  max-height: 200px;
+  overflow-y: auto; }
+.select2-container--default .select2-results__option[role=group] {
+  padding: 0; }
+.select2-container--default .select2-results__option[aria-disabled=true] {
+  color: #999; }
+.select2-container--default .select2-results__option[aria-selected=true] {
+  background-color: #ddd; }
+.select2-container--default .select2-results__option .select2-results__option {
+  padding-left: 1em; }
+  .select2-container--default .select2-results__option .select2-results__option .select2-results__group {
+    padding-left: 0; }
+  .select2-container--default .select2-results__option .select2-results__option .select2-results__option {
+    margin-left: -1em;
+    padding-left: 2em; }
+    .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
+      margin-left: -2em;
+      padding-left: 3em; }
+      .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
+        margin-left: -3em;
+        padding-left: 4em; }
+        .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
+          margin-left: -4em;
+          padding-left: 5em; }
+          .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
+            margin-left: -5em;
+            padding-left: 6em; }
+.select2-container--default .select2-results__option--highlighted[aria-selected] {
+  background-color: #5897fb;
+  color: white; }
+.select2-container--default .select2-results__group {
+  cursor: default;
+  display: block;
+  padding: 6px; }
+
+.select2-container--classic .select2-selection--single {
+  background-color: #f6f6f6;
+  border: 1px solid #aaa;
+  border-radius: 4px;
+  outline: 0;
+  background-image: -webkit-linear-gradient(top, #ffffff 50%, #eeeeee 100%);
+  background-image: -o-linear-gradient(top, #ffffff 50%, #eeeeee 100%);
+  background-image: linear-gradient(to bottom, #ffffff 50%, #eeeeee 100%);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0); }
+  .select2-container--classic .select2-selection--single:focus {
+    border: 1px solid #5897fb; }
+  .select2-container--classic .select2-selection--single .select2-selection__rendered {
+    color: #444;
+    line-height: 28px; }
+  .select2-container--classic .select2-selection--single .select2-selection__clear {
+    cursor: pointer;
+    float: right;
+    font-weight: bold;
+    margin-right: 10px; }
+  .select2-container--classic .select2-selection--single .select2-selection__placeholder {
+    color: #999; }
+  .select2-container--classic .select2-selection--single .select2-selection__arrow {
+    background-color: #ddd;
+    border: none;
+    border-left: 1px solid #aaa;
+    border-top-right-radius: 4px;
+    border-bottom-right-radius: 4px;
+    height: 26px;
+    position: absolute;
+    top: 1px;
+    right: 1px;
+    width: 20px;
+    background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
+    background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
+    background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
+    background-repeat: repeat-x;
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0); }
+    .select2-container--classic .select2-selection--single .select2-selection__arrow b {
+      border-color: #888 transparent transparent transparent;
+      border-style: solid;
+      border-width: 5px 4px 0 4px;
+      height: 0;
+      left: 50%;
+      margin-left: -4px;
+      margin-top: -2px;
+      position: absolute;
+      top: 50%;
+      width: 0; }
+.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
+  float: left; }
+.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
+  border: none;
+  border-right: 1px solid #aaa;
+  border-radius: 0;
+  border-top-left-radius: 4px;
+  border-bottom-left-radius: 4px;
+  left: 1px;
+  right: auto; }
+.select2-container--classic.select2-container--open .select2-selection--single {
+  border: 1px solid #5897fb; }
+  .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
+    background: transparent;
+    border: none; }
+    .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
+      border-color: transparent transparent #888 transparent;
+      border-width: 0 4px 5px 4px; }
+.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
+  border-top: none;
+  border-top-left-radius: 0;
+  border-top-right-radius: 0;
+  background-image: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee 50%);
+  background-image: -o-linear-gradient(top, #ffffff 0%, #eeeeee 50%);
+  background-image: linear-gradient(to bottom, #ffffff 0%, #eeeeee 50%);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0); }
+.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
+  border-bottom: none;
+  border-bottom-left-radius: 0;
+  border-bottom-right-radius: 0;
+  background-image: -webkit-linear-gradient(top, #eeeeee 50%, #ffffff 100%);
+  background-image: -o-linear-gradient(top, #eeeeee 50%, #ffffff 100%);
+  background-image: linear-gradient(to bottom, #eeeeee 50%, #ffffff 100%);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0); }
+.select2-container--classic .select2-selection--multiple {
+  background-color: white;
+  border: 1px solid #aaa;
+  border-radius: 4px;
+  cursor: text;
+  outline: 0; }
+  .select2-container--classic .select2-selection--multiple:focus {
+    border: 1px solid #5897fb; }
+  .select2-container--classic .select2-selection--multiple .select2-selection__rendered {
+    list-style: none;
+    margin: 0;
+    padding: 0 5px; }
+  .select2-container--classic .select2-selection--multiple .select2-selection__clear {
+    display: none; }
+  .select2-container--classic .select2-selection--multiple .select2-selection__choice {
+    background-color: #e4e4e4;
+    border: 1px solid #aaa;
+    border-radius: 4px;
+    cursor: default;
+    float: left;
+    margin-right: 5px;
+    margin-top: 5px;
+    padding: 0 5px; }
+  .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
+    color: #888;
+    cursor: pointer;
+    display: inline-block;
+    font-weight: bold;
+    margin-right: 2px; }
+    .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
+      color: #555; }
+.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
+  float: right; }
+.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
+  margin-left: 5px;
+  margin-right: auto; }
+.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
+  margin-left: 2px;
+  margin-right: auto; }
+.select2-container--classic.select2-container--open .select2-selection--multiple {
+  border: 1px solid #5897fb; }
+.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
+  border-top: none;
+  border-top-left-radius: 0;
+  border-top-right-radius: 0; }
+.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
+  border-bottom: none;
+  border-bottom-left-radius: 0;
+  border-bottom-right-radius: 0; }
+.select2-container--classic .select2-search--dropdown .select2-search__field {
+  border: 1px solid #aaa;
+  outline: 0; }
+.select2-container--classic .select2-search--inline .select2-search__field {
+  outline: 0; }
+.select2-container--classic .select2-dropdown {
+  background-color: white;
+  border: 1px solid transparent; }
+.select2-container--classic .select2-dropdown--above {
+  border-bottom: none; }
+.select2-container--classic .select2-dropdown--below {
+  border-top: none; }
+.select2-container--classic .select2-results > .select2-results__options {
+  max-height: 200px;
+  overflow-y: auto; }
+.select2-container--classic .select2-results__option[role=group] {
+  padding: 0; }
+.select2-container--classic .select2-results__option[aria-disabled=true] {
+  color: grey; }
+.select2-container--classic .select2-results__option--highlighted[aria-selected] {
+  background-color: #3875d7;
+  color: white; }
+.select2-container--classic .select2-results__group {
+  cursor: default;
+  display: block;
+  padding: 6px; }
+.select2-container--classic.select2-container--open .select2-dropdown {
+  border-color: #5897fb; }
Index: /SPARQLBuilderWWW/web/select2.min.js
===================================================================
--- /SPARQLBuilderWWW/web/select2.min.js (revision 232)
+++ /SPARQLBuilderWWW/web/select2.min.js (revision 232)
@@ -0,0 +1,2 @@
+!function(){if(window.define)var a=window.define;if(window.require)var b=window.require;if(window.jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var a=jQuery.fn.select2.amd.define,b=jQuery.fn.select2.amd.require;var c,b,a;!function(d){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,b){return function(){return n.apply(d,v.call(arguments,0).concat([a,b]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var b=r[a];delete r[a],t[a]=!0,m.apply(d,b)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,b,c,f){var h,k,l,m,n,s,u=[],v=typeof c;if(f=f||a,"undefined"===v||"function"===v){for(b=!b.length&&c.length?["require","exports","module"]:b,n=0;n<b.length;n+=1)if(m=o(b[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=c?c.apply(q[a],u):void 0,a&&(h&&h.exports!==d&&h.exports!==q[a]?q[a]=h.exports:l===d&&s||(q[a]=l))}else a&&(q[a]=c)},c=b=n=function(a,b,c,e,f){if("string"==typeof a)return p[a]?p[a](b):j(o(a,b).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!b)return;b.splice?(a=b,b=c,c=null):a=d}return b=b||function(){},"function"==typeof c&&(c=e,e=f),e?m(d,a,b,c):setTimeout(function(){m(d,a,b,c)},4),n},n.config=function(a){return n(a)},c._defined=q,a=function(a,b,c){b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},a.amd={jQuery:!0}}(),a("almond",function(){}),a("jquery",[],function(){var a=jQuery||$;return null==a&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),a}),a("select2/utils",[],function(){function a(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var b={};b.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},b.Decorate=function(b,c){function d(){var a=Array.prototype.unshift,d=c.prototype.constructor.length,e=b.prototype.constructor;d>0&&(a.call(arguments,b.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=a(c),g=a(b);c.displayName=b.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=b.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var c=function(){this.listeners={}};return c.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},c.prototype.trigger=function(a){var b=Array.prototype.slice;this.listeners=this.listeners||{},a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},c.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},b.Observable=c,b.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},b.bind=function(a,b){return function(){a.apply(b,arguments)}},b._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},b.hasScroll=function(a,b){var c=$(b),d=b.style.overflowX,e=b.style.overflowY;return d!==e||"hidden"!==e&&"visible"!==e?"scroll"===d||"scroll"===e?!0:c.innerHeight()<b.scrollHeight||c.innerWidth()<b.scrollWidth:!1},b}),a("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){this.clear(),this.hideLoading();var c=a('<li role="treeitem" class="select2-results__option"></li>'),d=this.options.get("translations").get(b.message);c.text(d(b.args)),this.$results.append(c)},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data");null!=c.id&&d.indexOf(c.id.toString())>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")});var f=e.filter("[aria-selected=true]");f.length>0?f.first().trigger("mouseenter"):e.first().trigger("mouseenter")})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";{a(h)}this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b){var c=this,d=b.id+"-results";this.$results.attr("id",d),b.on("results:all",function(a){c.clear(),c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("results:append",function(a){c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("query",function(a){c.showLoading(a)}),b.on("select",function(){b.isOpen()&&c.setClasses()}),b.on("unselect",function(){b.isOpen()&&c.setClasses()}),b.on("open",function(){c.$results.attr("aria-expanded","true"),c.$results.attr("aria-hidden","false"),c.setClasses(),c.ensureHighlightVisible()}),b.on("close",function(){c.$results.attr("aria-expanded","false"),c.$results.attr("aria-hidden","true"),c.$results.removeAttr("aria-activedescendant")}),b.on("results:select",function(){var a=c.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?c.options.get("multiple")?c.trigger("unselect",{data:b}):c.trigger("close"):c.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a);if(0!==d){var e=d-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top,h=f.offset().top,i=c.$results.scrollTop()+(h-g);0===e?c.$results.scrollTop(0):0>h-g&&c.$results.scrollTop(i)}}),b.on("results:next",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a),e=d+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top+c.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=c.$results.scrollTop()+h-g;0===e?c.$results.scrollTop(0):h>g&&c.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){c.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=c.$results.scrollTop(),d=c.$results.get(0).scrollHeight-c.$results.scrollTop()+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&d<=c.$results.height();e?(c.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(c.$results.scrollTop(c.$results.get(0).scrollHeight-c.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var d=a(this),e=d.data("data");return"true"===d.attr("aria-selected")?void(c.options.get("multiple")?c.trigger("unselect",{originalEvent:b,data:e}):c.trigger("close")):void c.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(){var b=a(this).data("data");c.getHighlightedResults().removeClass("select2-results__option--highlighted"),c.trigger("results:focus",{data:b,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(a,b){var c=this.options.get("templateResult"),d=c(a);null==d?b.style.display="none":b.innerHTML=d},c}),a("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case KEY.LEFT:case KEY.RIGHT:case KEY.UP:case KEY.DOWN:return!0}return!1}};return a}),a("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" tabindex="0" role="combobox" aria-autocomplete="list" aria-haspopup="true" aria-expanded="false"></span>');return b.attr("title",this.$element.attr("title")),this.$selection=b,b},d.prototype.bind=function(a){var b=this,d=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.attr("aria-owns",d),this.$selection.on("keydown",function(a){b.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){b.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){b.update(a.data)}),a.on("open",function(){b.$selection.attr("aria-expanded","true"),b._attachCloseHandler(a)}),a.on("close",function(){b.$selection.attr("aria-expanded","false"),b.$selection.removeAttr("aria-activedescendant"),b.$selection.focus(),b._detachCloseHandler(a)}),a.on("enable",function(){b.$selection.attr("tabindex","0")}),a.on("disable",function(){b.$selection.attr("tabindex","-1")})},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(){throw new Error("The `update` method must be defined in child classes.")},d}),a("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},d.prototype.bind=function(a){var b=this;d.__super__.bind.apply(this,arguments);var c=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",c),this.$selection.attr("aria-labelledby",c),this.$selection.on("mousedown",function(a){1===a.which&&b.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(){}),this.$selection.on("blur",function(){}),a.on("selection:update",function(a){b.update(a.data)})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection");return b(a)},d.prototype.selectionContainer=function(){return a("<span></span>")},d.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.display(b);this.$selection.find(".select2-selection__rendered").html(c)},d}),a("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(){var b=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){b.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(c){var d=a(this),e=d.parent(),f=e.data("data");b.trigger("unselect",{originalEvent:c,data:f})})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection");return b(a)},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=this.display(d),f=this.selectionContainer();f.append(e),f.data("data",d),b.push(f)}this.$selection.find(".select2-selection__rendered").append(b)}},d}),a("select2/selection/placeholder",["../utils"],function(){function a(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},a.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},a}),a("select2/selection/allowClear",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$selection.on("mousedown",".select2-selection__clear",function(b){if(!e.options.get("disabled")){b.stopPropagation();for(var c=a(this).data("data"),d=0;d<c.length;d++){var f={data:c[d]};if(e.trigger("unselect",f),f.prevented)return}e.$element.val(e.placeholder.id).trigger("change"),e.trigger("toggle")}})},b.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").append(d)}},b}),a("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" role="textbox" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus()}),b.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),b.on("enable",function(){e.$search.prop("disabled",!1)}),b.on("disable",function(){e.$search.prop("disabled",!0)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f)}}}),this.$selection.on("keyup",".select2-search--inline",function(a){e.handleSearch(a)})},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.trigger("open"),this.$search.val(b.text+" ")},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),a("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==f.indexOf(b)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==g.indexOf(b)&&(c.prevented=d.isDefaultPrevented())}})},b}),a("select2/translation",["jquery"],function(a){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),a("select2/diacritics",[],function(){var a={"竰ｶ":"A","�｡":"A","ﾃ":"A","ﾃ�:"A","ﾃ�:"A","蘯ｦ":"A","蘯､":"A","蘯ｪ":"A","蘯ｨ":"A","ﾃ�:"A","ﾄ":"A","ﾄ�:"A","蘯ｰ":"A","蘯ｮ":"A","蘯ｴ":"A","蘯ｲ":"A","ﾈｦ":"A","ﾇ":"A","ﾃ�:"A","ﾇ�:"A","蘯｢":"A","ﾃ�:"A","ﾇｺ":"A","ﾇ�:"A","ﾈ":"A","ﾈ�:"A","蘯":"A","蘯ｬ":"A","蘯ｶ":"A","盧":"A","ﾄ�:"A","ﾈｺ":"A","箜ｯ":"A","龕ｲ":"AA","ﾃ�:"AE","ﾇｼ":"AE","ﾇ｢":"AE","龕ｴ":"AO","龕ｶ":"AU","龕ｸ":"AV","龕ｺ":"AV","龕ｼ":"AY","竰ｷ":"B","�｢":"B","盧�:"B","盧�:"B","盧�:"B","ﾉ�:"B","ﾆ�:"B","ﾆ�:"B","竰ｸ":"C","�｣":"C","ﾄ�:"C","ﾄ�:"C","ﾄ�:"C","ﾄ�:"C","ﾃ�:"C","盧�:"C","ﾆ�:"C","ﾈｻ":"C","龕ｾ":"C","竰ｹ":"D","�､":"D","盧�:"D","ﾄ�:"D","盧�:"D","盧�:"D","盧�:"D","盧�:"D","ﾄ�:"D","ﾆ�:"D","ﾆ�:"D","ﾆ�:"D","龜ｹ":"D","ﾇｱ":"DZ","ﾇ�:"DZ","ﾇｲ":"Dz","ﾇ�:"Dz","竰ｺ":"E","�･":"E","ﾃ�:"E","ﾃ�:"E","ﾃ�:"E","盻":"E","蘯ｾ":"E","盻�:"E","盻�:"E","蘯ｼ":"E","ﾄ�:"E","盧�:"E","盧�:"E","ﾄ�:"E","ﾄ�:"E","ﾃ�:"E","蘯ｺ":"E","ﾄ�:"E","ﾈ�:"E","ﾈ�:"E","蘯ｸ":"E","盻�:"E","ﾈｨ":"E","盧�:"E","ﾄ�:"E","盧�:"E","盧�:"E","ﾆ�:"E","ﾆ�:"E","竰ｻ":"F","�ｦ":"F","盧�:"F","ﾆ�:"F","龜ｻ":"F","竰ｼ":"G","�ｧ":"G","ﾇｴ":"G","ﾄ�:"G","盧":"G","ﾄ�:"G","ﾄ":"G","ﾇｦ":"G","ﾄ｢":"G","ﾇ､":"G","ﾆ�:"G","龠":"G","龜ｽ":"G","龜ｾ":"G","竰ｽ":"H","�ｨ":"H","ﾄ､":"H","盧｢":"H","盧ｦ":"H","ﾈ�:"H","盧､":"H","盧ｨ":"H","盧ｪ":"H","ﾄｦ":"H","箜ｧ":"H","箜ｵ":"H","龠�:"H","竰ｾ":"I","�ｩ":"I","ﾃ�:"I","ﾃ�:"I","ﾃ�:"I","ﾄｨ":"I","ﾄｪ":"I","ﾄｬ":"I","ﾄｰ":"I","ﾃ�:"I","盧ｮ":"I","盻�:"I","ﾇ�:"I","ﾈ�:"I","ﾈ�:"I","盻�:"I","ﾄｮ":"I","盧ｬ":"I","ﾆ�:"I","竰ｿ":"J","�ｪ":"J","ﾄｴ":"J","ﾉ�:"J","笂":"K","�ｫ":"K","盧ｰ":"K","ﾇｨ":"K","盧ｲ":"K","ﾄｶ":"K","盧ｴ":"K","ﾆ�:"K","箜ｩ":"K","龜":"K","龜�:"K","龜�:"K","龠｢":"K","笂�:"L","�ｬ":"L","ﾄｿ":"L","ﾄｹ":"L","ﾄｽ":"L","盧ｶ":"L","盧ｸ":"L","ﾄｻ":"L","盧ｼ":"L","盧ｺ":"L","ﾅ�:"L","ﾈｽ":"L","箜｢":"L","箜":"L","龜�:"L","龜�:"L","龠":"L","ﾇ�:"LJ","ﾇ�:"Lj","笂�:"M","�ｭ":"M","盧ｾ":"M","盪":"M","盪�:"M","箜ｮ":"M","ﾆ�:"M","笂�:"N","�ｮ":"N","ﾇｸ":"N","ﾅ�:"N","ﾃ�:"N","盪�:"N","ﾅ�:"N","盪�:"N","ﾅ�:"N","盪�:"N","盪�:"N","ﾈ":"N","ﾆ�:"N","龠�:"N","龠､":"N","ﾇ�:"NJ","ﾇ�:"Nj","笂�:"O","�ｯ":"O","ﾃ�:"O","ﾃ�:"O","ﾃ�:"O","盻�:"O","盻�:"O","盻�:"O","盻�:"O","ﾃ�:"O","盪�:"O","ﾈｬ":"O","盪�:"O","ﾅ�:"O","盪�:"O","盪�:"O","ﾅ�:"O","ﾈｮ":"O","ﾈｰ":"O","ﾃ�:"O","ﾈｪ":"O","盻�:"O","ﾅ�:"O","ﾇ�:"O","ﾈ�:"O","ﾈ�:"O","ﾆ":"O","盻�:"O","盻�:"O","盻":"O","盻�:"O","盻｢":"O","盻�:"O","盻�:"O","ﾇｪ":"O","ﾇｬ":"O","ﾃ�:"O","ﾇｾ":"O","ﾆ�:"O","ﾆ�:"O","龜�:"O","龜�:"O","ﾆ｢":"OI","龜�:"OO","ﾈ｢":"OU","笂�:"P","�ｰ":"P","盪�:"P","盪�:"P","ﾆ､":"P","箜｣":"P","龜�:"P","龜�:"P","龜�:"P","笂�:"Q","�ｱ":"Q","龜�:"Q","龜�:"Q","ﾉ�:"Q","笂�:"R","�ｲ":"R","ﾅ�:"R","盪�:"R","ﾅ�:"R","ﾈ�:"R","ﾈ�:"R","盪�:"R","盪�:"R","ﾅ�:"R","盪�:"R","ﾉ�:"R","箜､":"R","龜�:"R","龠ｦ":"R","龠�:"R","笂�:"S","�ｳ":"S","蘯�:"S","ﾅ�:"S","盪､":"S","ﾅ�:"S","盪":"S","ﾅ":"S","盪ｦ":"S","盪｢":"S","盪ｨ":"S","ﾈ�:"S","ﾅ�:"S","箜ｾ":"S","龠ｨ":"S","龠�:"S","笂�:"T","�ｴ":"T","盪ｪ":"T","ﾅ､":"T","盪ｬ":"T","ﾈ�:"T","ﾅ｢":"T","盪ｰ":"T","盪ｮ":"T","ﾅｦ":"T","ﾆｬ":"T","ﾆｮ":"T","ﾈｾ":"T","龠�:"T","龕ｨ":"TZ","笂�:"U","�ｵ":"U","ﾃ�:"U","ﾃ�:"U","ﾃ�:"U","ﾅｨ":"U","盪ｸ":"U","ﾅｪ":"U","盪ｺ":"U","ﾅｬ":"U","ﾃ�:"U","ﾇ�:"U","ﾇ�:"U","ﾇ�:"U","ﾇ�:"U","盻ｦ":"U","ﾅｮ":"U","ﾅｰ":"U","ﾇ�:"U","ﾈ�:"U","ﾈ�:"U","ﾆｯ":"U","盻ｪ":"U","盻ｨ":"U","盻ｮ":"U","盻ｬ":"U","盻ｰ":"U","盻､":"U","盪ｲ":"U","ﾅｲ":"U","盪ｶ":"U","盪ｴ":"U","ﾉ�:"U","笂�:"V","�ｶ":"V","盪ｼ":"V","盪ｾ":"V","ﾆｲ":"V","龜�:"V","ﾉ�:"V","龜":"VY","笂�:"W","�ｷ":"W","蘯":"W","蘯�:"W","ﾅｴ":"W","蘯�:"W","蘯�:"W","蘯�:"W","箜ｲ":"W","笂�:"X","�ｸ":"X","蘯�:"X","蘯�:"X","笂�:"Y","�ｹ":"Y","盻ｲ":"Y","ﾃ�:"Y","ﾅｶ":"Y","盻ｸ":"Y","ﾈｲ":"Y","蘯�:"Y","ﾅｸ":"Y","盻ｶ":"Y","盻ｴ":"Y","ﾆｳ":"Y","ﾉ�:"Y","盻ｾ":"Y","笂�:"Z","�ｺ":"Z","ﾅｹ":"Z","蘯�:"Z","ﾅｻ":"Z","ﾅｽ":"Z","蘯�:"Z","蘯�:"Z","ﾆｵ":"Z","ﾈ､":"Z","箜ｿ":"Z","箜ｫ":"Z","龜｢":"Z","笂�:"a","��:"a","蘯�:"a","ﾃ":"a","ﾃ｡":"a","ﾃ｢":"a","蘯ｧ":"a","蘯･":"a","蘯ｫ":"a","蘯ｩ":"a","ﾃ｣":"a","ﾄ�:"a","ﾄ�:"a","蘯ｱ":"a","蘯ｯ":"a","蘯ｵ":"a","蘯ｳ":"a","ﾈｧ":"a","ﾇ｡":"a","ﾃ､":"a","ﾇ�:"a","蘯｣":"a","ﾃ･":"a","ﾇｻ":"a","ﾇ�:"a","ﾈ�:"a","ﾈ�:"a","蘯｡":"a","蘯ｭ":"a","蘯ｷ":"a","盧�:"a","ﾄ�:"a","箜･":"a","ﾉ�:"a","龕ｳ":"aa","ﾃｦ":"ae","ﾇｽ":"ae","ﾇ｣":"ae","龕ｵ":"ao","龕ｷ":"au","龕ｹ":"av","龕ｻ":"av","龕ｽ":"ay","笂�:"b","��:"b","盧�:"b","盧�:"b","盧�:"b","ﾆ":"b","ﾆ�:"b","ﾉ�:"b","笂�:"c","��:"c","ﾄ�:"c","ﾄ�:"c","ﾄ�:"c","ﾄ�:"c","ﾃｧ":"c","盧�:"c","ﾆ�:"c","ﾈｼ":"c","龕ｿ":"c","竊�:"c","笂�:"d","��:"d","盧�:"d","ﾄ�:"d","盧�:"d","盧�:"d","盧�:"d","盧�:"d","ﾄ�:"d","ﾆ�:"d","ﾉ�:"d","ﾉ�:"d","龜ｺ":"d","ﾇｳ":"dz","ﾇ�:"dz","笂�:"e","��:"e","ﾃｨ":"e","ﾃｩ":"e","ﾃｪ":"e","盻�:"e","蘯ｿ":"e","盻�:"e","盻�:"e","蘯ｽ":"e","ﾄ�:"e","盧�:"e","盧�:"e","ﾄ�:"e","ﾄ�:"e","ﾃｫ":"e","蘯ｻ":"e","ﾄ�:"e","ﾈ�:"e","ﾈ�:"e","蘯ｹ":"e","盻�:"e","ﾈｩ":"e","盧�:"e","ﾄ�:"e","盧�:"e","盧�:"e","ﾉ�:"e","ﾉ�:"e","ﾇ�:"e","笂�:"f","��:"f","盧�:"f","ﾆ�:"f","龜ｼ":"f","笂�:"g","��:"g","ﾇｵ":"g","ﾄ�:"g","盧｡":"g","ﾄ�:"g","ﾄ｡":"g","ﾇｧ":"g","ﾄ｣":"g","ﾇ･":"g","ﾉ":"g","龠｡":"g","盞ｹ":"g","龜ｿ":"g","笂�:"h","��:"h","ﾄ･":"h","盧｣":"h","盧ｧ":"h","ﾈ�:"h","盧･":"h","盧ｩ":"h","盧ｫ":"h","蘯�:"h","ﾄｧ":"h","箜ｨ":"h","箜ｶ":"h","ﾉ･":"h","ﾆ�:"hv","笂�:"i","��:"i","ﾃｬ":"i","ﾃｭ":"i","ﾃｮ":"i","ﾄｩ":"i","ﾄｫ":"i","ﾄｭ":"i","ﾃｯ":"i","盧ｯ":"i","盻�:"i","ﾇ�:"i","ﾈ�:"i","ﾈ�:"i","盻�:"i","ﾄｯ":"i","盧ｭ":"i","ﾉｨ":"i","ﾄｱ":"i","笂�:"j","��:"j","ﾄｵ":"j","ﾇｰ":"j","ﾉ�:"j","笂�:"k","��:"k","盧ｱ":"k","ﾇｩ":"k","盧ｳ":"k","ﾄｷ":"k","盧ｵ":"k","ﾆ�:"k","箜ｪ":"k","龜�:"k","龜�:"k","龜�:"k","龠｣":"k","笂�:"l","��:"l","ﾅ":"l","ﾄｺ":"l","ﾄｾ":"l","盧ｷ":"l","盧ｹ":"l","ﾄｼ":"l","盧ｽ":"l","盧ｻ":"l","ﾅｿ":"l","ﾅ�:"l","ﾆ�:"l","ﾉｫ":"l","箜｡":"l","龜�:"l","龠�:"l","龜�:"l","ﾇ�:"lj","笂�:"m","��:"m","盧ｿ":"m","盪�:"m","盪�:"m","ﾉｱ":"m","ﾉｯ":"m","笂�:"n","��:"n","ﾇｹ":"n","ﾅ�:"n","ﾃｱ":"n","盪�:"n","ﾅ�:"n","盪�:"n","ﾅ�:"n","盪�:"n","盪�:"n","ﾆ�:"n","ﾉｲ":"n","ﾅ�:"n","龠�:"n","龠･":"n","ﾇ�:"nj","笂�:"o","��:"o","ﾃｲ":"o","ﾃｳ":"o","ﾃｴ":"o","盻�:"o","盻�:"o","盻�:"o","盻�:"o","ﾃｵ":"o","盪�:"o","ﾈｭ":"o","盪�:"o","ﾅ�:"o","盪�:"o","盪�:"o","ﾅ�:"o","ﾈｯ":"o","ﾈｱ":"o","ﾃｶ":"o","ﾈｫ":"o","盻�:"o","ﾅ�:"o","ﾇ�:"o","ﾈ�:"o","ﾈ�:"o","ﾆ｡":"o","盻�:"o","盻�:"o","盻｡":"o","盻�:"o","盻｣":"o","盻�:"o","盻�:"o","ﾇｫ":"o","ﾇｭ":"o","ﾃｸ":"o","ﾇｿ":"o","ﾉ�:"o","龜�:"o","龜�:"o","ﾉｵ":"o","ﾆ｣":"oi","ﾈ｣":"ou","龜�:"oo","笂�:"p","��:"p","盪�:"p","盪�:"p","ﾆ･":"p","盞ｽ":"p","龜�:"p","龜�:"p","龜�:"p","笂":"q","��:"q","ﾉ�:"q","龜�:"q","龜�:"q","笂｡":"r","��:"r","ﾅ�:"r","盪�:"r","ﾅ�:"r","ﾈ�:"r","ﾈ�:"r","盪�:"r","盪�:"r","ﾅ�:"r","盪�:"r","ﾉ�:"r","ﾉｽ":"r","龜�:"r","龠ｧ":"r","龠�:"r","笂｢":"s","��:"s","ﾃ�:"s","ﾅ�:"s","盪･":"s","ﾅ�:"s","盪｡":"s","ﾅ｡":"s","盪ｧ":"s","盪｣":"s","盪ｩ":"s","ﾈ�:"s","ﾅ�:"s","ﾈｿ":"s","龠ｩ":"s","龠�:"s","蘯�:"s","笂｣":"t","��:"t","盪ｫ":"t","蘯�:"t","ﾅ･":"t","盪ｭ":"t","ﾈ�:"t","ﾅ｣":"t","盪ｱ":"t","盪ｯ":"t","ﾅｧ":"t","ﾆｭ":"t","ﾊ�:"t","箜ｦ":"t","龠�:"t","龕ｩ":"tz","笂､":"u","��:"u","ﾃｹ":"u","ﾃｺ":"u","ﾃｻ":"u","ﾅｩ":"u","盪ｹ":"u","ﾅｫ":"u","盪ｻ":"u","ﾅｭ":"u","ﾃｼ":"u","ﾇ�:"u","ﾇ�:"u","ﾇ�:"u","ﾇ�:"u","盻ｧ":"u","ﾅｯ":"u","ﾅｱ":"u","ﾇ�:"u","ﾈ�:"u","ﾈ�:"u","ﾆｰ":"u","盻ｫ":"u","盻ｩ":"u","盻ｯ":"u","盻ｭ":"u","盻ｱ":"u","盻･":"u","盪ｳ":"u","ﾅｳ":"u","盪ｷ":"u","盪ｵ":"u","ﾊ�:"u","笂･":"v","��:"v","盪ｽ":"v","盪ｿ":"v","ﾊ�:"v","龜�:"v","ﾊ�:"v","龜｡":"vy","笂ｦ":"w","��:"w","蘯�:"w","蘯�:"w","ﾅｵ":"w","蘯�:"w","蘯�:"w","蘯�:"w","蘯�:"w","箜ｳ":"w","笂ｧ":"x","��:"x","蘯�:"x","蘯�:"x","笂ｨ":"y","��:"y","盻ｳ":"y","ﾃｽ":"y","ﾅｷ":"y","盻ｹ":"y","ﾈｳ":"y","蘯�:"y","ﾃｿ":"y","盻ｷ":"y","蘯�:"y","盻ｵ":"y","ﾆｴ":"y","ﾉ�:"y","盻ｿ":"y","笂ｩ":"z","��:"z","ﾅｺ":"z","蘯�:"z","ﾅｼ":"z","ﾅｾ":"z","蘯�:"z","蘯�:"z","ﾆｶ":"z","ﾈ･":"z","ﾉ":"z","箜ｬ":"z","龜｣":"z","ﾎ�:"ﾎ�,"ﾎ�:"ﾎ�,"ﾎ�:"ﾎ�,"ﾎ�:"ﾎ�,"ﾎｪ":"ﾎ�,"ﾎ�:"ﾎ�,"ﾎ�:"ﾎ･","ﾎｫ":"ﾎ･","ﾎ�:"ﾎｩ","ﾎｬ":"ﾎｱ","ﾎｭ":"ﾎｵ","ﾎｮ":"ﾎｷ","ﾎｯ":"ﾎｹ","ﾏ�:"ﾎｹ","ﾎ�:"ﾎｹ","ﾏ�:"ﾎｿ","ﾏ�:"ﾏ�,"ﾏ�:"ﾏ�,"ﾎｰ":"ﾏ�,"ﾏ�:"ﾏ�,"ﾏ�:"ﾏ�};return a}),a("select2/data/base",["../utils"],function(a){function b(){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),a("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(c){var d=[];a=[a],a.push.apply(a,c);for(var e=0;e<a.length;e++)id=a[e].id,-1===d.indexOf(id)&&d.push(id);b.$element.val(d),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(c){for(var d=[],e=0;e<c.length;e++)id=c[e].id,id!==a.id&&-1===d.indexOf(id)&&d.push(id);b.$element.val(d),b.$element.trigger("change")})},d.prototype.bind=function(a){var b=this;this.container=a,a.on("select",function(a){b.select(a.data)}),a.on("unselect",function(a){b.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.html(),disabled:a.prop("disabled"),selected:a.prop("selected")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[]};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),a("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),a.append(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find('option[value="'+a.id+'"]');0===b.length&&(b=this.option(a),this.$element.append(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function b(a){return function(){return c(this).val()==a.id}}for(var d=this,e=this.$element.find("option"),f=e.map(function(){return d.item(c(this)).id}).get(),g=[],h=0;h<a.length;h++){var i=this._normalizeItem(a[h]);if(f.indexOf(i.id)>=0){var j=e.filter(b(i)),k=this.item(j),l=(c.extend(!0,{},k,i),this.option(k));j.replaceWith(l)}else{var m=this.option(i);if(i.children){var n=this.convertToOptions(i.children);m.append(n)}g.push(m)}}return g},d}),a("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(b,c){this.ajaxOptions=c.get("ajax"),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),a.__super__.constructor.call(this,b,c)}return b.Extend(d,a),d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=c.ajax(f);d.success(function(d){var f=e.processResults(d,a);console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)}),e._request=d}var e=this;
+this._request&&(this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url(a)),"function"==typeof f.data&&(f.data=f.data(a)),this.ajaxOptions.delay&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),a("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");if(void 0!==f&&(this.createTag=f),b.call(this,c,d),a.isArray(e))for(var g=0;g<e.length;g++){var h=e[g],i=this._normalizeItem(h),j=this.option(i);this.$element.append(j)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.$element.append(m),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||""===b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(a,b){return{id:b.term,text:b.term}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(){var b=(this._lastTag,this.$element.find("option[data-select2-tag]"));b.each(function(){this.selected||a(this).remove()})},b}),a("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(a,b,c){function d(a){e.select(a)}var e=this;b.term=b.term||"";var f=this.tokenizer(b,this.options,d);f.term!==b.term&&(this.$search.length&&(this.$search.val(f.term),this.$search.focus()),b.term=f.term),a.call(this,b,c)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==f.indexOf(j)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);e(m),g=g.substr(h+1)||"",h=0}else h++}return{term:g}},b}),a("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),a("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{minimum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),a("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),a("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.position=function(){},c.prototype.destroy=function(){this.$dropdown.remove()},c.prototype.bind=function(a){var b=this;a.on("select",function(a){b._onSelect(a)}),a.on("unselect",function(a){b._onUnSelect(a)})},c.prototype._onSelect=function(){this.trigger("close")},c.prototype._onUnSelect=function(){this.trigger("close")},c}),a("select2/dropdown/search",["jquery","../utils"],function(a){function b(){}return b.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},b.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),this.$search.on("keydown",function(a){d.trigger("keypress",a),d._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("keyup",function(a){d.handleSearch(a)}),b.on("open",function(){d.$search.attr("tabindex",0),d.$search.focus(),window.setTimeout(function(){d.$search.focus()},0)}),b.on("close",function(){d.$search.attr("tabindex",-1),d.$search.val("")}),b.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=d.showSearch(a);b?d.$searchContainer.removeClass("select2-search--hide"):d.$searchContainer.addClass("select2-search--hide")}})},b.prototype.handleSearch=function(){if(!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},b.prototype.showSearch=function(){return!0},b}),a("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),a("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="option load-more" role="treeitem"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),a("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(a,b,c){this.$dropdownParent=c.get("dropdownParent")||document.body,a.call(this,b,c)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c){var d=this,e="scroll.select2."+c.id,f="resize.select2."+c.id,g="orientationchange.select2."+c.id;$watchers=this.$container.parents().filter(b.hasScroll),$watchers.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),$watchers.on(e,function(){var b=a(this).data("select2-scroll-position");a(this).scrollTop(b.y)}),a(window).on(e+" "+f+" "+g,function(){d._positionDropdown(),d._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c){var d="scroll.select2."+c.id,e="resize.select2."+c.id,f="orientationchange.select2."+c.id;$watchers=this.$container.parents().filter(b.hasScroll),$watchers.off(d),a(window).off(d+" "+e+" "+f)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=(this.$container.position(),this.$container.offset());f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom};c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){this.$dropdownContainer.width(),this.$dropdown.css({width:this.$container.outerWidth(!1)+"px"})},c.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),a("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){count=0;for(var c=0;c<b.length;c++){var d=b[c];d.children?count+=a(d.children):count++}return count}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),a("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(){d._handleSelectOnClose()})},a.prototype._handleSelectOnClose=function(){var a=this.getHighlightedResults();a.length<1||a.trigger("mouseup")},a}),a("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results窶ｦ"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching窶ｦ"}}}),a("select2/defaults",["jquery","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./i18n/en"],function(a,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B){function C(){this.reset()}C.prototype.apply=function(l){if(l=a.extend({},this.defaults,l),null==l.dataAdapter){if(l.dataAdapter=null!=l.ajax?o:null!=l.data?n:m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),null!=l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var B=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,B)}if(null!=l.initSelection){var C=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,C)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var D=j.Decorate(u,v);l.dropdownAdapter=D}l.minimumResultsForSearch>0&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter&&(l.selectionAdapter=l.multiple?e:d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g))),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),l.selectionAdapter=j.Decorate(l.selectionAdapter,i)),"string"==typeof l.language)if(l.language.indexOf("-")>0){var E=l.language.split("-"),F=E[0];l.language=[l.language,F]}else l.language=[l.language];if(a.isArray(l.language)){var G=new k;l.language.push("en");for(var H=l.language,I=0;I<H.length;I++){var J=H[I],K={};try{K=k.loadPath(J)}catch(L){try{J=this.defaults.amdLanguageBase+J,K=k.loadPath(J)}catch(M){console&&console.warn&&console.warn('Select2: The lanugage file for "'+J+'" could not be automatically loaded. A fallback will be used instead.');continue}}G.extend(K)}l.translations=G}else l.translations=new k(l.language);return l},C.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"select2/",amdLanguageBase:"select2/i18n/",language:B,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},C.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var D=new C;return D}),a("select2/options",["jquery","./defaults","./utils"],function(a,b,c){function d(a,c){this.options=a,null!=c&&this.fromElement(c),this.options=b.apply(this.options)}return d.prototype.fromElement=function(b){var d=["select2"];null==this.options.multiple&&(this.options.multiple=b.prop("multiple")),null==this.options.disabled&&(this.options.disabled=b.prop("disabled")),null==this.options.language&&(b.prop("lang")?this.options.language=b.prop("lang").toLowerCase():b.closest("[lang]").prop("lang")&&(this.options.language=b.closest("[lang]").prop("lang"))),null==this.options.dir&&(this.options.dir=b.prop("dir")?b.prop("dir"):b.closest("[dir]").prop("dir")?b.closest("[dir]").prop("dir"):"ltr"),b.prop("disabled",this.options.disabled),b.prop("multiple",this.options.multiple),b.data("select2-tags")&&(console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),b.data("data",b.data("select2-tags")),b.data("tags",!0)),b.data("ajax-url")&&(console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),b.data("ajax--url",b.data("ajax-url")));var e=b.data();e=c._convertData(e);for(var f in e)d.indexOf(f)>-1||(a.isPlainObject(this.options[f])?a.extend(this.options[f],e[f]):this.options[f]=e[f]);return this},d.prototype.get=function(a){return this.options[a]},d.prototype.set=function(a,b){this.options[a]=b},d}),a("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=this.options.get("dataAdapter");this.data=new d(a,this.options);var f=this.render();this._placeContainer(f);var g=this.options.get("selectionAdapter");this.selection=new g(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,f);var h=this.options.get("dropdownAdapter");this.dropdown=new h(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,f);var i=this.options.get("resultsAdapter");this.results=new i(a,this.options,this.data),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var j=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.data.current(function(a){j.trigger("selection:update",{data:a})}),a.hide(),this._syncAttributes(),this._tabindex=a.attr("tabindex")||0,a.attr("tabindex","-1"),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;var g=f.split(";");for(i=0,l=g.length;l>i;i+=1){attr=g[i].replace(/\s/g,"");var h=attr.match(c);if(null!==h&&h.length>=1)return h[1]}return null}return b},e.prototype._bindAdapters=function(){this.data.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.data.current(function(a){b.trigger("selection:update",{data:a})})}),this._sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d&&(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1}))},e.prototype._registerDataEvents=function(){var a=this;this.data.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var a=this,b=["toggle"];this.selection.on("toggle",function(){a.toggleDropdown()}),this.selection.on("*",function(c,d){-1===b.indexOf(c)&&a.trigger(c,d)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("query",function(b){this.data.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.data.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ENTER?(a.trigger("results:select"),b.preventDefault()):c===d.UP?(a.trigger("results:previous"),b.preventDefault()):c===d.DOWN?(a.trigger("results:next"),b.preventDefault()):(c===d.ESC||c===d.TAB)&&(a.close(),b.preventDefault()):(c===d.ENTER||c===d.SPACE||(c===d.DOWN||c===d.UP)&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable")):this.trigger("enable")},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||(this.trigger("query",{}),this.trigger("open"))},e.prototype.close=function(){this.isOpen()&&this.trigger("close")},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.enable=function(a){console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),0===a.length&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.val=function(b){if(console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer&&(this._observer.disconnect(),this._observer=null),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this._tabindex),this.$element.show(),this.$element.removeData("select2"),this.data.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.data=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),a("jquery.select2",["jquery","./select2/core","./select2/defaults"],function(a,c,d){try{b("jquery.mousewheel")}catch(e){}return null==a.fn.select2&&(a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){{var d=a.extend({},b,!0);new c(a(this),d)}}),this;if("string"==typeof b){var d=this.data("select2"),e=Array.prototype.slice.call(arguments,1);return d[b](e)}throw new Error("Invalid arguments for Select2: "+b)}),null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),b("jquery.select2"),jQuery.fn.select2.amd={define:a,require:b}}();
Index: /SPARQLBuilderWWW/web/newsparqlbuilder.js
===================================================================
--- /SPARQLBuilderWWW/web/newsparqlbuilder.js (revision 232)
+++ /SPARQLBuilderWWW/web/newsparqlbuilder.js (revision 232)
@@ -0,0 +1,960 @@
+
+var PATHNUM = 0;
+var MAXDEPTH = 0;
+var TREESPACE = 0;
+var NODEHEIGHT = 0;
+var DRAWHEIGHT = 0;
+var MOUSEMOVED = 0;
+
+var endpoint = "";
+var startclass= "";
+var endclass = "";
+
+var jsontext = "";
+var pathobj = "";
+
+var pathlimit = 10;
+
+
+// 繝壹�繧ｸ隱ｭ縺ｿ霎ｼ縺ｿ縺悟ｮ御ｺ�ｬ｡隨ｬ螳溯｡�
+$(function(){
+
+	// 繝壹�繧ｸ縺ｮ繝代�繝�Κ蛻�ｒ霑ｽ蜉
+	initparts();
+});
+
+function initparts(){
+	var sbdiv = $('div#SPARQLBUILDER');
+// <input type="button" class="SBTopButton" value="Try with Sample" onclick="trySample()">
+	var sbtop = '<div class="SBTopItems"><input type="button" class="SBTopButton" value="Open SPARQLBuilder" onclick="openSPARQLBuilder()"><br /><textarea class="SBSparqlArea" rows="10"></textarea><br /><input type="button" class="SBTopButton" value="Send SPARQL" onclick="sendSPARQL()"><input type="button" class="SBTopButton" value="Download Result" onclick="downloadResult()"></div>';
+// <input type="button" class="SBSaveESE" value="Save" onClick="openPermalink">
+	var sbmodal = '<div class="SBModalView"><div class="SBModalContents"><div class="SBSelects"><select class="SBEndPointSelect"></select><select class="SBStartClassSelect"></select><select class="SBEndClassSelect"></select></div><div class="SBMessage"><div class="SBResult"><span class="SBPathnum"></span> Path<span class="SBPlural"></span> found.</div><div class="SBViewAll"><input type="button" value="View All" onClick="viewAll()"></div></div><div class="SBGraph"><div class="SBAjaxLoad"><div class="SBLoadIcon"><img src="images/ajax-loader.gif"></div></div></div><div class="SBSelectedPath"></div><div class="SBModalButtons"><input type="button" class="SBModalButton" value="Close" onclick="closeSPARQLBuilder()"></div></div>';
+
+	sbdiv.html(sbtop);
+
+	$('body').append(sbmodal);
+
+	$('.SBModalView').click(function(){
+		$(this).fadeOut(700);
+	});
+
+	$('.SBModalContents').click(function(){
+		event.stopPropagation();
+	});
+
+	/*
+	$('#StartClassSelect').on('epcomplete', function(){
+		console.log("comp.");
+    });
+	*/
+
+	loadEndPointList();
+
+	$(".SBEndPointSelect").change(function() {
+		changeEndPoint();
+	});
+
+	$(".SBStartClassSelect").change(function() {
+		startClass = $(".SBStartClassSelect").val();
+		loadPathList();
+	});
+	$(".SBEndClassSelect").change(function() {
+		endClass = $(".SBEndClassSelect").val();
+		loadPathList();
+	});
+
+}
+
+function openSPARQLBuilder(){
+
+	$('.SBModalView').css('top', $(window).scrollTop()).css('height', window.innerHeight).fadeIn();
+
+	var mvw = $('.SBModalContents').width();
+	var mvh = $('.SBModalContents').height();
+
+	$('.SBModalContents .SBSelects').css('width', (mvw - 201) + 'px').css('height', 30 + 'px');
+	$('.SBModalContents .SBMessage').css('width', 200 + 'px').css('height', 30 + 'px');
+	$('.SBModalContents .SBGraph').css('width', (mvw - 201) + 'px').css('height', (mvh - 31) + 'px');
+	$('.SBModalContents .SBSelectedPath').css('width', 200 + 'px').css('height', (mvh - 31 - 26) + 'px');
+	$('.SBModalContents .SBModalButtons').css('width', 200 + 'px').css('height', '26px');
+
+	$(".SBEndPointSelect").select2();
+	$(".SBStartClassSelect").select2();
+	$(".SBEndClassSelect").select2();
+
+	d3.select('.SBModalView').on("mousewheel", function(){
+		event.preventDefault();
+	});
+}
+
+function openPermalink(){
+
+}
+
+function closeSPARQLBuilder(){
+	$('.SBModalView').fadeOut();
+}
+
+function switchLoadIcon(mode) {
+	if(mode == "view"){
+		$('.SBAjaxLoad').show();
+	}else{
+		$('.SBAjaxLoad').hide();
+	}
+};
+
+function loadEndPointList(){
+	$('.SBSaveESE').attr('disabled', true);
+	var url = 'http://www.sparqlbuilder.org/api/eplist';
+	$.ajax({
+		url: url,
+		success: function(data) {
+			var list = eval(data);
+			$(".SBEndPointSelect").empty();
+			$(".SBEndPointSelect").append('<option value="SBDefault">SELECT ENDPOINT</option>');
+			for (var i = 0; i < list.length; ++i) {
+				$(".SBEndPointSelect").append('<option value="' + list[i] + '">' + list[i] + '</option>');
+				switchLoadIcon("hide");
+				if($('.SBModalView').attr('display') == 'block'){
+					$(".SBEndPointSelect").select2();
+					$(".SBStartClassSelect").select2();
+					$(".SBEndClassSelect").select2();
+				}
+			}
+			//$("#SBStartClassSelect").trigger(new $.Event('epcomplete'));
+		},
+	});
+}
+
+changeEndPoint = function() {
+	endpoint = $(".SBEndPointSelect").val();
+	if(endpoint != "SBDefault"){
+		loadClassList();
+	}
+};
+
+loadClassList = function() {
+	$('.SBSaveESE').attr('disabled', true);
+	var url = "http://www.sparqlbuilder.org/api/clist?ep=" + encodeURIComponent(endpoint);
+	$.ajax({
+		type : "GET",
+		url : url,
+		async : false,
+		success : function(data) {
+			var list = eval(data);
+			$(".SBStartClassSelect").empty();
+			$(".SBEndClassSelect").empty();
+			$(".SBStartClassSelect").append('<option value="SBDefault">SELECT STARTCLASS</option>');
+			$(".SBEndClassSelect").append('<option value="SBDefault">SELECT ENDCLASS</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();
+			//$("#seclass").trigger(new $.Event('secomplete'));
+		}
+	});
+};
+
+loadPathList = function() {
+	var startclass = $(".SBStartClassSelect").val();
+	var endclass = $(".SBEndClassSelect").val();
+	$('.SBSaveESE').attr('disabled', true);
+	if (startclass == null || endclass == null || startclass == "SBDefault" || endclass == "SBDefault"){
+		return;
+	}
+
+	pathlimit = 10;
+
+	$('.SBResult').hide();
+	$('.SBViewAll').hide();
+	$('.SBSelectedPath').html('');
+
+	var url = "http://www.sparqlbuilder.org/api/plist?ep=" + encodeURIComponent(endpoint)
+															+ "&startclass=" + encodeURIComponent(startclass)
+															+ "&endclass="   + encodeURIComponent(endclass);
+	//var self = this;
+	switchLoadIcon("view");
+	setTimeout(function(){
+		$.ajax({
+			type : "GET",
+			url : url,
+			//async : false,
+			timeout : 1000000,
+			success : function(data) {
+				jsontext = data;
+				view_map();
+				switchLoadIcon("hide");
+				$('.SBSaveESE').attr('disabled', false);
+			},
+			error: function(data){
+				switchLoadIcon("hide");
+				alert("error: ", data);
+			}
+		});
+	}, 100);
+};
+
+function viewAll(){
+	pathlimit = 0;
+	view_map();
+}
+
+generateSPARQL = function() {
+    var path = JSON.stringify(pathobj);
+    var url = 'http://www.sparqlbuilder.org/api/sparql?path=' + encodeURIComponent(path);
+    $.ajax({
+        type: "GET",
+        url : url,
+        dataType: 'text',
+        async: false,
+        success : function(data) {
+            $(".SBSparqlArea").val(data);
+            closeSPARQLBuilder();
+        }
+    });
+};
+
+function sendSPARQL(){
+	var sendep = $(".SBEndPointSelect").val();
+
+	var query = $(".SBSparqlArea").val();
+
+	if(sendep == "SBDefault" || query == ""){
+		return;
+	}
+
+	query = encodeURIComponent(query);
+
+	openpage = sendep + "?format=text%2Fhtml&query=" + query;
+
+	window.open(openpage);
+}
+
+function downloadResult(){
+
+	var sendep = $(".SBEndPointSelect").val();
+
+	var query = $(".SBSparqlArea").val();
+
+	if(sendep == "SBDefault" || query == ""){
+		return;
+	}
+
+	qr = sendQuery(sendep,query);
+
+	qr.fail(
+		function (xhr, textStatus, thrownError) {
+			alert("Error: A '" + textStatus+ "' occurred.");
+		}
+	);
+	qr.done(
+		function (d) {
+			downloadCSV(d.results.bindings);
+		}
+	);
+}
+
+function downloadCSV(data){
+
+	if (data instanceof Array) {
+		var result_txt ="";
+
+		var i=0;
+		for ( var key in data[0]) {
+			if(i>0){result_txt +=",";}
+			result_txt += key;
+			i++;
+		}
+
+		result_txt += "\n";
+
+		for (var d = 0; d < data.length; d++) {
+			var i = 0;
+			for ( var key in data[d]) {
+				if(i>0){result_txt +=",";}
+				result_txt += data[d][key].value;
+				i++;
+			}
+			result_txt += '\n';
+		}
+
+		var blob = new Blob( [result_txt], {type: 'text/plain'} )
+
+		var link = document.createElement('a')
+		link.href = URL.createObjectURL(blob)
+		link.download = 'result' + '.csv'
+
+		document.body.appendChild(link) // for Firefox
+		link.click()
+		document.body.removeChild(link) // for Firefox
+	}
+};
+
+view_map = function(){
+
+    // make_data繝｡繧ｽ繝�ラ縺ｮ邨先棡繧貞叙蠕�
+    var json = make_data(0);
+
+    if(json['nodes'].length != 0){
+
+        // 蜃ｺ譚･荳翫′縺｣縺溽ｵ先棡繧呈ｸ｡縺励※繝槭ャ繝嶺ｸ翫�繝ｭ繧ｱ繝ｼ繧ｷ繝ｧ繝ｳ繧偵そ繝�ヨ
+        set_map_location(0, json['nodes'], json['links']);
+
+        // SVG縺ｮ蟷�→鬮倥＆繧定ｨｭ螳夲ｼ亥ｹ�ｼ夂判髱｢縺�▲縺ｱ縺�鬮倥＆�壹ヱ繧ｹ縺ｮ謨ｰ縺ｫ蠢懊§險ｭ螳夲ｼ�
+        var width = $('.SBGraph').width();
+        var height = $('.SBGraph').height();
+        var graphheight = ((NODEHEIGHT * 1.5) * PATHNUM) + (NODEHEIGHT / 2);
+
+        var scoreleftmargin = NODEHEIGHT * 1.5;
+
+        // SVG縺ｮ蜑企勁
+        d3.select(".SBGraph svg").remove();
+        // 逕ｻ髱｢繧ｵ繧､繧ｺ縺ｫ蜷医ｏ縺婀VG縺ｮ霑ｽ蜉
+        var svg = d3.select(".SBGraph").append("svg")
+            .attr("width", width)
+            .attr("height", height)
+            .attr("viewBox", "0 0 " + width + " " + height)
+            .on("mousewheel", function(){
+            	var vb = svg.attr("viewBox");
+            	var spvb = vb.split(" ");
+
+            	var vby = (parseInt(spvb[1]) - event.wheelDelta);
+
+            	if(vby < 0){
+            		vby = 0;
+            	}else if(vby > (graphheight - height)){
+            		vby = (graphheight - height);
+            	}else{
+            		event.preventDefault();
+            	}
+
+            	svg.attr("viewBox", "0 " + vby + " " + width + " " + height);
+            });
+
+        // 閭梧勹縺ｮ霑ｽ蜉
+        var bg = svg
+            .append("rect")
+            .attr("x", 0)
+            .attr("y", 0)
+            .attr("width", width)
+            .attr("height", graphheight)
+            .attr("fill", "#fafafa");
+
+        // links驟榊�繧呈ｸ｡縺励Μ繝ｳ繧ｯ縺ｮ菴懈�
+        var link = svg.selectAll(".link")
+            .data(json.links)
+            .enter().append("line")
+            .attr("class", "link")
+            .style("stroke", "#999")
+            .style("stroke-opacity", 0.6)
+            .style("stroke-width", function(d) { return Math.sqrt(d.value);});
+
+        // nodes驟榊�繧呈ｸ｡縺励ヮ繝ｼ繝峨�菴懈�
+        var node = svg.selectAll(".node")
+            .data(json.nodes)
+            .enter().append("circle")
+            .attr("class", "node")
+            .attr("r", (NODEHEIGHT / 2))
+            .attr("cx", function(d) { return d.x;} )
+            .attr("cy",  function(d) { return d.y; })
+            .style("stroke", function(d) { return '#fafafa'; })
+            .style("stroke-width", function(d) { return '1.5px'; })
+            .style("fill", function(d) { return d.nodecolor; })
+            .style("cursor", function(d) { return 'pointer'; });
+
+        // nodes驟榊�繧呈ｸ｡縺励ヮ繝ｼ繝峨ユ繧ｭ繧ｹ繝医�菴懈�
+        var tnode = svg.selectAll("text.node")
+            .data(json.nodes)
+            .enter().append("svg:text")
+            .attr("class", "tnode")
+            .attr("x", function(d) { return d.x; })
+            .attr("y", function(d) { return d.y; })
+            .text(function(d) { return d.name; })
+            .style("fill", function(d) { return '#000000'; })
+            .style("text-anchor", function(d) { return 'middle'; })
+            .style("pointer-events", "none");
+
+        // 繝ｪ繝ｳ繧ｯ繝�く繧ｹ繝医�菴懈�
+        var tlink = svg.selectAll("text.link")
+            .data(json.links)
+            .enter().append("svg:text")
+            .attr("class", "tlink")
+            .attr("x", function(d) { return (json.nodes[d.source].x + json.nodes[d.target].x) / 2; })
+            .attr("y", function(d) { return (json.nodes[d.source].y + json.nodes[d.target].y) / 2; })
+            .style("fill", function(d) { return '#000000'; })
+            .style("text-anchor", function(d) { return 'middle'; });
+
+        // nodes驟榊�繧呈ｸ｡縺励ヮ繝ｼ繝峨ユ繧ｭ繧ｹ繝医�菴懈�
+        var tscore = svg.selectAll("text.score")
+            .data(json.nodes)
+            .enter().append("svg:text")
+            .attr("class", "tscore")
+            .attr("x", function(d) { return (d.x + scoreleftmargin); })
+            .attr("y", function(d) { return d.y; })
+            .text(function(d) { return d.score;
+            })
+            .style("fill", function(d) { return '#FF0000'; })
+            .style("text-anchor", function(d) { return 'middle'; })
+            .style("pointer-events", "none");
+
+        // 繝槭え繧ｹ縺ｮ蜍輔″繧ｫ繧ｦ繝ｳ繝医ｒ繝ｫ繝ｼ繝医↓謖√◆縺帙ｋ
+        MOUSEMOVED = 0;
+
+        // 繝弱�繝峨∈縺ｮ繧ｪ繝ｳ繝槭え繧ｹ縺ｧ繝代せ謗｢邏｢縲√ヱ繧ｹ荳ｭ縺ｮ繝ｪ繝ｳ繧ｯ譁�ｭ励ｒ陦ｨ遉ｺ
+        node.on("mouseover", function(d){
+
+            // 繝槭え繧ｹ縺ｮ蜍輔″繧ｫ繧ｦ繝ｳ繝医ｒ繝ｪ繧ｻ繝�ヨ
+            node.data()[0].mousemoved = 0;
+
+            // 陦ｨ遉ｺ縺吶ｋ繝代せ菫晏ｭ倡畑驟榊�
+            var path = [];
+            // 繝��繝ｫ繝√ャ繝励∈縺ｮ蜷榊燕陦ｨ遉ｺ逕ｨ驟榊�
+            var pathname = [];
+
+            // 繝ｫ繝ｼ繝医ヮ繝ｼ繝我ｻ･螟悶↑繧�
+            if(d.nodeid != 0){
+                // 縺ｾ縺壹が繝ｳ繝槭え繧ｹ縺輔ｌ縺溘ヮ繝ｼ繝峨�id縺ｨ蜷榊燕繧偵◎繧後◇繧瑚ｿｽ蜉
+                path.push(d.nodeid);
+                pathname.push(d.name);
+
+                // 繝代せ謗｢邏｢
+                do{
+                    // 繝ｪ繝ｳ繧ｯ縺ｮ謨ｰ縺縺醍ｹｰ繧願ｿ斐＠
+                    for(var i = 0; i < link.data().length; i++){
+                        // 迴ｾ蝨ｨ縺ｮ譛蠕悟ｰｾ縺ｫ郢九′繧九Μ繝ｳ繧ｯ縺後≠繧後�
+                        if(path[(path.length-1)] == link.data()[i].target){
+                            // 縺昴�繝ｪ繝ｳ繧ｯ縺ｮ繧ｽ繝ｼ繧ｹ蛛ｴ繝弱�繝峨�id繧定ｿｽ蜉
+                            path.push(link.data()[i].source);
+                            // 縺昴�繝ｪ繝ｳ繧ｯ縺ｮ蜷榊燕縺ｨ繧ｽ繝ｼ繧ｹ蛛ｴ繝弱�繝峨�蜷榊燕繧定ｿｽ蜉
+                            pathname.push(link.data()[i].property);
+                            pathname.push(node.data()[link.data()[i].source].name);
+                        }
+                    }
+                // 繝ｫ繝ｼ繝医ヮ繝ｼ繝峨↓霎ｿ繧顔捩縺上∪縺ｧ郢ｰ繧願ｿ斐☆
+                }while(path[(path.length-1)] != 0);
+
+                // 譛ｫ遶ｯ繝弱�繝峨〒縺ｪ縺�↑繧�
+                if(d.path == "notend"){
+                    // 繝��繝ｫ繝√ャ繝励ｒ髱櫁｡ｨ遉ｺ縺ｫ
+                    $('.SBSelectedPath').html('');
+                }else{
+                    // 譛ｫ遶ｯ繝弱�繝峨↑繧峨ヤ繝ｼ繝ｫ繝√ャ繝励�諠�ｱ繧呈峩譁ｰ
+                    var resultText = "<h2>Selected Path</h2>";
+                    // 繝代せ縺ｮ蜷榊燕驟榊�蛻�ｾ後ｍ縺九ｉ郢ｰ繧願ｿ斐＠縺ｪ縺後ｉ
+                    for (var i = pathname.length;i > 0; i--){
+                        // 螂�焚逡ｪ逶ｮ�医ヮ繝ｼ繝峨�蜷榊燕�峨�螟ｪ蟄励↓
+                        if(i % 2 == 1){
+                            resultText = resultText + "<span style=\"font-weight: bold;\">" + pathname[i - 1] + "</span><br><br>";
+                        // 蛛ｶ謨ｰ逡ｪ逶ｮ�医Μ繝ｳ繧ｯ縺ｮ蜷榊燕�峨�縺昴�縺ｾ縺ｾ縺ｧ陦ｨ遉ｺ
+                        }else{
+                            resultText = resultText + pathname[i - 1] + "<br><br>";
+                        }
+                    }
+                    resultText = resultText + '<input type="button" value="Generate" onclick="generateSPARQL()">';
+                    // 繝��繝ｫ繝√ャ繝励�蜀�ｮｹ繧呈嶌縺肴鋤縺�
+                    $('.SBSelectedPath').html(resultText);
+                    if(svg.attr("width") == width){
+                        $('.SBTooltip').show();
+                    }
+
+                    // 繧ｵ繝ｼ繝悶Ξ繝�ヨ縺ｫ騾√ｊ霑斐☆繝代せ繧ｪ繝悶ず繧ｧ繧ｯ繝医ｒ菫晏ｭ�
+                    pathobj = d.path;
+
+
+                    /*
+                    // 繝��繝ｫ繝√ャ繝苓｡ｨ遉ｺ譎ゅ�蠎ｧ讓呻ｼ医が繝ｳ繝槭え繧ｹ縺輔ｌ縺溘ヮ繝ｼ繝峨�讓ｪ縺ｫ繝懊ち繝ｳ縺梧擂繧九ｈ縺��鄂ｮ��
+                    var xPosition = parseFloat(d3.select(this).attr("cx")) + parseFloat(d3.select(this).style("stroke-width")) + NODEHEIGHT;
+                    var yPosition = parseFloat(d3.select(this).attr("cy") - $('.SBTooltip').height() - 30 + ($('.SBModalView').height() / 20)) + NODEHEIGHT;
+
+                    $('.SBModalView')
+
+                    // 繝��繝ｫ繝√ャ繝励′逕ｻ髱｢螟悶↓蜃ｺ縺ｪ縺�ｈ縺�｣懈ｭ｣
+                    if(xPosition < 0){
+                        xPosition = 0;
+                    }
+                    if(yPosition < 0){
+                        yPosition = 0;
+                    }
+
+                    // 逕滓�縺励◆蠎ｧ讓吶↓繝��繝ｫ繝√ャ繝励ｒ陦ｨ遉ｺ
+                    $('.SBTooltip').css('left', xPosition + "px").css('top', yPosition + "px");
+                    */
+
+                }
+            // 繝ｫ繝ｼ繝医ヮ繝ｼ繝峨□縺｣縺溘↑繧�
+            }else{
+                // 繝��繝ｫ繝√ャ繝励ｒ髱櫁｡ｨ遉ｺ
+                $('.SBTooltip').hide();
+            }
+
+            // 繧ｪ繝ｳ繝槭え繧ｹ縺輔ｌ縺溘ヮ繝ｼ繝峨�鬮倥＆縺ｫ隕ｪ繧貞粋繧上○繧九◆繧√↓蜷医ｏ縺帙ｋ鬮倥＆繧剃ｿ晏ｭ�
+            var movey = d.y;
+
+            // 蜷�ヮ繝ｼ繝峨↓蟇ｾ縺�
+            node
+                // 霈ｪ驛ｭ邱壹�濶ｲ繧定ｨｭ螳�
+                .style("stroke", function(d){
+                    // 縺ｾ縺壹�閭梧勹濶ｲ�医ョ繝輔か繝ｫ繝茨ｼ峨ｒ謖�ｮ�
+                    var strokecolor = "#fafafa";
+
+                    // 繝代せ蛻､螳壹�蜑榊�逅�
+                    // 陦ｨ遉ｺ繝輔Λ繧ｰ縺系ow�亥燕蝗槭が繝ｳ繝槭え繧ｹ縺ｧ蜍輔＞縺ｦ縺�◆繝弱�繝会ｼ峨↑繧�
+                    if(d.view == "now"){
+                        // 繝弱�繝峨�陦ｨ遉ｺ繝輔Λ繧ｰ繧地o縺ｫ
+                        d.view = "no";
+                    }
+                    // 陦ｨ遉ｺ繝輔Λ繧ｰ縺稽oved�医け繝ｪ繝�け縺輔ｌ蝗ｺ螳壽ｸ医∩縺縺悟燕蝗槫虚縺�※縺�◆繝弱�繝会ｼ峨↑繧�
+                    if(d.view == "moved"){
+                        // 陦ｨ遉ｺ繝輔Λ繧ｰ繧団licked縺ｫ謌ｻ縺�
+                        d.view = "clicked";
+                    }
+
+                    // 陦ｨ遉ｺ繝輔Λ繧ｰ縺系o縺ｮ繧ゅ�縺九ｉ遒ｺ隱�
+                    if(d.view == "no"){
+                        // 繝代せ縺ｮ繝弱�繝画焚縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
+                        for(var n = 0; n < path.length; n++){
+                            // 繝代せ蜀�↓蜷ｫ縺ｾ繧後ｋ繝弱�繝峨□縺｣縺溘ｉ
+                            if(path[n] == d.nodeid){
+                                // 霈ｪ驛ｭ邱壹ｒ襍､縺ｫ
+                                strokecolor = "#ffaaaa";
+                                // 陦ｨ遉ｺ繝輔Λ繧ｰ繧地ow�井ｻ雁屓蜍輔＞縺溘ヮ繝ｼ繝会ｼ峨↓
+                                d.view = "now";
+                            }
+                        }
+                    // 蝗ｺ螳壽ｸ医∩繝弱�繝峨□縺｣縺溘ｉ
+                    }else if(d.view == "clicked"){
+                        // 縺ｾ縺壹�霈ｪ驛ｭ邱壹ｒ襍､縺ｫ
+                        strokecolor = "#ffaaaa";
+                        // 繝代せ蜀�↓蜷ｫ縺ｾ繧後ｋ繝弱�繝峨°繝√ぉ繝�け
+                        for(var n = 0; n < path.length; n++){
+                            if(path[n] == d.nodeid){
+                                // 蜷ｫ縺ｾ繧後※縺�◆縺ｪ繧我ｻ雁屓蜍輔°縺吶◆繧√ヵ繝ｩ繧ｰ繧知oved縺ｫ
+                                d.view = "moved";
+                            }
+                        }
+                    }
+
+                    // 縺薙％縺ｾ縺ｧ縺ｧ蠕励ｉ繧後◆霈ｪ驛ｭ邱壹�濶ｲ繧定ｿ斐☆
+                    return strokecolor;
+                })
+                // 鬮倥＆縺ｮ蛟､
+                .attr("cy", function(d){
+                    // 繝弱�繝峨′莉雁屓繧ｪ繝ｳ繝槭え繧ｹ縺輔ｌ縺溘�縺ｾ縺溘�蝗ｺ螳壽ｸ医∩縺縺檎ｧｻ蜍輔ヵ繝ｩ繧ｰ繧偵▽縺代ｉ繧後※縺�ｌ縺ｰ
+                    if(d.view == "now" || d.view == "moved"){
+                        // 迴ｾ蝨ｨ縺ｮ鬮倥＆繧貞叙蠕�
+                        var curty = d.y;
+                        // d.y縺ｫ蟄舌ヮ繝ｼ繝峨�鬮倥＆繧偵そ繝�ヨ
+                        d.y = movey;
+                        // 迴ｾ蝨ｨ縺ｮ鬮倥＆繧定ｿ斐☆�医％縺ｮ譎らせ縺ｧ縺ｯ迴ｾ蝨ｨ菴咲ｽｮ縺ｫ謠冗判縺輔ｌ縲〉edraw髢｢謨ｰ縺ｧd.y縺ｫ繧｢繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ縺輔ｌ繧具ｼ�
+                        return curty;
+                    // 遘ｻ蜍募ｯｾ雎｡縺ｧ縺ｪ縺�↑繧�
+                    }else{
+                        // 迴ｾ蝨ｨ菴咲ｽｮ繧偵◎縺ｮ縺ｾ縺ｾ霑斐☆
+                        return d.y;
+                    }
+                });
+
+            // 蜷�Μ繝ｳ繧ｯ繝�く繧ｹ繝医↓蟇ｾ縺�
+            tlink
+                // 繝�く繧ｹ繝郁｡ｨ遉ｺ蛻､螳�
+                .text(function(d) {
+                    // 繝�ヵ繧ｩ繝ｫ繝医〒遨ｺ繧偵そ繝�ヨ
+                    var linktext = "";
+                    // 陦ｨ遉ｺ繝輔Λ繧ｰ縺系ow�亥燕蝗櫁｡ｨ遉ｺ縺輔ｌ縺ｦ縺�◆繝ｪ繝ｳ繧ｯ�峨↑繧�
+                    if(d.view == "now"){
+                        // 陦ｨ遉ｺ繝輔Λ繧ｰ繧定ｧ｣髯､
+                        d.view = "no";
+                    }
+
+                    // 陦ｨ遉ｺ繝輔Λ繧ｰ縺系o縺ｪ繧�
+                    if(d.view == "no"){
+                        // 繝代せ縺ｮ繝弱�繝画焚蛻�ｹｰ繧願ｿ斐＠
+                        for(var t = 0; t < path.length; t++){
+                            // 閾ｪ霄ｫ縺後◎縺ｮ繝弱�繝峨∈謗･邯壹＠縺ｦ縺�ｋ繝ｪ繝ｳ繧ｯ�医°縺､縺昴�繝弱�繝峨′謚倥ｊ縺溘◆縺ｾ繧後※縺�↑縺代ｌ縺ｰ��
+                            if(path[t] == d.target && node.data()[d.target].view != "hide"){
+                                // 繝ｪ繝ｳ繧ｯ繝�く繧ｹ繝医↓繝励Ο繝代ユ繧｣縺ｮ蛟､繧偵そ繝�ヨ
+                                linktext = d.property
+                                // 陦ｨ遉ｺ繝輔Λ繧ｰ縺ｫnow繧偵そ繝�ヨ
+                                d.view = "now";
+                            }
+                        }
+                    // 陦ｨ遉ｺ繝輔Λ繧ｰ縺掲ix�医け繝ｪ繝�け縺輔ｌ縺溘ヱ繧ｹ縺ｮ繝ｪ繝ｳ繧ｯ�峨↑繧峨��医°縺､郢九′繧句�縺ｮ繝弱�繝峨′謚倥ｊ縺溘◆縺ｾ繧後※縺�↑縺代ｌ縺ｰ��
+                    }else if(d.view == "fix" && node.data()[d.target].view != "hide"){
+                        // 繝ｪ繝ｳ繧ｯ繝�く繧ｹ繝医↓繝励Ο繝代ユ繧｣縺ｮ蛟､繧偵そ繝�ヨ
+                        linktext = d.property
+                    }
+                    // 縺薙％縺ｾ縺ｧ縺ｧ縺ｧ縺阪◆繝ｪ繝ｳ繧ｯ繝�く繧ｹ繝医ｒ霑斐☆
+                    return linktext;
+                });
+
+            // 蜷�Μ繝ｳ繧ｯ縺ｫ蟇ｾ縺�
+            link
+                // 邱壹�濶ｲ蛻､螳�
+                .style("stroke", function(d){
+                    // 陦ｨ遉ｺ繝輔Λ繧ｰ縺系o縺ｪ繧峨�
+                    if(d.view == "no"){
+                        // 濶ｲ繧偵ョ繝輔か繝ｫ繝医↓
+                        return "#999";
+                    // 縺昴ｌ莉･螟厄ｼ亥崋螳壹ｄ繧ｪ繝ｳ繝槭え繧ｹ縺輔ｌ縺溘ヱ繧ｹ縺ｫ蜷ｫ縺ｾ繧後ｋ�峨↑繧�
+                    }else{
+                        // 濶ｲ繧定ｵ､縺ｫ
+                        return "#ffaaaa";
+                    }
+                });
+
+            // 縺薙％縺ｾ縺ｧ縺ｮ險ｭ螳壹ｒ蜈�↓蜀肴緒逕ｻ
+            redraw();
+
+        // 繝弱�繝峨∈縺ｮ繧ｯ繝ｪ繝�け縺ｧ驕ｸ謚槫崋螳壼喧�亥所縺ｳ謚倥ｊ逡ｳ縺ｿ蜃ｦ逅�ｼ�
+        }).on("click", function(d){
+
+            // 蜷�ヮ繝ｼ繝峨↓蟇ｾ縺�
+            node
+                // 霈ｪ驛ｭ邱壹�蛻､螳�
+                .style("stroke", function(d) {
+                    // 繝�ヵ繧ｩ繝ｫ繝医�濶ｲ繧偵そ繝�ヨ
+                    var strokecolor = "#fafafa"
+                    // 陦ｨ遉ｺ繝輔Λ繧ｰ縺後が繝ｳ繝槭え繧ｹ荳ｭ繝ｻ蝗ｺ螳壻ｸｭ繝ｻ遘ｻ蜍穂ｸｭ�磯∈謚槭＆繧後※縺�ｋ繝弱�繝会ｼ峨↑繧峨�
+                    if(d.view == "now" || d.view == "clicked" || d.view == "moved"){
+                        // 濶ｲ繧定ｵ､縺ｫ
+                        strokecolor = "#ffaaaa"
+                        // 陦ｨ遉ｺ繝輔Λ繧ｰ繧貞崋螳壻ｸｭ縺ｫ
+                        d.view = "clicked";
+                    }
+                    // 縺薙％縺ｾ縺ｧ縺ｧ縺ｧ縺阪◆濶ｲ繧定ｿ斐☆
+                    return strokecolor;
+                });
+
+            // 蜷�Μ繝ｳ繧ｯ縺ｫ蟇ｾ縺�
+            tlink
+                // 繝�く繧ｹ繝郁｡ｨ遉ｺ蛻､螳�
+                .text(function(d) {
+                    // 繝�ヵ繧ｩ繝ｫ繝医〒遨ｺ縺ｫ
+                    var linktext = "";
+                    // 陦ｨ遉ｺ繝輔Λ繧ｰ縺檎樟蝨ｨ陦ｨ遉ｺ荳ｭ縺ｾ縺溘�蝗ｺ螳壼喧貂医∩縺ｪ繧峨��医°縺､謚倥ｊ逡ｳ縺ｿ荳ｭ縺ｧ縺ｪ縺代ｌ縺ｰ��
+                    if((d.view == "now" || d.view == "fix") && (node.data()[d.target].view != "hide")){
+                        // 繝ｪ繝ｳ繧ｯ繝�く繧ｹ繝医↓繝励Ο繝代ユ繧｣縺ｮ蛟､繧偵そ繝�ヨ
+                        linktext = d.property
+                        // 陦ｨ遉ｺ繝輔Λ繧ｰ繧貞崋螳壻ｸｭ縺ｫ
+                        d.view = "fix";
+                    }
+                    // 繝�く繧ｹ繝医ｒ霑斐☆
+                    return linktext;
+                });
+
+            // 縺薙％縺ｾ縺ｧ縺ｮ蜃ｦ逅�ｵ先棡繧貞�縺ｫ蜀肴緒逕ｻ
+            redraw();
+
+        });
+
+        // 蜀肴緒逕ｻ髢｢謨ｰ
+        var redraw = function (duration){
+
+            // 縺九￠繧区凾髢薙′譛ｪ謖�ｮ壹↑繧峨�
+            if(duration == undefined){
+                // 0.5遘偵°縺代※繧｢繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ
+                duration = 500;
+            }
+
+            // 蜷�Μ繝ｳ繧ｯ縺ｫ縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ
+            link
+                .transition()
+                .duration(duration)
+                .attr("x1", function(d) {return node.data()[d.source].x;})
+                .attr("y1", function(d) {return node.data()[d.source].y;})
+                .attr("x2", function(d) {return node.data()[d.target].x;})
+                .attr("y2", function(d) {return node.data()[d.target].y;});
+
+            // 蜷�ヮ繝ｼ繝峨↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ�医°縺､謚倥ｊ縺溘◆縺ｾ繧御ｸｭ縺ｮ蝣ｴ蜷医�謠冗判蛻�ｲ仙�逅�ｼ�
+            node
+                .transition()
+                .duration(duration)
+                .attr("cx", function(d) {return d.x;})
+                .attr("cy", function(d) {return d.y;});
+
+            // 蜷�ヮ繝ｼ繝峨ユ繧ｭ繧ｹ繝医↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ縲√ユ繧ｭ繧ｹ繝域緒逕ｻ菴咲ｽｮ繧剃ｸ贋ｸ九↓謖ｯ繧具ｼ医°縺､謚倥ｊ縺溘◆縺ｾ繧御ｸｭ縺ｮ蝣ｴ蜷医�謠冗判蛻�ｲ仙�逅�ｼ�
+            tnode
+            .transition()
+            .duration(duration)
+            .attr("x", function(d) {return d.x;})
+            .attr("y", function(d) {
+                // 繝�ヵ繧ｩ繝ｫ繝医〒蟆代＠荳九￡繧�
+                var updown = (self.NODEHEIGHT * 0.4);
+                // 螂�焚逡ｪ逶ｮ縺ｮ豺ｱ縺輔↑繧牙ｰ代＠荳翫￡繧�
+                if(d.group % 2 == 1){
+                    updown = -(self.NODEHEIGHT * 0.2);
+                }
+                // 縺昴�蛟､繧帝ｫ倥＆縺ｫ霑斐☆縺薙→縺ｧ繝�く繧ｹ繝域緒逕ｻ菴咲ｽｮ縺御ｺ偵＞驕輔＞縺ｫ縺ｪ繧�
+                return d.y + updown;
+            });
+
+            // 蜷�Μ繝ｳ繧ｯ繝�く繧ｹ繝医↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ
+            tlink
+                .transition()
+                .duration(duration)
+                .attr("x", function(d) {return (node.data()[d.source].x + node.data()[d.target].x) / 2;})
+                .attr("y", function(d) {return ((node.data()[d.source].y + node.data()[d.target].y) / 2) + 5;});
+
+        };
+
+        // 閭梧勹驛ｨ蛻�′繧ｯ繝ｪ繝�け縺輔ｌ縺溘ｉ陦ｨ遉ｺ縺ｮ蝗ｺ螳壼喧繧定ｧ｣髯､
+        bg.on("click", function() {
+            // 繝��繝ｫ繝√ャ繝励ｒ髱櫁｡ｨ遉ｺ
+            $('.SBTooltip').hide();
+            d3.selectAll(".node").style("stroke-width", function(d) { return '1.5px'; });
+            d3.selectAll(".node").style("stroke", function(d) { return '#ffffff'; });
+
+            // 蜷�ヮ繝ｼ繝峨�霈ｪ驛ｭ邱壹�濶ｲ繧偵ョ繝輔か繝ｫ繝医↓
+            node
+                .style("stroke", function(d){
+                    if(d.view != "hide"){
+                        d.view = "no";
+                    }
+                    return "#fafafa";
+                });
+
+            // 繝ｪ繝ｳ繧ｯ繝�く繧ｹ繝医ｒ蜈ｨ縺ｦ遨ｺ縺ｫ
+            tlink
+                .text(function(d) {
+                    d.view = "no";
+                    return "";
+                });
+
+            // 繝ｪ繝ｳ繧ｯ縺ｮ濶ｲ繧貞�縺ｦ繝�ヵ繧ｩ繝ｫ繝医↓
+            link
+                .style("stroke", function(d){
+                    return "#999";
+                });
+
+            /*
+            if(svg.attr("width") == width){
+	            svg.attr("width", (width / 5))
+	            .attr("height", (width * 9 / 16 / 5))
+	            .attr("viewBox", "0 0 " + width + " " + (width * 9 / 16));
+            }else{
+	            svg.attr("width", width)
+	            .attr("height", height)
+	            .attr("viewBox", "0 0 " + width + " " + height);
+            }
+            */
+
+        });
+
+        // 閭梧勹荳翫〒繝槭え繧ｹ縺悟虚縺上＃縺ｨ縺ｫ
+        bg.on("mousemove", function(){
+            // MOUSEMOVED繧定ｿｽ蜉�医ヮ繝ｼ繝峨↓繧ｪ繝ｳ繝槭え繧ｹ縺輔ｌ繧句ｺｦ縺ｫ繧ｫ繧ｦ繝ｳ繝医Μ繧ｻ繝�ヨ��
+        	MOUSEMOVED++;
+            // 30繧定ｶ�∴縺溘ｉ
+            if(MOUSEMOVED > 30){
+                // 繝��繝ｫ繝√ャ繝励ｒ髱櫁｡ｨ遉ｺ縺ｫ縺励※繧ｫ繧ｦ繝ｳ繝医Μ繧ｻ繝�ヨ
+                $('.SBTooltip').hide();
+                MOUSEMOVED = 0;
+            }
+        });
+
+        // 蛻晏屓縺ｮ縺ｿduration繧�縺ｨ謖�ｮ壹＠蜀肴緒逕ｻ�医い繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ縺ｪ縺暦ｼ�
+        redraw(0);
+
+    }else{
+        // SVG縺ｮ蜑企勁
+        d3.select(".SBGraph svg").remove();
+    }
+};
+
+make_data = function(tdepth, ret, parent, depth){
+	// ret縺梧悴螳夂ｾｩ縺ｪ繧峨�螳夂ｾｩ縺励※莉｣蜈･
+	if (ret == undefined){
+		ret = new Object();
+		ret['nodes'] = new Array();
+		ret['links'] = new Array();
+	}
+
+	PATHNUM = 0;
+	MAXDEPTH = 0;
+	TREESPACE = 0;
+	NODEHEIGHT = 50;
+	DRAWHEIGHT = NODEHEIGHT;
+
+	var viewnum;
+
+	var obj = jsontext;
+
+	$('.SBResult').css('color', 'black').css('font-weight', 'normal');
+
+	$('.SBPlural').text('s');
+
+	if(obj.length == 0){
+		$('.SBResult').css('color', 'red').css('font-weight', 'bold');
+		$('.SBPlural').text('');
+	}else if(obj.length == 1){
+		$('.SBPlural').text('');
+	}
+
+	if(obj.length <= 10){
+		viewnum = obj.length;
+		$('.SBViewall').hide();
+	}else if(pathlimit == 10){
+		viewnum = 10;
+		$('.SBViewall').show();
+	}else{
+		viewnum = obj.length;
+		$('.SBViewall').hide();
+	}
+
+	$('.SBPathnum').text(obj.length);
+	$('.SBResult').show();
+
+    // obj繝医ャ繝鈴嚴螻､縺ｮ謨ｰ縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
+    for(var i = 0; i < viewnum; i++){
+        if(i == 0){
+            // 蛻晏屓縺縺代Ν繝ｼ繝医ヮ繝ｼ繝峨ｒ繝励ャ繧ｷ繝･
+            ret['nodes'].push({'name': obj[0]['label'], 'uri': obj[0]['startClass'], 'group': 0, 'x':50, 'y':50, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend', 'nodecolor': '#d0a36a'});
+        }
+        // 蜈医↓source縺ｫ0�医Ν繝ｼ繝茨ｼ峨ｒ莉｣蜈･
+        var source = 0;
+        // 蜈ｱ騾壹Ν繝ｼ繝亥愛螳壹ｒtrue縺ｫ
+        var isCommon = true;
+
+        var score = obj[i]['score'];
+
+        // classLinks縺ｮ謨ｰ縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
+        for(var j = 0;j < obj[i]['classLinks'].length; j++){
+
+            // 繝ｪ繝ｳ繧ｯ縺ｮ蜷榊燕繧旦RL譛ｫ蟆ｾ縺九ｉ蜿門ｾ�
+            var propertytext = obj[i]['classLinks'][j]['predicate'];
+            var propertysplit1 = propertytext.split("/");
+            var propertysplit2 = propertysplit1[propertysplit1.length - 1];
+            var propertysplit3 = propertysplit2.split("#");
+            propertytext = propertysplit3[propertysplit3.length - 1];
+
+            if(MAXDEPTH < j+1){
+                MAXDEPTH = j+1;
+            }
+            // 縺薙％縺ｾ縺ｧ蜈ｱ騾壹Ν繝ｼ繝医↑繧�
+            if(isCommon){
+                // 莉雁屓繧ょ�騾壹°遒ｺ隱阪☆繧九◆繧√�繝輔Λ繧ｰ
+                var isCommonNow = false;
+                // nodes驟榊�縺ｫ蜷後§linkedClass縺梧里縺ｫ縺ゅｋ縺狗｢ｺ隱�
+                var targets = [];
+                for(var k = 0; k < ret['nodes'].length; k++){
+                    // 蜷碁嚴螻､縺九▽蜷後§蜷榊燕縺ｮ繧ゅ�縺後≠縺｣縺溘ｉtargets驟榊�縺ｫ逡ｪ蜿ｷ繧定ｿｽ蜉
+                    if(ret['nodes'][k]['group'] == (j+1) && obj[i]['classLinks'][j]['linkedClass'] == ret['nodes'][k]['uri']){
+                        targets.push(k);
+                    }
+                }
+
+                // 譌｢縺ｫ縺ゅ▲縺溷ｴ蜷医�links驟榊�縺ｫ蜷後§link縺悟ｭ伜惠縺吶ｋ縺狗｢ｺ隱�
+                if(targets.length != 0){
+                    // 蜈医⊇縺ｩ隕九▽縺代◆targets縺ｮ謨ｰ縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
+                    for(var l = 0; l <targets.length; l++){
+                        // links驟榊�縺ｫ蜈ｨ縺丞酔縺俶擅莉ｶ縺ｮ繧ゅ�縺後≠繧九°遒ｺ隱�
+                        for(var m = 0; m < ret['links'].length; m++){
+                            // 縺ゅ▲縺溷ｴ蜷井ｻ雁屓縺ｮ繧ゅ�縺ｯ霑ｽ蜉縺帙★source繧呈峩譁ｰ縺励※谺｡縺ｸ
+                            if(ret['links'][m]['source'] == source && ret['links'][m]['target'] == targets[l] && ret['links'][m]['uri'] == obj[i]['classLinks'][j]['predicate'] && !isCommonNow){
+                                // 蜈ｱ騾壹Ν繝ｼ繝医ヵ繝ｩ繧ｰ繧偵が繝ｳ
+                                isCommonNow = true;
+                                source = targets[l];
+                            }
+                        }
+                    }
+
+                    // 蜷дarget繧堤｢ｺ隱阪＠縺ｦ蜈ｱ騾壹Ν繝ｼ繝医〒縺ｯ縺ｪ縺九▲縺溷ｴ蜷域眠隕剰ｿｽ蜉
+                    if(!isCommonNow){
+                        isCommon = false;
+                        ret['nodes'].push({'name': obj[i]['classLinks'][j]['label'], 'uri': obj[i]['classLinks'][j]['linkedClass'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend', 'nodecolor': '#cccccc'});
+                        ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property': propertytext, 'uri': obj[i]['classLinks'][j]['predicate'], 'view' : 'no'});
+                        source = ret['nodes'].length - 1;
+                    }
+
+                // 縺ｪ縺九▲縺溷ｴ蜷医�蛻･譚｡莉ｶ縺ｪ縺ｮ縺ｧ譁ｰ隕剰ｿｽ蜉縺励※谺｡縺ｸ
+                }else{
+
+                    isCommon = false;
+                    ret['nodes'].push({'name': obj[i]['classLinks'][j]['label'], 'uri': obj[i]['classLinks'][j]['linkedClass'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend', 'nodecolor': '#cccccc'});
+                    ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property': propertytext, 'uri': obj[i]['classLinks'][j]['predicate'], 'view' : 'no'});
+                    source = ret['nodes'].length - 1;
+                }
+            // 譌｢縺ｫ蜈ｱ騾壹Ν繝ｼ繝医〒縺ｪ縺�↑繧画眠隕剰ｿｽ蜉縺励※谺｡縺ｸ
+            }else{
+                ret['nodes'].push({'name': obj[i]['classLinks'][j]['label'], 'uri': obj[i]['classLinks'][j]['linkedClass'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend', 'nodecolor': '#cccccc'});
+                ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property': propertytext, 'uri': obj[i]['classLinks'][j]['predicate'], 'view' : 'no'});
+                source = ret['nodes'].length - 1;
+            }
+
+        }
+        ret['nodes'][ret['nodes'].length - 1]['path'] = obj[i];
+        ret['nodes'][ret['nodes'].length - 1]['score'] = score;
+        ret['nodes'][ret['nodes'].length - 1]['nodecolor'] = '#8cddc0';
+        PATHNUM++;
+    }
+    TREESPACE = $('.SBGraph').width() / (MAXDEPTH + 1);
+
+    // 縺ｧ縺阪◆邨先棡繧定ｿ斐☆
+    return ret;
+};
+
+set_map_location = function(myNodeIndex, nodes, links, depth, fromAngle, toAngle){
+
+    // depth縺梧悴螳夂ｾｩ縺ｪ繧峨�0繧偵そ繝�ヨ
+    if (depth == undefined){
+        depth = 0;
+    }
+
+    // 蜷�ｨｮ蛻晄悄蛹�
+    var children = undefined;
+    var parent = undefined;
+    var parentsChildren = undefined;
+
+    // links驟榊�縺ｮ謨ｰ縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
+    for (var i=0; i<links.length; i++){
+        // 縺昴�links縺ｮtarget縺稽yNodeIndex縺ｪ繧英arent繧偵そ繝�ヨ
+        if (links[i].target == myNodeIndex){
+            parent = links[i].source;
+        }
+    }
+
+    // parent縺瑚ｦ九▽縺九▲縺ｦ縺�◆縺ｪ繧峨�
+    if (parent != undefined){
+        // parent縺ｨlinks繧呈ｸ｡縺揚et_children繝｡繧ｽ繝�ラ繧貞ｮ溯｡�
+        parentsChildren = get_children(parent, links);
+    }
+
+    if(myNodeIndex != 0){
+        DRAWHEIGHT += (NODEHEIGHT * 1.5);
+        var x = (depth * TREESPACE) + (TREESPACE / 3);
+        var y = DRAWHEIGHT;
+        nodes[myNodeIndex].x = x;
+        nodes[myNodeIndex].y = y;
+    }else{
+        var x = TREESPACE / 3;
+        var y = (NODEHEIGHT * 1.5) * ((PATHNUM - 1) / 2) + NODEHEIGHT;
+        nodes[myNodeIndex].x = x;
+        nodes[myNodeIndex].y = y;
+    }
+
+    children = get_children(myNodeIndex, links);
+
+    for (var i=0; i<children.length; i++){
+        if(i == 0){
+            DRAWHEIGHT -= (NODEHEIGHT * 1.5);
+        }
+        var child = children[i];
+        set_map_location(child, nodes, links, depth+1, fromAngle + ((toAngle - fromAngle) / children.length) * i, fromAngle + ((toAngle - fromAngle) / children.length) * (i+1));
+    }
+
+};
+
+// 謖�ｮ壹＆繧後◆隕ｪ縺梧戟縺､蟄舌ｒ霑斐☆
+get_children = function(index, links){
+    var children = new Array();
+    // links縺ｮ謨ｰ縺縺醍｢ｺ隱阪＠縺ｪ縺後ｉ
+    for (var i=0; i<links.length; i++){
+        // 隕ｪ縺梧ｸ｡縺輔ｌ縺溯ｦｪ縺ｨ荳閾ｴ縺吶ｋ譎ゅ�蟄舌ｒ霑ｽ蜉
+        if (links[i].source == index){
+            children.push(links[i].target);
+        }
+    }
+    return children;
+};
Index: /SPARQLBuilderWWW/web/newgui.html
===================================================================
--- /SPARQLBuilderWWW/web/newgui.html (revision 232)
+++ /SPARQLBuilderWWW/web/newgui.html (revision 232)
@@ -0,0 +1,15 @@
+<html>
+	<head>
+		<script src="./jquery-1.11.1.min.js"></script>
+		<script src="./d3.v3.min.js" charset="utf-8"></script>
+		<script type="text/javascript" src="http://uedayou.net/SPARQLTimeliner/js_sparql/sparql.js" charset="UTF-8"></script>
+		<script src="./newsparqlbuilder.js"></script>
+		<script src="select2.min.js"></script>
+		<link href="select2.css" rel="stylesheet"/>
+		<link rel="stylesheet" href="./newsparqlbuilder.css" type="text/css" />
+	</head>
+	<body>
+	    <div id="SPARQLBUILDER">
+	    </div>
+	</body>
+</html>
Index: /SPARQLBuilderWWW/web/newsparqlbuilder.css
===================================================================
--- /SPARQLBuilderWWW/web/newsparqlbuilder.css (revision 232)
+++ /SPARQLBuilderWWW/web/newsparqlbuilder.css (revision 232)
@@ -0,0 +1,109 @@
+#SPARQLBUILDER{
+	width: 90%;
+	margin: auto;
+}
+.SBSparqlArea{
+	width: 100%;
+}
+
+.SBTOPButton{
+	margin-right: 1em;
+}
+
+.SBModalView{
+	position: absolute;
+	top: 0px;
+	bottom: 0px;
+	left: 0px;
+	right: 0px;
+	background-color: rgba(0,0,0,0.8);
+	display: none;
+}
+
+.SBModalContents{
+	position: absolute;
+	top: 0px;
+	bottom: 0px;
+	left: 0px;
+	right: 0px;
+	margin: auto;
+	width: 90%;
+	height: 90%;
+	background: white;
+	overflow: hidden;
+}
+
+.SBModalContents .SBSelects{
+	float: left;
+	background-color: #eeeeff;
+}
+
+.SBModalContents .SBSelects select{
+	width: 30%;
+	height: 2em;
+}
+
+.SBModalContents .SBSelects input{
+	display: inline-block;
+	width: 7.5%;
+	margin: 0 1% 0;
+	height: 2em;
+}
+
+.SBModalContents .SBMessage{
+	float: left;
+	text-align: center;
+	background-color: #eeeeff;
+}
+
+.SBModalContents .SBResult{
+	display: none;
+	float: left;
+	margin-top: 0.3em;
+	margin-left: 0.3em;
+}
+
+.SBModalContents .SBViewAll{
+	display: none;
+	float: left;
+	margin-top: 0.3em;
+	margin-left: 0.5em;
+}
+
+.SBModalContents .SBGraph{
+	float: left;
+}
+
+.SBModalContents .SBAjaxLoad{
+	position: relative;
+	top: 0;
+	left:0;
+	height: 100%;
+	background: #fffafa;
+}
+
+.SBModalContents .SBLoadIcon{
+	position: absolute;
+	top: 0;
+	left: 0;
+	right: 0;
+	bottom: 0;
+	margin: auto;
+	width: 100px;
+	height: 100px;
+}
+
+.SBModalContents .SBSelectedPath{
+	float: left;
+	text-align: center;
+	word-wrap: break-word;
+}
+
+.SBSelectedPath h2{
+	color: #ffaaaa;
+}
+
+.SBModalContents .SBModalButtons{
+	float: left;
+	text-align: center;
+}
