<%@ page language="java" buffer="100kb" errorPage="/common/error.jsp"%>

<%@ page import="vkc.view.*" %>
<%@ page import="org.apache.struts.Globals" %>

<%@ taglib uri="struts-bean"  prefix="bean"  %>
<%@ taglib uri="struts-html"  prefix="html"  %>
<%@ taglib uri="struts-logic" prefix="logic" %>
<%@ taglib uri="vkc-taglib"   prefix="vkc"   %>

<vkc:checkLogin />
<vkc:init/>
<html:html locale="true">
<head>

    <meta http-equiv="content-type"  content="text/html; charset=iso-8859-1" />

	<vkc:cssinclude />

    <script type="text/javascript" src="<vkc:rewrite page='/common/utils.js'/>"></script>
    <script type="text/javascript" src="<vkc:rewrite page='/common/calendar.js'/>"></script>
    <script type="text/javascript" src="<vkc:rewrite page='/common/overlib/overlib.js'/>"><!-- overLIB (c) Erik Bosrup --></script>
    <script type="text/javascript" src="<vkc:rewrite page='/common/overlib/overlib_positioncap.js'/>"></script>

    <script type="text/javascript">
    window.name = "MAINVIEW";
    var associatedTabId = <%=TabId.SEARCH_TAB%>;
    var currentCalendar = null;
    var windowOpen = null;

    function init(){
        var tabView = getTabView();
        var tabViewForm = tabView.document.forms[0];

        if (tabView && tabView.systemviewtype == "categoryview" && tabView.selectedTabId != associatedTabId) {
            tabView.location.replace("<%=ctxPath%>/vkcTabView.do?selectedTabId=<%=TabId.SEARCH_TAB%>"
          						   + "&lastCategoryId=" + tabViewForm.lastCategoryId.value
          						   + "&lastFunctionalId=" + tabViewForm.lastFunctionalId.value
          						   + "&lastProjectId=" + tabViewForm.lastProjectId.value);
        }

        setAnchor();
    }

    function setAnchor() {
        <logic:present parameter="anchor">
            <bean:parameter id="anchor2" name="anchor"/>
            this.location.hash = '<%=anchor2%>';
        </logic:present>
    }

    function openUserInfoWindow( id ) {
        var w = 800;
        var h = 600;
        var leftPosition = screen.width/2  - w/2;
        var topPosition  = screen.height/2 - h/2;
        var settings ='height=' + h + ', width=' + w + ', top=' + topPosition + ', left=' + leftPosition;
        settings += ',scrollbars=yes,resizable';
        settings += ',toolbar=no, location=no, directories=no, status=true, menubar=no';
        var win = window.open( '<vkc:rewrite page="/displayUserInfo.do"/>?userId=' + id, 'USERINFO_MAINVIEW', settings );
        win.focus();
    }

    function showExplorer() {
        var w = 200;
        var h = 600;
        var leftPosition = screen.width/2  - w/2;
        var topPosition  = screen.height/2 - h/2;
        var settings ='height=' + h + ', width=' + w + ', top=' + topPosition + ', left=' + leftPosition;
        settings += ',scrollbars=yes,resizable';
        settings += ',toolbar=no, location=no, directories=no, status=true, menubar=no';
        windowOpen = window.open( '<vkc:rewrite page="/explorerTreeView.do"/>', 'EXPLORER_MAINVIEW', settings );
        windowOpen.focus();
        return false;
    }

    function changePage(id) {
        var form = document.forms[0];
        form.currentResultPageId.value = id;

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.change.page=true";
        } else {
          form.action = form.action + "&action.change.page=true";
        }

        form.submit();
    }

    function setCategoryId(id) {
        var form = document.forms[0];
        form.selectedCategoryId.value = id;

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.change.category=true";
        } else {
          form.action = form.action + "&action.change.category=true";
        }

        windowOpen = null;
        form.submit();
    }

    function showDocuments(id) {
        var form = document.forms[0];
        form.selectedId.value = id;

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.show.documents=true";
        } else {
          form.action = form.action + "&action.show.documents=true";
        }

        form.submit();
    }

    function hideDocuments(id) {
        var form = document.forms[0];
        form.selectedId.value = id;

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.hide.documents=true";
        } else {
          form.action = form.action + "&action.hide.documents=true";
        }

        form.submit();
    }

    function showDocumentDetails(id) {
        var form = document.forms[0];
        form.selectedId.value = id;

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.show.document.details=true";
        } else {
          form.action = form.action + "&action.show.document.details=true";
        }

        form.submit();
    }

    function hideDocumentDetails(id) {
        var form = document.forms[0];
        form.selectedId.value = id;

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.hide.document.details=true";
        } else {
          form.action = form.action + "&action.hide.document.details=true";
        }

        form.submit();
    }

    function showHelpText() {
    	var text = '<vkc:message javascript="true" filter="false" key="vkc.search.help"/>';
        
        return overlib( text, STICKY, SCROLLBARS, MOUSEOFF, HEIGHT, 250, WIDTH, 600, OFFSETX, 0, OFFSETY, 20, CENTER );
    }

    function unloadPage() {
        if ( currentCalendar != null ) {
              hideCalendar();
        }

        if ( windowOpen != null ) {
            windowOpen.close();
        }
    }
    </script>
