Index: /MDService2/trunk/MDService2/WebContent/index.jsp
===================================================================
--- /MDService2/trunk/MDService2/WebContent/index.jsp	(revision 798)
+++ /MDService2/trunk/MDService2/WebContent/index.jsp	(revision 799)
@@ -80,5 +80,5 @@
 			<label>name</label>
 			<input type="text" id="qts_input" ></input>
-			<button id="qts_save" >Save</button>
+			<span id="qts_save" class="cmd cmd_save" ></span>
 			<div id="userqueries" ></div>
 		</div>
Index: /MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js
===================================================================
--- /MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js	(revision 798)
+++ /MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js	(revision 799)
@@ -56,5 +56,5 @@
 		loadCollections();			
 		loadComponentsRegistry();	
-		loadElements();
+		loadTerms();
 		loadDCR();
 		
@@ -78,4 +78,5 @@
 function submit_query (columns, query, squery) {
 	notifyUser("processing query");
+	
 	if (jQuery.trim(query).length == 0){
 		query = null;
@@ -285,5 +286,5 @@
 		del = '<span class="cmd cmd_del" ><xsl:text> </xsl:text></span>';
 	}
-	var x = '<div class="cmds-elem-plus" ><span class="cmd cmd_load"></span><span class="query-detail-caller" ><a href="'+id + '_'+ i+'" >' + 
+	var x = '<div class="cmds-elem-plus" ><span class="cmd cmd_load"></span><span class="detail-caller" ><a href="'+id + '_'+ i+'" >' + 
 	Query.fullformatstring(json) + '</a></span>' + 
 	del +
@@ -386,5 +387,15 @@
 ////////////////////////////////////////////////
 function loadWelcomeMessage(){	
-	$('#detail').load("/MDService2/static/welcome.xml"); //profile.collections.base_uri,
+	$('#detail').load("/MDService2/static/welcome.xml", function() { //profile.collections.base_uri,
+		$('#welcome').addClass("ui-helper-reset ui-corner-all ui-widget-content");
+	});
+}
+
+function hideWelcomeMessage(){
+	// kick the welcome message on first submit
+	notifyUser("hiding welcome");
+	if( $('#welcome').is(':visible') ) {
+		$('#welcome').hide();
+	}
 }
 
@@ -501,5 +512,5 @@
 	});// end of collection callback	
 }
-function loadElements(){
+function loadTerms(){
 	$('#model_profiles').load(link('terms','htmlselect',actions.terms.current));
 	
@@ -544,4 +555,6 @@
 	});	
 	
+	/*
+	 * deactivated -> obsolete?
 	$('#terms .cmd_detail').live('click',  function(event) {
 		//showTermDetail($(this).parent().text());			
@@ -557,5 +570,6 @@
 		
 	});
-
+*/
+	
 }
 function loadComponentsRegistry(){
@@ -692,4 +706,5 @@
 
 }
+
 function handleBubble(){
 	// this is dangerous workaround
@@ -714,5 +729,7 @@
 		//$('#srquery').val(term);
 	});
-	$(".term_detail_caller a, .query-detail-caller a").live('click',
+	
+	/* obsolete: ? */
+	/* $(".term_detail_caller a, .query-detail-caller a").live('click',
 				// function(event) {
 				//	//notifyUser("term_detail_caller_live_click",'debug');					
@@ -738,7 +755,6 @@
 					}
 					notifyUser('last_bubble_uri:' + last_bubble_uri,'debug');
-				}); 
-
-
+				});
+	 		*/
 
 }