</head>
<body onload="javascript:init();" onUnload="unloadPage();">
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<html:form action="/searchDocuments" method="post">
<bean:define id="form" name="searchDocumentsForm" scope="request" type="vkc.search.form.SearchDocumentsForm" toScope="request"/>
<bean:define id="pageCount" name="form" property="pageCount"/>
<bean:define id="hitsCount" name="form" property="hitsCount"/>

<html:hidden property="selectedCategoryId"/>
<html:hidden property="currentResultPageId"/>
<html:hidden property="selectedId" />
<logic:iterate id="id" name="form" property="showDocumentDetails" type="java.lang.Integer">
  <html:hidden property="showDocumentDetails" name="form" value='<%=String.valueOf(id.toString())%>'/>
</logic:iterate>
<logic:iterate id="did" name="form" property="showDocuments" type="java.lang.Integer">
  <html:hidden property="showDocuments" name="form" value='<%=String.valueOf(did.toString())%>'/>
</logic:iterate>

<bean:define id="userDocumentViewSettings" name="documentViewSettings" type="vkc.view.bean.DocumentViewSettings" toScope="request" />

<%-- BEGINN: Keine Treffer gefunden --%>
<logic:equal name="form" property="searching" value="true">
<logic:equal name="hitsCount" value="0">
<table width="100%" cellspacing="1" cellpadding="5" bgcolor="#e0e0e0" border="0">
  <tr>
    <td width="100%" align="center"><font color="red"><span style="font-style:italic"><vkc:message key="vkc.search.noHitsFound" /></span></font></td>
    <logic:equal name="user" property="guestUser" value="false">
    <td><vkc:button tabindex="1" property="action.register.query" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.search.button.registerQuery"/></vkc:button></td>
    </logic:equal>
  </tr>
</table>
</logic:equal>
</logic:equal>
<%-- ENDE: Keine Treffer gefunden --%>
<%-- Keine Suchergebnisse vorhanden --%>
<table width="100%" cellspacing="1" cellpadding="2" border="0">
  <tr>
    <td width="100%" align="center">
      <table width="100%" align="center" cellspacing="0" cellpadding="2" border="0">
        <tr>
          <td align="left" nowrap="nowrap">
            <table cellspacing="0" cellpadding="2" border="0">
              <tr>
                <td align="left"> 
                 <b><vkc:message key="vkc.search.title" /></b>
                </td>
                <td align="rigth">
                  <vkc:img page="/templates/${template.name}/gfx/help.bmp" onmouseover='return showHelpText();' onmouseout="return nd();" width="16" height="16" border="0"/>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr><td><hr width="100%" size="1" noshade="noshade"/></td></tr>
        <tr>
          <td nowrap="nowrap">
            <table width="100%" cellspacing="0" cellpadding="2" border="0">
              <tr>
                <td nowrap="nowrap">
                  <table cellspacing="0" cellpadding="2" border="0">
                    <logic:present name="<%=Globals.ERROR_KEY%>">
                    <tr><td align="left" nowrap="nowrap" colspan="5"><font color="red"><b><vkc:errors/></b></font></td></tr>
                    </logic:present>
                    <tr>
                      <td nowrap="nowrap"><vkc:message key="vkc.search.searchFor"/></td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.searchInAnyField"/></b></td>
                      <td width="100%"><vkc:text property="searchInAnyField" style="width:99%;"/></td>
                      <td nowrap="nowrap"><vkc:button tabindex="0" property="action.searchDocuments.do" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.search.button.search"/></vkc:button></td>
                    </tr>
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.searchInFullText"/></b></td>
                      <td width="100%"><vkc:text property="searchInFullText" style="width:99%;"/></td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.searchForDynaAttributeNames"/></b></td>
                      <td width="100%"><vkc:text property="searchForDynaAttributeNames" style="width:99%;"/></td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.searchForDynaAttributeValues"/></b></td>
                      <td width="100%"><vkc:text property="searchForDynaAttributeValues" style="width:99%;"/></td>
                      <td nowrap="nowrap">&nbsp;</td>
                     </tr>
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.searchForFilename"/></b></td>
                      <td width="100%"><vkc:text property="searchForFilename" style="width:99%;"/></td>
                      <td nowrap="nowrap">&nbsp;</td>
                     </tr>
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.searchForTitle"/></b></td>
                      <td width="100%"><vkc:text property="searchForTitle" style="width:99%;"/></td>
                      <td nowrap="nowrap">&nbsp;</td>
                     </tr>
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.searchForKeywords"/></b></td>
                      <td width="100%"><vkc:text property="searchForKeywords" style="width:99%;"/></td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.searchForDescription"/></b></td>
                      <td width="100%"><vkc:text property="searchForDescription" style="width:99%;"/></td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.searchForAuthor"/></b></td>
                      <td width="100%"><vkc:text property="searchForAuthor" style="width:99%;"/></td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.searchForPublisher"/></b></td>
                      <td width="100%"><vkc:text property="searchForPublisher" style="width:99%;"/></td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>

                    <logic:notEmpty name="form" property="addDocAttributes">
                    <logic:iterate id="fieldName" indexId="fieldCtr" name="form" property="addDocAttributeKeys" type="java.lang.String">
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.for"/>&nbsp;<vkc:write name="form" property='<%= String.valueOf( "attributeKeyName(" + fieldName + ")" ) %>'/></b></td>
                      <td width="100%"><vkc:text name="form" property='<%= String.valueOf( "addDocAttrValue(" + fieldName + ")" ) %>' style="width:99%;"/></td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    </logic:iterate>
                    </logic:notEmpty>

                    <logic:equal name="categorySettings" property="showCreationDate" value="true">
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.for"/>&nbsp;<vkc:message key="vkc.search.creationdate"/>&nbsp;<vkc:message key="vkc.search.from"/></b></td>
                      <td width="100%">
                        <table cellpadding="0" cellspacing="0" border="0">
                          <tr>
                            <td nowrap="nowrap"><html:text property="searchForCreationDateFrom" maxlength="10" size="10" styleClass="dateField"/></td>
                            <td nowrap="nowrap"><vkc:calendarbutton buttonName="btn_searchForCreationDateFrom" /></td>
                            <td nowrap="nowrap">&nbsp;[<vkc:message key="vkc.profile.date_format"/>]</td>
                            <td nowrap="nowrap">&nbsp;&nbsp;&nbsp;</td>
                            <td nowrap="nowrap"><b><vkc:message key="vkc.search.until"/></b></td>
                            <td nowrap="nowrap">&nbsp;</td>
                            <td nowrap="nowrap"><html:text property="searchForCreationDateUntil" maxlength="10" size="10" styleClass="dateField"/></td>
                            <td nowrap="nowrap"><vkc:calendarbutton buttonName="btn_searchForCreationDateUntil" /></td>
                            <td nowrap="nowrap">&nbsp;[<vkc:message key="vkc.profile.date_format"/>]</td>
                          </tr>
                        </table>
                      </td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    </logic:equal>

                    <logic:equal name="categorySettings" property="showDocumentClass" value="true">
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.for"/>&nbsp;<vkc:message key="vkc.search.document.class"/></b></td>
                      <td width="100%">
                        <html:select name="form" property="selectedDocClassId">
                          <html:option value="-1">&nbsp;</html:option>
                          <html:option value="*"><vkc:message key="vkc.search.docClassId.all" /></html:option>
                          <logic:iterate id="documentClass" name="form" property="documentClasses" type="vkc.db.entities.VKCDocumentClass">
                          <html:option value="<%=String.valueOf( documentClass.getDocClassId() )%>"><vkc:message name="documentClass" property="nameKey"/></html:option>
                          </logic:iterate>
                        </html:select>
                      </td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    </logic:equal>

                    <logic:equal name="categorySettings" property="showDocumentStatus" value="true">
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.for"/>&nbsp;<vkc:message key="vkc.search.document.status"/></b></td>
                      <td width="100%">
                        <html:select name="form" property="selectedDocStatusId">
                          <html:option value="-1">&nbsp;</html:option>
                          <html:option value="*"><vkc:message key="vkc.search.docStatusId.all" /></html:option>
                          <logic:iterate id="documentStatus" name="form" property="documentStatus" type="vkc.db.entities.VKCDocumentStatus">
                          <html:option value="<%=String.valueOf( documentStatus.getStatus() )%>"><vkc:message name="documentStatus" property="descriptionKey"/></html:option>
                          </logic:iterate>
                        </html:select>
                      </td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    </logic:equal>

                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td align="left" colspan="2"><vkc:message key="vkc.search.keyconnection"/></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td nowrap="nowrap">
            <table width="100%" cellspacing="0" cellpadding="2" border="0">
              <tr>
                <td nowrap="nowrap">
                  <table cellspacing="0" cellpadding="2" border="0">
                    <tr>
                      <td nowrap="nowrap"><vkc:message key="vkc.search.restrict"/></td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.for"/>&nbsp;<vkc:message key="vkc.search.publication"/>&nbsp;<vkc:message key="vkc.search.from"/></b></td>
                      <td width="100%">
                        <table cellpadding="0" cellspacing="0" border="0">
                          <tr>
                            <td nowrap="nowrap"><html:text property="validFrom" maxlength="10" size="10" styleClass="dateField"/></td>
                            <td nowrap="nowrap"><vkc:calendarbutton buttonName="btn_validFrom" /></td>
                            <td nowrap="nowrap">&nbsp;[<vkc:message key="vkc.profile.date_format"/>]</td>
                            <td nowrap="nowrap">&nbsp;&nbsp;&nbsp;</td>
                            <td nowrap="nowrap"><b><vkc:message key="vkc.search.until"/></b></td>
                            <td nowrap="nowrap">&nbsp;</td>
                            <td nowrap="nowrap"><html:text property="validUntil" maxlength="10" size="10" styleClass="dateField"/></td>
                            <td nowrap="nowrap"><vkc:calendarbutton buttonName="btn_validUntil" /></td>
                            <td nowrap="nowrap">&nbsp;[<vkc:message key="vkc.profile.date_format"/>]</td>
                          </tr>
                        </table>
                      </td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.to"/>&nbsp;<vkc:message key="vkc.search.categorypath"/></b></td>
                      <td width="100%">
                        <table width="100%" cellpadding="0" cellspacing="0" border="0">
                          <tr>
                            <td nowrap="nowrap"><vkc:image page="/templates/${template.name}/gfx/navigator.gif" property="btn_explorer" onclick="this.blur();return showExplorer();" titleKey="vkc.string.show.explorer"/></td>
                            <td nowrap="nowrap">&nbsp;</td>
                            <td width="100%"><vkc:write name="form" property="categoryPath"/></td>
                          </tr>
                        </table>
                      </td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.for"/>&nbsp;<vkc:message key="vkc.search.searchResultLimitation"/></b></td>
                      <td width="100%">
                          <bean:define id="documentTypes" name="form" property="documentTypes"/>
                        <html:select property="selectedSearchResultLimitation" size="1">
                          <html:option value="*"><vkc:message key="vkc.search.searchResultLimitation.noLimitation" /></html:option>
                            <vkc:options collection="documentTypes" property="extension" labelProperty="extensionLabel"/>
                        </html:select>
                      </td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    <tr>
                      <td colspan="4">&nbsp;</td>
                    </tr>
                    <tr>
                      <td nowrap="nowrap"><vkc:message key="vkc.search.display"/></td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.for"/>&nbsp;<vkc:message key="vkc.search.sortResults"/></b></td>
                      <td width="100%">
                        <html:select property="selectedSortResults" size="1">
                          <html:option value="1"><vkc:message key="vkc.search.sortResults.descendingByScore" /></html:option>
                          <html:option value="0"><vkc:message key="vkc.search.sortResults.ascendingByScore" /></html:option>
        				  <logic:equal name="categorySettings" property="showCreationDate" value="true">
			              <html:option value="7"><vkc:message key="vkc.search.sortResults.descendingByCreationDate" /></html:option>
			              <html:option value="6"><vkc:message key="vkc.search.sortResults.ascendingByCreationDate" /></html:option>
        				  </logic:equal>
                          <html:option value="3"><vkc:message key="vkc.search.sortResults.descendingByPublishingDate" /></html:option>
                          <html:option value="2"><vkc:message key="vkc.search.sortResults.ascendingByPublishingDate" /></html:option>
                          <html:option value="5"><vkc:message key="vkc.search.sortResults.descendingByAuthor" /></html:option>
                          <html:option value="4"><vkc:message key="vkc.search.sortResults.ascendingByAuthor" /></html:option>
                          <html:option value="9"><vkc:message key="vkc.search.sortResults.descendingByPublisher" /></html:option>
                          <html:option value="8"><vkc:message key="vkc.search.sortResults.ascendingByPublisher" /></html:option>
                        </html:select>
                      </td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                    <tr>
                      <td nowrap="nowrap">&nbsp;</td>
                      <td nowrap="nowrap"><b><vkc:message key="vkc.search.for"/>&nbsp;<vkc:message key="vkc.search.numberOfResultsPerPage"/></b></td>
                      <td width="100%">
                        <html:select property="selectedNumberOfResultsPerPage" size="1">
                          <html:option value="5"><vkc:message key="vkc.search.numberOfResultsPerPage.5" /></html:option>
                          <html:option value="10"><vkc:message key="vkc.search.numberOfResultsPerPage.10Hits" /></html:option>
                          <html:option value="20"><vkc:message key="vkc.search.numberOfResultsPerPage.20Hits" /></html:option>
                          <html:option value="30"><vkc:message key="vkc.search.numberOfResultsPerPage.30Hits" /></html:option>
                          <html:option value="40"><vkc:message key="vkc.search.numberOfResultsPerPage.40Hits" /></html:option>
                          <html:option value="50"><vkc:message key="vkc.search.numberOfResultsPerPage.50Hits" /></html:option>
                        </html:select>
                      </td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr><td><hr width="100%" size="1" noshade="noshade"/></td></tr>
      </table>
    </td>
  </tr>