@@ -746,10 +762,14 @@
 function addFunctionality(){
 	  
-	$('.cmds-elem-plus').live('click',  function(event) {
+/*	$('.cmds-elem-plus').live('click',  function(event) {
 		$(this).children('.detail').toggle();
 	});
-	 
-	$('.detail-caller').live('click',  function(event) {		
+	*/ 
+	$('.detail-caller, .cmd_detail').live('click',  function(event) {		
 		$(this).parent().children('.detail').toggle();
+	});
+	
+	$('.detail-caller a').live('click',  function(event) {		
+		event.preventDefault();
 	});
 	
@@ -761,20 +781,19 @@
 	
 	$('.result a').live('click',  function(event) {
-		//showTermDetail($(this).parent().text());
-		event.preventDefault();
-		
-		var uri = $(this).attr('href'); // + " body";		
-		// $.ajax({ 
-		//	url: uri,
-		//	success: showDetail2
-		//	});
-			
+		event.preventDefault();		
+		var uri = $(this).attr('href'); // + " body";
 		$.get(uri, showDetail,'html');
-
-	});
+	});
+
+	$('.result .cmd_detail').live('click',  function(event) {				
+		var uri = $(this).parent().find("a").attr('href'); // + " body";
+		$.get(uri, showDetail,'html');
+	});
+
 	
 // RECORDSET searchRetrieve
 	$('#searchretrieve').submit( function(event) {
 			event.preventDefault();
+			hideWelcomeMessage();
 			searchclauseset.buildsctext();
 			notifyUser(searchclauseset.sctext,'debug');
@@ -926,5 +945,5 @@
 	
 	$('#collections .cmd_load').live('click',function(event){
-		
+		hideWelcomeMessage();
 		var collection_text = "";
 		var coll = $(this).next().next().next();
@@ -940,5 +959,5 @@
 	});
 	$('#serverqueries .cmd_load').live('click',function(event){
-		
+		hideWelcomeMessage();
 		var id = parseInt( $("#serverqts_select option:selected").val());
 		var str = $(this).parent().find('a').attr("href");
@@ -959,5 +978,5 @@
 	});
 	$('#userqueries .cmd_load').live('click',function(event){
-		
+		hideWelcomeMessage();
 		var id = parseInt( $("#qts_select option:selected").val());
 		var str = $(this).parent().find('a').attr("href");
@@ -1031,10 +1050,18 @@
 ////////////VISUALS 
 	
+	$('#left-menu').addClass('ui-accordion ui-widget ui-helper-reset ui-accordion-icons');	
+	$('#left-menu h2').addClass('ui-accordion-header ui-helper-reset ui-state-default ui-corner-all');
+	$('#left-menu>div').addClass('block ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom');
+	$('#left-menu h2').click(function() {
+		$(this).next().toggle('fast');
+		return false;
+	}).next().hide();
+
 	// Accordion
-			$("#left-menu").accordion({ header: "h2",event: 'click' });				
-			$("#left-menu").accordion('option', 'autoHeight', false);
+		//	$("#left-menu").accordion({ header: "h2",event: 'click' });				
+//			$("#left-menu").accordion('option', 'autoHeight', false);
 			
 			// hack to open the accordion without scroll-bars on init
-			$("#left-menu").accordion('option', 'active', 1);
+	//		$("#left-menu").accordion('option', 'active', 1);
 			
 			
@@ -1055,4 +1082,5 @@
 
 }
+
 String.prototype.beginsWith = function(t, i) { if (i==false) { return 
 	 (t == this.substring(0, t.length)); } else { return (t.toLowerCase() 
Index: /MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js
===================================================================
--- /MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js	(revision 798)
+++ /MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js	(revision 799)
@@ -221,7 +221,7 @@
 Query.prototype.render = function () {
 	var x = "<div id='" + this.listid + "' class='query_wrapper ui-widget' ><div class='query_header ui-widget-header ui-state-default ui-corner-top'>" +
-	"<span class='cmd cmd_del'> </span><span class='cmd cmd_get'></span><span class='query_id'>" +
-	this.listid + "</span> <span class='query'>" +
-	this.getcollectiontext("name") + ": " + Query.queryliststring(this.squery, this.query) + "</span><span class='cmd cmd_save'></span><span class='cmd cmd_resubmit'></span></div>" +		
+	"<span class='cmd cmd_get'></span><span class='cmd cmd_save'></span><span class='query_id'>" +
+	this.listid + "</span>: <span class='query'>" +
+	this.getcollectiontext("name") + Query.queryliststring(this.squery, this.query) + "</span><span class='cmd cmd_del'> </span></div>" +		
 			"<div class='result ui-widget-content ui-corner-bottom'></div></div>";
 	addToQuerylist(x);	
@@ -243,10 +243,10 @@
 					// get.show();
 					
-					var result_header = $(this).children('.result_header');
+					var result_header = $(this).children('.result-header');
 					
 					var q_header;
 					q_header = $(this).parent().find('.query_header');					
 					q_header.append(result_header);					
-					q_header.find('.reload').click(function() {
+					q_header.find('.cmd_reload').click(function() {
 						var qid = $(this).closest('.query_wrapper').attr("id");
 						queryset.resubmit(qid);
@@ -272,4 +272,10 @@
 	notifyUser("resubmitting query:" +  uri);
 	
+	var get = $(this).parent().find('.cmd_up, .cmd_down');				
+	get.addClass('cmd_get');
+	get.removeClass('cmd_up');
+	get.removeClass('cmd_down');
+	// get.show();	
+
 	$('#' + qid ).children('.result').children().remove();
 	$('#' + qid ).children('.result').load( uri, function() {
Index: /MDService2/trunk/MDService2/WebContent/static/welcome.xml
===================================================================
--- /MDService2/trunk/MDService2/WebContent/static/welcome.xml	(revision 798)
+++ /MDService2/trunk/MDService2/WebContent/static/welcome.xml	(revision 799)
@@ -2,7 +2,6 @@
 <div id="welcome">
 
-<h2>Welcome to CLARIN Metadata Service - the gate to CLARIN Metadata Repository</h2>
-<p>Metadata Service is the user-interface for exploring the CMDRepository.
-where you can:
+<h3>Welcome to CLARIN Metadata Service the gate to CLARIN Metadata Repository</h3>
+<p>Metadata Service is the user-interface for exploring the CMDRepository. Yes, you can:
  <ul>
 	<li>simply search</li>
Index: /MDService2/trunk/MDService2/WebContent/style/cmds-ui.css
===================================================================
--- /MDService2/trunk/MDService2/WebContent/style/cmds-ui.css	(revision 798)
+++ /MDService2/trunk/MDService2/WebContent/style/cmds-ui.css	(revision 799)
@@ -9,4 +9,5 @@
 #notify {max-width: 400px; position: relative; overflow: auto; height: 40px;}
 #user {text-align: right;}
+#welcome {max-width: 600px; padding: 10px;}
 
 /* ******************** */
@@ -14,4 +15,5 @@
 body { font-size: 12px;}
 #site-name { font-family: Helvetica, Tahoma, Verdana, sans-serif; font-size: 24px; color: #014172; /* #040288 #666699; */ display:inline; padding-left: 20px; position:absolute; top:24px}
+#welcome h3 { color: #014172;}
 
 .note { font-size: 0.9em; color: #9999aa; }
@@ -43,5 +45,5 @@
 
 table.show { border: 1px solid #A6C9E2; }
-table.show, table.show table, table.show td {	border: 1px solid #A6C9E2;	border-collapse: collapse; }
+table.show, table.show table, table.show td {	border: 1px solid #A6C9E2;	border-collapse: collapse; vertical-align: top; }
 
 
@@ -98,4 +100,8 @@
 .value_input { width:32%; }
 .sc_cmds { }
+.paging-input { width: 3em; text-align: right; height: 1em;}
+
+.result-header { float: right; }
+
  
  .sc-wrapper .index-context { display: none; border: 1px solid #A6C9E2;}
@@ -121,13 +127,16 @@
 .cmd_add_and { background-image: url("imgs/icon_add_and.png");}
 .cmd_add_or { background-image: url("imgs/icon_add_or.png");}
-.cmd_columns { background-image: url("imgs/icon_cols.png");}
+.cmd_columns { background-image: url("imgs/cdb-icon-columns.png");}
 .cmd_del { 	background-image: url("imgs/cdb-icon-del.png");}
-.cmd_detail { background-image: url("imgs/icon_detail_10.png");}
-.cmd_down {	background-image: url("imgs/icon_down.png"); }
-.cmd_filter { background-image: url("imgs/icon_filter_10.png"); }
+.cmd_detail { background-image: url("imgs/cdb-icon-detail.png");}
+.cmd_down {	background-image: url("imgs/cdb-icon-down.png"); }
+.cmd_filter { background-image: url("imgs/cdb-icon-filter.png"); }
 .cmd_get { background-image: url("imgs/icon_get.gif");}
 .cmd_load {	background-image: url("imgs/cdb-icon-load.png");}
+.cmd_reload {	background-image: url("imgs/cdb-icon-load.png");}
 .cmd_resubmit {	background-image: url("imgs/cdb-icon-.png");}
-.cmd_save { background-image: url("imgs/icon_filter_10.png");}
-.cmd_sc_delete { background-image: url("imgs/icon_delete.png");}
-.cmd_up { background-image: url("imgs/icon_up.png");}
+.cmd_save { background-image: url("imgs/cdb-icon-save.png");}
+.cmd_sc_delete { background-image: url("imgs/cdb-icon-del.png");}
+.cmd_up { background-image: url("imgs/cdb-icon-up.png");}
+.cmd_prev { background-image: url("imgs/cdb-icon-prev.png");}
+.cmd_next { background-image: url("imgs/cdb-icon-next.png");}
Index: /MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/DCRProxyAction.java
===================================================================
--- /MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/DCRProxyAction.java	(revision 798)
+++ /MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/DCRProxyAction.java	(revision 799)
@@ -135,7 +135,9 @@
 
 		InputStream resultStream = null; 
-		// if no arguments  - get the local-config file
-		if ((getQ()==null || getQ().equals("")) && (getActionkey().equals(DATCATS))) {
-			resultStream = this.getClass().getClassLoader().getResourceAsStream(Admin.getConfig().getProperty("datcats.file"));		
+		// if no arguments  - get the local-config file 
+		// FIXME: although this should be competence of TermsProxyAction
+		if ((getQ().equals(ALL) || getQ()==null || getQ().equals("")) && (getActionkey().equals(DATCATS))) {
+			Admin.notifyUser("serving terms.file:" + Admin.getConfig().getProperty("terms.file"));
+			resultStream = this.getClass().getClassLoader().getResourceAsStream(Admin.getConfig().getProperty("terms.file"));
 		} else {
 		
Index: /MDService2/trunk/MDService2/src/xsl/mdset2view.xsl
===================================================================
--- /MDService2/trunk/MDService2/src/xsl/mdset2view.xsl	(revision 798)
+++ /MDService2/trunk/MDService2/src/xsl/mdset2view.xsl	(revision 799)
@@ -118,9 +118,17 @@
     -->
 <xsl:template name="header">
-	<div class="result_header" >
+	<div class="result-header" >
 	<xsl:attribute name="max_value"><xsl:value-of select="numberOfRecords" /></xsl:attribute>
-	<span class="label" >query:</span><span class="value"><xsl:value-of select="echoedSearchRetrieveRequest" /></span>;
-	<span class="label" >hitcount:</span><span class="value hilight"><xsl:value-of select="numberOfRecords" /></span>;
-	<span class="label" >showing:</span><span class="value"><xsl:value-of select="diagnostics" /></span>;
+	<xsl:variable name="cnt_hits" select="number(diagnostics)" />	
+	<span class="label" >hits: </span><span class="value hilight"><xsl:value-of select="numberOfRecords" /></span>;
+	<span class="label" >from:</span><span><input type="text" class="value start_record paging-input"><xsl:attribute name="value">
+    <xsl:value-of select="$startRecord"/>
+  </xsl:attribute>
+	</input></span>
+	<span class="label" >max:</span><span><input type="text" class="value maximum_records paging-input" ><xsl:attribute name="value">
+    <xsl:value-of select="if(number($cnt_hits) &lt; number($maximumRecords)) then $cnt_hits else $maximumRecords"/>    
+  </xsl:attribute></input></span>
+  <span class="cmd cmd_reload" />
+<!--	<button class="reload">reload</button>-->
 	<span class="cmd cmd_prev">	
 	<xsl:choose>
@@ -137,16 +145,10 @@
 		</xsl:choose>
 	</span>
-	<span class="label" >startRecord:</span><span><input type="text" size="5" class="value start_record"><xsl:attribute name="value">
-    <xsl:value-of select="$startRecord"/>
-  </xsl:attribute>
-	</input></span>
-	<span class="label" >maximumRecords:</span><span><input type="text" size="5" class="value maximum_records" ><xsl:attribute name="value">
-    <xsl:value-of select="$maximumRecords"/>
-  </xsl:attribute></input></span>
-	<button class="reload">reload</button>
     </div>
+        <div class="note" ><span class="label" >echo: </span><span class="value"><xsl:value-of select="echoedSearchRetrieveRequest" /></span>;</div>
 </xsl:template>	
 
 <xsl:template match="records" mode="table">
+    
 	<table class="show">		
 		<thead><tr><th>pos</th>
@@ -176,5 +178,7 @@
 				<a href="{concat('record/htmldetail/', encode-for-uri(replace(.//MdSelfLink,'/','_')))}" >
 						<xsl:value-of select="position()" />
-				</a>				
+				</a>
+				<span class="cmd cmd_detail" ></span>				
+						
 				</xsl:when>
 				<xsl:otherwise><xsl:value-of select="position()" /></xsl:otherwise>
Index: /MDService2/trunk/MDService2/src/xsl/model2matrix.xsl
===================================================================
--- /MDService2/trunk/MDService2/src/xsl/model2matrix.xsl	(revision 798)
+++ /MDService2/trunk/MDService2/src/xsl/model2matrix.xsl	(revision 799)
@@ -289,4 +289,5 @@
 </xsl:function>
 
+<!--  obsoleted?!  -->
 <xsl:function name="my:pick" >
 	<xsl:param name="partial_result" />
@@ -296,6 +297,6 @@
 			<xsl:when test="count($set/*) &gt; 1" >
 			<xsl:message>count-rest:<xsl:value-of select="count($set/*[position()&gt; 1])" /></xsl:message>					  
-				<xsl:variable  name="pickone" select="$set/*[1]/tokenize(.,' ')[last()]" />
-<!--				<xsl:variable  name="rest"  select="my:pick($pickone  $set/*[position()&gt; 1]))" />
+<!--					<xsl:variable  name="pickone" select="$set/*[1]/tokenize(.,' ')[last()]" />
+			<xsl:variable  name="rest"  select="my:pick($pickone  $set/*[position()&gt; 1]))" />
 				
 					<xsl:message>rest:<xsl:value-of select="count($rest)" /></xsl:message>
Index: /MDService2/trunk/MDService2/src/xsl/params.xsl
===================================================================
--- /MDService2/trunk/MDService2/src/xsl/params.xsl	(revision 798)
+++ /MDService2/trunk/MDService2/src/xsl/params.xsl	(revision 799)
@@ -17,5 +17,5 @@
 	
 	
-	<xsl:param name="model_matrix_uri" select="'http://localhost:8080/MDService2/model/matrix?q='" />
+	<xsl:param name="model_matrix_uri" select="'http://localhost:8080/MDService2/model/matrix?maxdepth=8&amp;q='" />
 	<xsl:param name="datcats_terms_uri" select="'http://localhost:8080/MDService2/datcats/terms/?q='" />
 	<xsl:param name="terms_setup_uri" select="'http://localhost:8080/MDService2/datcats/xml/?q='" />
Index: /MDService2/trunk/MDService2/src/xsl/terms2view.xsl
===================================================================
--- /MDService2/trunk/MDService2/src/xsl/terms2view.xsl	(revision 798)
+++ /MDService2/trunk/MDService2/src/xsl/terms2view.xsl	(revision 799)
@@ -121,6 +121,6 @@
 <xsl:template match="Term" mode="list" >
 		<!--  <xsl:variable name="translated_path" select="translate(replace(@path,'//',''),'/','.')" /> -->
-				<li><div class="cmds-elem-plus"><span class="detail-caller"><a href="{concat($detail_model_prefix,@context)}" >
-					<xsl:value-of select="@name"/></a></span>
+				<li><div class="cmds-elem-plus"><span class="detail-caller"><!-- <a href="{concat($detail_model_prefix,@context)}" >  -->
+					<xsl:value-of select="@name"/></span>
 					<span class="note">|<xsl:value-of select="@count"/>/<xsl:value-of select="@count_text"/>/<xsl:value-of select="@count_distinct_text"/>|</span>					
 					<span class="data comppath"><xsl:value-of select="@path" /></span>		 
@@ -204,6 +204,7 @@
 <xsl:template match="Termset" mode="select">
 	
-	<xsl:variable name="count" select="Term/@count" />	
-	<option value="{@id}" ><xsl:value-of select="@name" /> |<xsl:value-of select="$count" />|</option>					
+	<xsl:variable name="count" select="if (Term/@count) then concat(' |',Term/@count,'|') else '' " />
+	<xsl:variable name="call-value" select="if (@type='model') then @name else @id" />
+	<option value="{$call-value}" ><xsl:value-of select="@name" /><xsl:value-of select="$count" /></option>					
 </xsl:template>
 