</table>
<%-- ENDE: Keine Suchergebnisse vorhanden --%>
<a name="results"></a>
<%-- BEGINN: Suchergebnisse vorhanden - Scroll-Leiste --%>
<logic:greaterThan name="hitsCount" value="0">
<table width="100%" cellspacing="1" cellpadding="4" border="0">
  <tr>
    <td class="search_block">
      <table width="100%" border="0">
        <tr>
          <td>
            <table width="100%" border="0" class="search_header">
              <tr>
                <td width="100%" align="center"><font style="font-size:10pt;font-style:italic;">
                  <vkc:write name="hitsCount"/>&nbsp;<vkc:message key="vkc.search.hitsFound" />,&nbsp;<vkc:message key="vkc.search.searchTime" />&nbsp;
                  <vkc:write name="form" property="searchTime"/>s</font>
                </td>
                <logic:equal name="user" property="guestUser" value="false">
                <td align="right"><vkc:button property="action.register.query" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.search.button.registerQuery"/></vkc:button></td>
                </logic:equal>
              </tr>
            </table>
          </td>
        </tr>
        <logic:greaterThan name="pageCount" value="1">
        <tr>
          <td align="center">
            <vkc:message key="vkc.search.resultPage" />&nbsp;
            <bean:define id="selectedPageId" name="form" property="currentResultPageId" type="java.lang.Integer"/>

            <logic:greaterThan name="selectedPageId" value="1">
            <bean:define id="previousPageId" name="form" property="previousPageId" type="java.lang.Integer"/>
            <vkc:link href='<%= "javascript:changePage(" + previousPageId + ");" %>'>
              <span style="text-decoration:underline"><vkc:message key="vkc.search.previousPage"/></span>
            </vkc:link>&nbsp;
            </logic:greaterThan>

            <logic:iterate id="pageItem" name="form" property="pagesIndex">
            <logic:notEqual name="pageItem" value='<%= String.valueOf( selectedPageId.toString() ) %>'>
            <vkc:link href='<%= "javascript:changePage(" + pageItem + ");" %>'>
              <span style="text-decoration:underline"><vkc:write name="pageItem"/></span>
            </vkc:link>&nbsp;
            </logic:notEqual>

            <logic:equal name="pageItem" value='<%= String.valueOf( selectedPageId.toString() ) %>'>
            <vkc:write name="pageItem" />&nbsp;
            </logic:equal>
            </logic:iterate>

            <logic:lessThan name="selectedPageId" value="<%= String.valueOf( pageCount.toString() ) %>">
            <bean:define id="nextPageId" name="form" property="nextPageId" type="java.lang.Integer"/>
            <vkc:link href='<%= "javascript:changePage(" + nextPageId + ");" %>'>
                <span style="text-decoration:underline"><vkc:message key="vkc.search.nextPage"/></span>
            </vkc:link>
            </logic:lessThan>
          </td>
        </tr>
        </logic:greaterThan>
      </table>
    </td>
  </tr>
</table>
</logic:greaterThan>
<%-- ENDE: Suchergebnisse vorhanden - Scroll-Leiste --%>

<%--  BEGINN: Darstellung der Suchergebnisse --%>
<table width="100%" align="center" cellspacing="0" cellpadding="0" border="0">
  <logic:greaterThan name="hitsCount" value="0">
  <bean:define id="startIndex" name="form" property="startIndex" type="java.lang.Integer"/>
  <logic:iterate id="result" indexId="ctr" name="form" property="results" type="vkc.search.SearchResultEntry">
  <bean:define id="doc" name="result" property="toVKCDocument" type="vkc.db.entities.VKCDocument"/>
  <bean:define id="documentId" name="doc" property="documentId" type="java.lang.Integer"/>

    <logic:equal name="form" property='<%= "showDocs[" + documentId + "]" %>' value="false">
      <tr>
	    <td width="1" align="left" valign="top"><vkc:link href='<%= "javascript:showDocuments(" + documentId + ");" %>'><vkc:img page="/templates/${template.name}/gfx/plus-big.gif" border="0" titleKey="vkc.tooltip.show.documents"/></vkc:link></td>
	    <td width="1" align="left" valign="top"><vkc:img page='<%="/templates/" + template + doc.getDocumentIcon()%>' altKey='vkc.document' border='0'/></td>
	    <td width="100%" align="left" valign="top">
		  <a name='<%="doc" + doc.getDocumentId()%>'></a>
	      <table width="100%" cellspacing="0" cellpadding="0" border="0">
	        <tr>
	          <td align="left" valign="top"><b>&nbsp;<vkc:message key="vkc.string.number"/>&nbsp;<%= startIndex.intValue() + ctr.intValue() + 1 %>:&nbsp;&nbsp;</b></td>
	          <td width="100%" align="left" valign="top">
	            <table cellspacing="0" cellpadding="0" border="0" valign="top">
	              <tr>
	                <td>
		              <logic:equal name="doc" property="note" value="true">
		              <span style="font-weight:bold;"><vkc:write name="doc" property="title"/></span>
		              </logic:equal>
		              <logic:equal name="doc" property="note" value="false">
		              <vkc:displaydocument name="doc" style="font-weight:bold;" target="_blank" ><vkc:write name="doc" property="title"/></vkc:displaydocument>
				      </logic:equal>
	                </td>
				    <logic:equal name="doc" property="editable" value="true">
				    <vkc:hasPermission entityName="doc" context="document" requiredPerm="w">
				    <script type="text/javascript">
				     var name = navigator.userAgent.toLowerCase()
						//InternetExplorer
					  var ie = (name.indexOf("msie")>-1)					  	
			          var opera = (name.indexOf("opera")>-1)			  	
			          if (ie && !opera){
	                  document.write('<td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="5"/></td>');
				      document.write('<td><vkc:displaydocument name="doc" editable="true" style="font-weight:normal;" target="_blank"><vkc:img page="/templates/${template.name}/gfx/editable.gif" border="0" titleKey="vkc.tooltip.documentedit"/></vkc:displaydocument></td>');
				    }
				    </script>
				    </vkc:hasPermission>
		            </logic:equal>
		          </tr>
		        </table>
	          </td>
	          <td align="right">[&nbsp;<vkc:message key="vkc.search.score"/>&nbsp;<vkc:write name="result" property="percent" />%&nbsp;]</td>
	        </tr>
	      </table>
	    </td>
      </tr>
    </logic:equal>

    <logic:equal name="form" property='<%= "showDocs[" + documentId + "]" %>' value="true">
      <tr>
	    <td width="1" valign="top"><vkc:link href='<%= "javascript:hideDocuments(" + documentId + ");" %>'><vkc:img page="/templates/${template.name}/gfx/minus-big.gif" border="0" titleKey="vkc.tooltip.hide.documents"/></vkc:link></td>
	    <td width="1" valign="top"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="24"/></td>
	    <td width="100%" valign="top">
		  <a name='<%="doc" + doc.getDocumentId()%>'></a>
	      <table width="100%" cellspacing="0" cellpadding="0" border="0">
	        <tr>
	          <td>
	            <table width="100%" cellspacing="0" cellpadding="0" border="0">
	              <tr>
	                <td>
	                  <table width="100%" cellspacing="0" cellpadding="0" border="0">
	                    <tbody>
	                      <tr class="color_doctitle">
	                        <td><b>&nbsp;<vkc:message key="vkc.string.number"/>&nbsp;<%= startIndex.intValue() + ctr.intValue() + 1 %>:&nbsp;&nbsp;</b></td>
	                        <logic:equal name="form" property='<%= "showDocDetails[" + documentId + "]" %>' value="false">
	                        <td><vkc:link href='<%= "javascript:showDocumentDetails(" + documentId + ");" %>'><vkc:img page="/templates/${template.name}/gfx/plus.gif" border="0" titleKey="vkc.tooltip.show.document.details"/></vkc:link></td>
	                        </logic:equal>
	
	                        <logic:equal name="form" property='<%= "showDocDetails[" + documentId + "]" %>' value="true">
	                        <td><vkc:link href='<%= "javascript:hideDocumentDetails(" + documentId + ");" %>'><vkc:img page="/templates/${template.name}/gfx/minus.gif" border="0" titleKey="vkc.tooltip.hide.document.details"/></vkc:link></td>
	                        </logic:equal>
	                        <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="4" height="10"/></td>
	                        <td><vkc:img page='<%="/templates/${template.name}" + doc.getDocumentIcon()%>' alt='' border='0'/></td>
	                        <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="5" height="10"/></td>
	                        <td width="100%" align="left"><b><vkc:write name="doc" property="title"/></b></td>
	                        <td nowrap="nowrap">[&nbsp;<vkc:message key="vkc.search.score"/>&nbsp;<vkc:write name="result" property="percent" />%&nbsp;]</td>
	                        <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="5" height="10"/></td>
	                        <td><vkc:img page="/templates/${template.name}/gfx/border.gif" alt="|" width="2" height="24"/></td>
	                        <td><a href="#top" onclick="this.blur();" onfocus="this.blur();"><vkc:img page="/templates/${template.name}/gfx/button-top.gif" border="0" alt="" titleKey="vkc.tooltip.gototop"/></a></td>
	                        <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="5" height="10"/></td>
	                      </tr>
	                    </tbody>
	                  </table>
	                </td>
	              </tr>
	
	              <bean:define id="displayCategoryPath" type="java.lang.String" value="true" toScope="request"/>
	              <bean:define id="document" name="doc" type="vkc.db.entities.VKCDocument" toScope="request" />
	      	      <bean:define id="currentUser" name="form" property="user" type="vkc.db.entities.VKCUser" toScope="request"/>
	
	              <logic:equal name="form" property='<%= "showDocDetails[" + documentId + "]" %>' value="true">
	              <bean:define id="documentViewSettings" name="documentViewSettings" property="fullviewDocumentViewSettings" type="vkc.view.bean.DocumentViewSettings" toScope="request" />
	              </logic:equal>
	              <logic:equal name="form" property='<%= "showDocDetails[" + documentId + "]" %>' value="false">
	              <bean:define id="documentViewSettings" name="userDocumentViewSettings" type="vkc.view.bean.DocumentViewSettings" toScope="request" />
	              </logic:equal>
	
    		      <jsp:include page='<%="/templates/" + template + "/common/DocumentView.jsp"%>'/>
	            </table>
	          </td>
	        </tr>
	      </table>
 	    </td>
      </tr>
    </logic:equal>
  </logic:iterate>
  </logic:greaterThan>
</table>
<%-- ENDE: Darstellung der Suchergebnisse --%>

<%-- BEGINN: Nochmal die Scroll-bar --%>
<logic:greaterThan name="hitsCount" value="0">
<table cellspacing="1" cellpadding="4" width="100%" border="0">
  <tr>
    <td class="search_block">
      <table width="100%" border="0">
        <tr>
          <td class="search_header" align="center"><font style="font-size:10pt;font-style:italic;">
            <vkc:write name="hitsCount"/>&nbsp;<vkc:message key="vkc.search.hitsFound" />,&nbsp;<vkc:message key="vkc.search.searchTime" />&nbsp;
            <vkc:write name="form" property="searchTime"/>s</font>
          </td>
        </tr>
        <logic:greaterThan name="pageCount" value="1">
        <tr>
          <td align="center">
            <vkc:message key="vkc.search.resultPage" />&nbsp;
            <bean:define id="selectedPageId" name="form" property="currentResultPageId" type="java.lang.Integer"/>

            <logic:greaterThan name="selectedPageId" value="1">
            <bean:define id="previousPageId" name="form" property="previousPageId" type="java.lang.Integer"/>
            <vkc:link href='<%= "javascript:changePage(" + previousPageId + ");" %>'>
              <span style="text-decoration:underline"><vkc:message key="vkc.search.previousPage"/></span>
            </vkc:link>&nbsp;
            </logic:greaterThan>

            <logic:iterate id="pageItem" name="form" property="pagesIndex">
            <logic:notEqual name="pageItem" value='<%= String.valueOf( selectedPageId.toString() ) %>'>
            <vkc:link href='<%= "javascript:changePage(" + pageItem + ");" %>'>
              <span style="text-decoration:underline"><vkc:write name="pageItem"/></span>
            </vkc:link>&nbsp;
            </logic:notEqual>

            <logic:equal name="pageItem" value='<%= String.valueOf( selectedPageId.toString() ) %>'>
            <vkc:write name="pageItem" />&nbsp;
            </logic:equal>
            </logic:iterate>

            <logic:lessThan name="selectedPageId" value="<%= String.valueOf( pageCount.toString() ) %>">
            <bean:define id="nextPageId" name="form" property="nextPageId" type="java.lang.Integer"/>
            <vkc:link href='<%= "javascript:changePage(" + nextPageId + ");" %>'>
                <span style="text-decoration:underline"><vkc:message key="vkc.search.nextPage"/></span>
            </vkc:link>
            </logic:lessThan>
          </td>
        </tr>
        </logic:greaterThan>
      </table>
    </td>
  </tr>
</table>
</logic:greaterThan>
<%-- ENDE: Nochmal die Scroll-bar --%>
</html:form>
</body>
</html:html>