<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="section.xsl"/>
    <xsl:output method="html" indent="yes" omit-xml-declaration="yes"/>
    <xsl:template match="/">
        <xsl:apply-templates select="ShowPage" mode="block">
            <xsl:with-param name="hide">
                <xsl:choose>
                    <xsl:when test="/ShowPage/@name[.='search' or .='day' or .='newpage' or .='newcomment' or .='newsel' or .='indexmap' or .='tree' or .='sessions']">
                        <xsl:text>new </xsl:text>
                    </xsl:when>
                    <xsl:when test="/ShowPage/@name[.='indexsel' or .= 'search' or .='day' or .='newpage' or .='newcomment']">
                        <xsl:text>map </xsl:text>
                    </xsl:when>
                    <xsl:when test="/ShowPage/@name[.='searchsel' or .='day' or .='newpage' or .='newcomment' or .='indexmap' or .='tree']">
                        <xsl:text>search </xsl:text>
                    </xsl:when>
                </xsl:choose>
                <xsl:if test="/ShowPage/@name[not(starts-with(.,'Error')) and . != 'sessions' and .!= '$Role$']">home </xsl:if>
                <xsl:text>next append delete move</xsl:text>
            </xsl:with-param>
        </xsl:apply-templates>
    </xsl:template>
    <xsl:template match="ShowPage" mode="Untergeordnet">

        <xsl:choose>
            <xsl:when test="@name='$Role$'">
                <xsl:apply-templates select="." mode="role"/>
            </xsl:when>
            <xsl:when test="@name='$User$'">
                <xsl:apply-templates select="." mode="user"/>
            </xsl:when>
            <xsl:when test="@name[.='indexmap' or .='indexsel' or .='tree' or .='move' or .='deltree']">
                <xsl:apply-templates select="." mode="map"/>
            </xsl:when>
            <xsl:when test="@name='todo' or @name='toread'">
                <xsl:apply-templates select="." mode="todo"/>
            </xsl:when>
            <xsl:when test="@name='sessions'">
                <xsl:apply-templates select="." mode="sessions"/>
            </xsl:when>
            <xsl:when test="@name='sysinfo'">
                <xsl:apply-templates select="." mode="sysinfo"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:apply-templates select="." mode="others"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template match="ShowPage" mode="sysinfo">
        <style type="text/css">
            table#sysinfo td {border-bottom: 1px solid #888888; vertical-align: middle;}
            <xsl:if test="count(INFO)=0">
                .loggedinonly {display:none;}
            </xsl:if>
        </style>


        <table border="0" cellpadding="2" cellspacing="0" id="sysinfo">
            <tbody>
                <tr>
                    <td colspan="3" style="height: 1px;"></td>
                </tr>
                <tr>
                    <td>
                        <xsl:value-of select="$lsDisplay"/>
                    </td>
                    <td colspan="2">
                        <select id="xDisplay"  name="xDisplay" style="width: 146px;" class="fs10">
                            <option value="1">
                                <xsl:if test="substring(@config,3,1)='1'">
                                    <xsl:attribute name="selected">selected</xsl:attribute>
                                </xsl:if>
                                <xsl:value-of select="$lsNormal"/>
                            </option>
                            <option value="2">
                                <xsl:if test="substring(@config,3,1)='2'">
                                    <xsl:attribute name="selected">selected</xsl:attribute>
                                </xsl:if>
                                <xsl:value-of select="$lsSmall"/>
                            </option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>
                        <xsl:value-of select="$lsMouseover"/>
                    </td>
                    <td colspan="2">
                        <select id="xMouseover"  name="xMouseover" style="width: 146px;" class="fs10">
                            <option value="0">
                                <xsl:value-of select="$lsNormal"/>
                            </option>
                            <option value="1">
                                <xsl:if test="substring(@config,4,1)='1'">
                                    <xsl:attribute name="selected">selected</xsl:attribute>
                                </xsl:if>
                                <xsl:value-of select="$lsModerateUsage"/>
                            </option>
                            <option value="2">
                                <xsl:if test="substring(@config,4,1)='2'">
                                    <xsl:attribute name="selected">selected</xsl:attribute>
                                </xsl:if>
                                <xsl:value-of select="$lsNoUsage"/>
                            </option>
                        </select>
                    </td>
                </tr>
                <tr style="display:none;">
                    <td>
                        <xsl:value-of select="$lsEditor"/>
                    </td>
                    <td colspan="2">
                        <select id="xEditor"  name="xEditor" style="width: 146px;" class="fs10">
                            <option value="1">
                                <xsl:if test="substring(@config,1,1)='1'">
                                    <xsl:attribute name="selected">selected</xsl:attribute>
                                </xsl:if>
                                FCKeditor 2.x
                            </option>
                            <option value="5">
                                <xsl:if test="not(contains('1234',substring(@config,1,1)))">
                                    <xsl:attribute name="selected">selected</xsl:attribute>
                                </xsl:if>
                                CKeditor 4.x, skin 'moono'
                            </option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <xsl:if test="Agent[.='MSIE' and @version &lt; 9]">
                        <xsl:attribute name="style">display:none;</xsl:attribute>
                    </xsl:if>
                    <td>
                        <xsl:value-of select="$lsScayt"/>
                    </td>
                    <td colspan="2">
                        <select id="xScaytStart"  name="xScaytStart" style="width: 146px;" class="fs10">
                            <option value="0">
                                <xsl:if test="substring(@config,2,1)!='1' and substring(@config,2,1)!='2'">
                                    <xsl:attribute name="selected">selected</xsl:attribute>
                                </xsl:if>
                                <xsl:value-of select="$lsManualStart"/>
                            </option>
                            <option value="1">
                                <xsl:if test="substring(@config,2,1)='1'">
                                    <xsl:attribute name="selected">selected</xsl:attribute>
                                </xsl:if>
                                <xsl:value-of select="$lsAutoStart"/>
                            </option>
                            <option value="2">
                                <xsl:if test="substring(@config,2,1)='2'">
                                    <xsl:attribute name="selected">selected</xsl:attribute>
                                </xsl:if>
                                <xsl:value-of select="$lsNativeSpellChecker"/>
                            </option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>&#160;</td>
                    <td colspan="2">
                        <form id="form1" name="form1" method="get" action="?" onsubmit="putcfgtogether();">
                            <input name="f" type="hidden" value="{@id}" />
                            <input id="cfg" type="hidden" name="cfg" value="{@config}"/>
                            <input type="submit" style="width: 146px; " value="{$lsOK}" class="fs10"/>
                        </form>
                    </td>
                </tr>
                <tr>
                    <td style="width: 150px;">XSL Processor</td>
                    <td colspan="2" style="width: 150px;">
                        <xsl:value-of select="system-property('xsl:vendor')"/>
                    </td>
                </tr>
                <tr>
                    <td>XSL Version</td>
                    <td colspan="2">
                        <xsl:value-of select="system-property('xsl:version')"/>
                    </td>
                </tr>
                <tr>
                    <td>Agent</td>
                    <td colspan="2">
                        <xsl:value-of select="Agent"/>
                        <xsl:if test="Agent/@variant !=''">
                            <xsl:text> (</xsl:text>
                            <xsl:value-of select="Agent/@variant"/>
                            <xsl:text>)</xsl:text>
                        </xsl:if>
                    </td>
                </tr>
                <tr>
                    <td>Version</td>
                    <td colspan="2">
                        <xsl:value-of select="/ShowPage/Agent/@version"/>
                    </td>
                </tr>
                <tr>
                    <td style="width: 150px; text-align: left;">(F)CKeditor</td>
                    <td style="width: 67px; text-align: left;">2.x</td>
                    <td style="text-align: left;">4.x</td>
                </tr>
                <tr>
                    <td style="text-align: left;">MSIE 6-8</td>
                    <td>●</td>
                    <td>○</td>
                </tr>
                <tr>
                    <td style="text-align: left;">MSIE 9</td>
                    <td style="text-align: left;">●</td>
                    <td style="text-align: left;">●</td>
                </tr>
                <tr>
                    <td style="text-align: left;">MSIE 10+</td>
                    <td style="text-align: left;">○</td>
                    <td style="text-align: left;">●</td>
                </tr>
                <tr>
                    <td style="text-align: left;">Firefox 5+</td>
                    <td style="text-align: left;">●</td>
                    <td style="text-align: left;">●</td>
                </tr>
                <tr>
                    <td style="text-align: left;">Chrome 23+</td>
                    <td style="text-align: left;">●</td>
                    <td style="text-align: left;">●</td>
                </tr>
                <tr>
                    <td style="text-align: left;">Safari 5+</td>
                    <td style="text-align: left;">●</td>
                    <td style="text-align: left;">●</td>
                </tr>
                <tr>
                    <td style="text-align: left;">Opera 11+</td>
                    <td style="text-align: left;">●</td>
                    <td style="text-align: left;">●</td>
                </tr>
                <tr>
                    <td style="text-align: left;">Android 2</td>
                    <td style="text-align: left;">○</td>
                    <td style="text-align: left;">○</td>
                </tr>
                <tr>
                    <td style="text-align: left;">Android 3+</td>
                    <td style="text-align: left;">●</td>
                    <td style="text-align: left;">●</td>
                </tr>
            </tbody>
        </table>
        <script language="JavaScript" type="text/javascript" >
            function putcfgtogether(){
            var s = document.getElementById('xEditor').value;
            s += document.getElementById('xScaytStart').value;
            s += document.getElementById('xDisplay').value;
            s += document.getElementById('xMouseover').value;
            s += '<xsl:value-of select="substring(@config,5)"/>';
            document.getElementById('cfg').value = s;

            return(false);
            }
            <xsl:if test="substring(@config,3,1)!='1' and substring(@config,3,1)!='2'">
                document.getElementById('xDisplay').selectedIndex = (screen.width &lt; 600)?1:0;
            </xsl:if>
        </script>

    </xsl:template>
    <xsl:template match="ShowPage" mode="role">
        <!-- Role -->
        <xsl:variable name="trcolor">
            <xsl:choose>
                <xsl:when test="bgcolor[.!='']">
                    <xsl:value-of select="bgcolor"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="$pdcolor"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <!-- <form action="{/ShowPage/Script}?f=move&amp;ex={/ShowPage/ex}" method="post" name="movethem"> -->
        <xsl:if test="ex !=''">
            <form action="{Script}">
                <input type="hidden" name="f" value="$Role$"/>
                <input type="hidden" name="ex" value="{ex}"/>
                <input type="hidden" name="settitle" value="{@now}"/>
                <table id="groupData" border="0" cellspacing="1" cellpadding="3" width="680">
                    <tr bgcolor="{$trcolor}">
                        <td style="width: 30%;font-weight: bold;">
                            <xsl:choose>
                                <xsl:when test="contains(/ShowPage/Edit/@link,'m=edit')">
                                    <a href="{Script}?f={ex}&amp;m=edit">
                                        <xsl:value-of select="$lsTeamName"/>
                                    </a>
                                    <xsl:text> </xsl:text>
                                    <a href="{Script}?f=move&amp;para={ex}&amp;ex={@id}">
                                        <img border="0" src="{ImgDir}move.gif" height="18" width="18" align="middle" />
                                    </a>
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:value-of select="$lsTeamName"/>
                                    <xsl:text>: </xsl:text>
                                </xsl:otherwise>
                            </xsl:choose>
                        </td>
                        <td>
                            <xsl:variable name="ts">
                                <xsl:value-of select="ts"/>
                            </xsl:variable>
                            <input type="text" name="sTitle" style="width: 70px;">
                                <xsl:attribute name="value">
                                    <xsl:choose>
                                        <xsl:when test="count(Options/Role[@id=$ts])">
                                            <xsl:value-of select="Options/Role[@id=$ts]"/>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <xsl:value-of select="ti"/>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </xsl:attribute>
                            </input>
                        </td>
                        <td style="width: 1%;">
                            <input type="submit" value="{$lsUpdate}" class="fs12"/>
                        </td>
                    </tr>
                    <tr bgcolor="{$trcolor}">
                        <td style="font-weight: bold;">
                            <xsl:value-of select="$lsTeamDescription"/>
                            <xsl:text>:</xsl:text>
                        </td>
                        <td colspan="2">
                            <input type="text" name="mBody" style="width:99%;" value="{GroupDescription}" />
                        </td>
                    </tr>
                    <xsl:if test="substring(ts,1,1)='G'">
                        <tr  bgcolor="{$trcolor}">
                            <td style="font-weight: bold;">
                                <xsl:value-of select="$lsGroupHomePage"/>
                                <xsl:text>: </xsl:text>
                            </td>
                            <td colspan="2">
                                <a href="?f={substring-before(substring(ts,2),';')}">
                                    <xsl:value-of select="GroupTitle"/>
                                </a>
                            </td>
                        </tr>
                    </xsl:if>
                    <tr>
                        <td colspan="3" height="2"/>
                    </tr>
                </table>

            </form>
        </xsl:if>
        <form action="{Script}">
            <table border="0" cellspacing="1" cellpadding="2" width="680">
                <xsl:choose>
                    <xsl:when test="ex='' or count(ex)=0">
                        <tr bgcolor="{$trcolor}">
                            <td colspan="1" style="font-weight: bold; width:25%">
                                <xsl:value-of select="sTitle"/>
                            </td>
                            <td id="plusminus">
                                <xsl:if test="contains(Edit/@link,'m=edit')">
                                    <a href="javascript:plusminus();">(+)</a>
                                </xsl:if>
                            </td>
                        </tr>
                        <xsl:for-each select="Subobj">
                            <xsl:sort select="@sort" data-type="number"/>
                            <xsl:variable name="name" select="@name"/>
                            <tr bgcolor="{$trcolor}">
                                <xsl:if test="count(/ShowPage/Options/Role[@id=$name])=0">
                                    <xsl:attribute name="style">display:none;</xsl:attribute>
                                    <xsl:attribute name="class">plusminus</xsl:attribute>
                                </xsl:if>
                                <td>
                                    <a>
                                        <xsl:if test="count(/ShowPage/Options/Role[@id=$name])=0">
                                            <xsl:attribute name="style">
                                                <xsl:text>color: #808080;</xsl:text>
                                            </xsl:attribute>
                                        </xsl:if>
                                        <xsl:attribute name="href">
                                            <xsl:value-of select="//ShowPage/Script"/>
                                            <xsl:text>?f=$Role$&amp;ex=</xsl:text>
                                            <xsl:value-of select="@id"/>
                                        </xsl:attribute>
                                        <xsl:value-of select="sTitle"/>
                                    </a>
                                </td>
                                <td>
                                    <xsl:if test="count(/ShowPage/Options/Role[@id=$name])=0">
                                        <xsl:attribute name="style">color: #808080;</xsl:attribute>
                                    </xsl:if>
                                    <xsl:apply-templates select="XMLtext|Xtext"/>
                                </td>
                            </tr>
                        </xsl:for-each>
                    </xsl:when>
                    <xsl:when test="count(/ShowPage/Options/Role) > 0">
                        <xsl:for-each select="Subobj">
                            <xsl:sort select="@name"/>
                            <tr bgcolor="{$trcolor}">
                                <td>
                                    <xsl:value-of select="email"/>
                                </td>
                                <td>
                                    <xsl:choose>
                                        <xsl:when test="count(sTitle) &gt; 0">
                                            <xsl:text>[</xsl:text>
                                            <xsl:choose>
                                                <xsl:when test="@name = /ShowPage/Options/Role/@id">
                                                    <a href="?f=$Role$&amp;ex={@name}">
                                                        <xsl:value-of select="sTitle"/>
                                                    </a>

                                                </xsl:when>
                                                <xsl:otherwise>
                                                    <xsl:value-of select="sTitle"/>
                                                </xsl:otherwise>
                                            </xsl:choose>

                                            <xsl:text>]</xsl:text>
                                        </xsl:when>
                                        <xsl:when test="contains(/ShowPage/Edit/@link,'m=edit')">
                                            <a href="javascript:void(window.open('?f=$user$&amp;ex={@id}','User','resizable=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,fullscreen=no,dependent=yes'))">
                                                <xsl:apply-templates select="." mode="useraccess"/>
                                            </a>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <xsl:apply-templates select="." mode="useraccess"/>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </td>
                                <td>
                                    <a href="{/ShowPage/Script}?f=$Role$&amp;ex={../ex}&amp;sub={@name}">
                                        <img border="0" title="{$lsDeleteLong}" alt="{$lsDeleteLong}"
                                             src="{/ShowPage/ImgDir}delete.gif"/>
                                    </a>
                                    <xsl:if test="contains(/ShowPage/Edit/@link,'m=edit') and count(sTitle) = 0">
                                        <a href="{/ShowPage/Script}?f=$Role$&amp;ex={../ex}&amp;as={@name}">
                                            <img border="0" title="{$lsLoginAs}" alt="{$lsLoginAs}"
                                               src="{/ShowPage/ImgDir}move.gif"/>
                                        </a>
                                    </xsl:if>
                                </td>
                            </tr>
                        </xsl:for-each>
                        <tr bgcolor="{$trcolor}">
                            <td colspan="2" width="600">
                                <input type="hidden" name="f" value="$Role$"/>
                                <input type="hidden" name="ex" value="{ex}"/>
                                <xsl:choose>
                                    <xsl:when test="count(/ShowPage/Options/EMail)">
                                        <select name="add" style="width: 100%;">
                                            <option value="">..</option>
                                            <xsl:for-each select="/ShowPage/Options/EMail">
                                                <xsl:sort select="."/>
                                                <xsl:variable name="id">
                                                    <xsl:choose>
                                                        <xsl:when test="@id='NewObject'"/>
                                                        <xsl:when test="starts-with(@id,'Polling')">
                                                            <xsl:variable name="email" select="."/>
                                                            <xsl:if test="count(/ShowPage/Option[Email=$email])=1">
                                                                <xsl:text>G</xsl:text>
                                                                <xsl:value-of select="substring(@id,8)"/>

                                                            </xsl:if>
                                                        </xsl:when>
                                                        <xsl:otherwise>
                                                            <xsl:value-of select="@id"/>
                                                        </xsl:otherwise>
                                                    </xsl:choose>
                                                </xsl:variable>
                                                <xsl:if test="$id!=''">
                                                    <option value="{$id}">
                                                        <xsl:value-of select="."/>
                                                        <xsl:text> </xsl:text>
                                                        <xsl:value-of select="$id"/>
                                                    </option>
                                                </xsl:if>
                                            </xsl:for-each>
                                        </select>

                                    </xsl:when>
                                    <xsl:when test="contains(/ShowPage/Edit/@link,'m=edit')">
                                        <select id="EMail" name="add" style="width: 100%;">
                                            <xsl:attribute name="onmouseover">
                                                <xsl:text>GetOptions(this,'EMail',</xsl:text>
                                                <xsl:value-of select="count(/ShowPage/Options/Role[@id != /ShowPage/ts]) + 2"/>
                                                <xsl:text>);</xsl:text>
                                            </xsl:attribute>
                                            <xsl:attribute name="onfocus">
                                                <xsl:text>GetOptions(this,'EMail',</xsl:text>
                                                <xsl:value-of select="count(/ShowPage/Options/Role[@id != /ShowPage/ts]) + 2"/>
                                                <xsl:text>);</xsl:text>
                                            </xsl:attribute>
                                            <xsl:for-each select="/ShowPage/Options/Role[@id != /ShowPage/ts]">
                                                <option value="{@id}">
                                                    <xsl:value-of select="."/>
                                                </option>
                                            </xsl:for-each>
                                            <option>-------</option>
                                        </select>
                                    </xsl:when>

                                    <xsl:otherwise>
                                        <select id="User" name="add" style="width: 100%;">
                                            <xsl:attribute name="onmouseover">
                                                <xsl:text>GetOptions(this,'User',</xsl:text>
                                                <xsl:value-of select="count(/ShowPage/Options/Role[@id != /ShowPage/ts]) + 2"/>
                                                <xsl:text>);</xsl:text>
                                            </xsl:attribute>
                                            <xsl:attribute name="onfocus">
                                                <xsl:text>GetOptions(this,'User',</xsl:text>
                                                <xsl:value-of select="count(/ShowPage/Options/Role[@id != /ShowPage/ts]) + 2"/>
                                                <xsl:text>);</xsl:text>
                                            </xsl:attribute>
                                            <xsl:for-each select="/ShowPage/Options/Role[@id != /ShowPage/ts]">
                                                <option value="{@id}">
                                                    <xsl:value-of select="."/>
                                                </option>
                                            </xsl:for-each>
                                            <option>-------</option>
                                        </select>
                                    </xsl:otherwise>
                                </xsl:choose>

                            </td>
                            <td style="width:1%;">
                                <input type="submit" class="fs12">
                                    <xsl:attribute name="value">
                                        <xsl:value-of select="$lsAdd"/>
                                    </xsl:attribute>
                                </input>
                            </td>
                        </tr>
                    </xsl:when>
                </xsl:choose>
            </table>
        </form>
        <xsl:choose>
            <xsl:when test="ex!=''">
                <xsl:variable name="ts">
                    <xsl:value-of select="substring-before(substring(ts,2),';')"/>
                </xsl:variable>
                <xsl:if test="$ts &lt; ex and substring(ts,1,1)='G' and $ts &gt; 0">
                    <form action="{Script}">
                        <input type="hidden" name="f" value="$Role$"/>
                        <input type="hidden" name="ex" value="{ex}"/>
                        <input type="hidden" name="setkey" value="{@now}"/>
                        <table id="groupKey" border="0" cellspacing="1" cellpadding="3" width="680">
                            <tr bgcolor="#ffffff">
                                <td colspan="5" height="2"/>
                            </tr>
                            <xsl:apply-templates select="InvitingAccess" mode="start">
                                <xsl:with-param name="trcolor" select="$trcolor"/>
                            </xsl:apply-templates>
                            <tr  bgcolor="{$trcolor}">
                                <td style="font-weight: bold;width: 25%;">
                                    <xsl:value-of select="$lsGroupID"/>:
                                </td>
                                <td>
                                    <xsl:value-of select="ex"/>
                                </td>
                                <td style="font-weight: bold;">
                                    <xsl:value-of select="$lsAccessCode"/>:
                                </td>
                                <td>
                                    <input name="xKey" type="text" value="{AccessCode}"/>
                                </td>
                                <td style="width: 1%;">
                                    <input type="submit" value="{$lsUpdate}" class="fs12"/>
                                </td>
                            </tr>
                        </table>
                    </form>
                    <xsl:if test="count(/ShowPage/Options/Role) > 0">
                        <form id="invitingMail" action="{Script}?f={$ts}&amp;m=polling" method="post">
                            <table border="0" cellspacing="1" cellpadding="3">
                                <tr bgcolor="#ffffff">
                                    <td colspan="5" height="2"/>
                                </tr>
                                <xsl:apply-templates select="GuestInvitation" mode="start">
                                    <xsl:with-param name="trcolor" select="$trcolor"/>
                                </xsl:apply-templates>
                                <tr valign="top" bgcolor="{$trcolor}">
                                    <td>
                                        <b>
                                            <xsl:value-of select="$lsOnetime"/>
                                        </b>
                                        <br/>
                                        <xsl:value-of select="$lsEmails" disable-output-escaping="yes"/>
                                    </td>
                                    <td colspan="4">
                                        <textarea rows="6" style="width: 99%" name="iAnzahl" data-gramm_editor="false"/>
                                        <input type="hidden" name="sName">
                                            <xsl:attribute name="value">
                                                <xsl:value-of select="@id"/>
                                            </xsl:attribute>
                                        </input>
                                        <input type="hidden" name="sUser">
                                            <xsl:attribute name="value">
                                                <xsl:value-of select="LogonUser"/>
                                            </xsl:attribute>
                                        </input>
                                        <input type="hidden" name="xNoChild" value="true"/>
                                    </td>
                                </tr>
                                <tr valign="middle" bgcolor="{$trcolor}">
                                    <td width="25%">
                                        <xsl:value-of select="$lsDays"/>
                                    </td>
                                    <td valign="top">
                                        <select name="sDauer" style="width: 50px;">
                                            <option>1</option>
                                            <option>3</option>
                                            <option>7</option>
                                            <option>14</option>
                                            <option>21</option>
                                            <option>30</option>
                                            <!--
								    <option>100</option>
								    <option>200</option>
								    <option>400</option>
								    -->
                                        </select>
                                    </td>
                                    <td nowrap="nowrap">
                                        <xsl:value-of select="$lsMultisession"/>
                                        <xsl:text>:</xsl:text>
                                        <input type="checkbox" name="bMultisession" value="Multisession" checked="checked"/>
                                    </td>
                                    <td width="60%"/>
                                    <td>
                                        <input type="submit" value="{$lsSend}"/>
                                    </td>
                                </tr>
                            </table>
                        </form>
                    </xsl:if>
                </xsl:if>
            </xsl:when>
            <xsl:otherwise>
                <form action="{Script}">
                    <input type="hidden" name="f" value="{@id}"/>
                    <table border="0" cellspacing="1" cellpadding="3" width="680">
                        <tr bgcolor="#ffffff">
                            <td colspan="5" height="2"/>
                        </tr>
                        <xsl:apply-templates select="InvitedAccess" mode="start">
                            <xsl:with-param name="trcolor" select="$trcolor"/>
                        </xsl:apply-templates>
                        <tr bgcolor="{$trcolor}">
                            <td style="font-weight: bold;width:25%;">
                                <xsl:value-of select="$lsGroupID"/>:
                            </td>
                            <td>
                                <xsl:choose>
                                    <xsl:when test="count(param)">
                                        <input type="hidden" name="ex" value="{param}"/>
                                        <xsl:value-of select="param"/>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <input type="text" name="ex"/>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </td>
                            <td style="font-weight: bold;">
                                <xsl:value-of select="$lsAccessCode"/>:
                            </td>
                            <td>
                                <input type="text" name="acc"/>
                            </td>
                            <td>
                                <input type="submit" value="{$lsOK}" class="fs12"/>
                            </td>
                        </tr>
                    </table>
                </form>
            </xsl:otherwise>
        </xsl:choose>

    </xsl:template>
    <xsl:template match="InvitedAccess|InvitingAccess|GuestInvitation" mode="start">
        <xsl:param name="trcolor"/>
        <tr bgcolor="{$trcolor}">
            <td colspan="5">
                <xsl:apply-templates select="."/>
            </td>
        </tr>
    </xsl:template>
    <xsl:template match="Subobj" mode="useraccess">
        <xsl:attribute name="title">
            <xsl:apply-templates select="/ShowPage" mode="getemail">
                <xsl:with-param name="name" select="@name"/>
            </xsl:apply-templates>
        </xsl:attribute>
        <xsl:choose>
            <xsl:when test="substring(@name,1,7)='Polling'">
                <xsl:value-of select="substring-after(@name,'_')"/>
                <xsl:text> (G</xsl:text>
                <xsl:value-of select="substring-before(substring(@name,8),'_')"/>
                <xsl:text>)</xsl:text>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="@name"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template match="ShowPage" mode="user">
        <!-- User  -->
        <script language="JavaScript" type="text/javascript">
            function puttogether(){
            document.form1.mValue.value = '';
            for(var i=0; i!=document.form1.elements.length; i++){
            if(form1.elements[i].type=='checkbox')
            if(form1.elements[i].checked)
            document.form1.mValue.value += form1.elements[i].name;
            document.form1.elements[i].checked = false;
            }
            }
        </script>
        <table cellpadding="0" cellspacing="0">
            <tr valign="top">
                <td>
                    <form>
                        <xsl:attribute name="action">
                            <xsl:value-of select="//ShowPage/Script"/>
                        </xsl:attribute>
                        <input type="hidden" name="f" value="$User$"/>
                        <table border="0" cellspacing="1">
                            <tr>
                                <xsl:attribute name="bgcolor">
                                    <xsl:choose>
                                        <xsl:when test="//ShowPage/bgcolor[.!='']">
                                            <xsl:value-of select="//ShowPage/bgcolor"/>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <xsl:value-of select="$pdcolor"/>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </xsl:attribute>
                                <td>
                                    <input type="text" name="append" value="NewUser"/>
                                </td>
                                <td>
                                    <input type="submit">
                                        <xsl:attribute name="value">
                                            <xsl:value-of select="$lsSubmit"/>
                                        </xsl:attribute>
                                    </input>
                                </td>
                            </tr>
                            <xsl:for-each select="Subobj">
                                <xsl:sort select="sTitle" order="ascending"/>
                                <tr>
                                    <xsl:attribute name="bgcolor">
                                        <xsl:choose>
                                            <xsl:when test="@id=//ex">#e0e0c0</xsl:when>
                                            <xsl:when test="/ShowPage/bgcolor[.!='']">
                                                <xsl:value-of select="/ShowPage/bgcolor"/>
                                            </xsl:when>
                                            <xsl:otherwise>
                                                <xsl:value-of select="$pdcolor"/>
                                            </xsl:otherwise>
                                        </xsl:choose>
                                    </xsl:attribute>
                                    <td>
                                        <a href="{/ShowPage/Script}?f={/ShowPage/@id}&amp;ex={@id}">
                                            <xsl:apply-templates select="sTitle" mode="toolong"/>
                                        </a>
                                    </td>
                                    <td>
                                        <xsl:apply-templates select="XMLtext|Xtext" mode="toolong"/>
                                    </td>
                                    <td>
                                        <xsl:value-of select="substring-before(@sort,' ')"/>
                                    </td>
                                </tr>
                            </xsl:for-each>
                        </table>
                    </form>
                </td>
                <td>
                    <form name="form1" onSubmit="puttogether();">
                        <xsl:attribute name="action">
                            <xsl:value-of select="//ShowPage/Script"/>
                        </xsl:attribute>
                        <input type="hidden" name="f" value="$User$"/>
                        <input type="hidden" name="mValue"/>
                        <input type="hidden" name="exm" value="update"/>
                        <input type="hidden" name="ex">
                            <xsl:attribute name="value">
                                <xsl:value-of select="//ex"/>
                            </xsl:attribute>
                        </input>
                        <table border="0" cellspacing="1">
                            <xsl:for-each select="Subobj[@id=/ShowPage/ex]">
                                <xsl:if test="@id=/ShowPage/ex">
                                    <tr bgcolor="{$pdcolor}">
                                        <td>
                                            <input type="text" name="sUser">
                                                <xsl:attribute name="value">
                                                    <xsl:apply-templates select="." mode="ex"/>
                                                </xsl:attribute>
                                            </input>
                                        </td>
                                        <td>
                                            <input type="submit">
                                                <xsl:attribute name="value">
                                                    <xsl:value-of select="$lsSubmit"/>
                                                </xsl:attribute>
                                            </input>
                                        </td>
                                    </tr>
                                    <tr bgcolor="{$pdcolor}">
                                        <td colspan="2">
                                            <input type="text" name="tValue" value="{@sort}"/>
                                        </td>
                                    </tr>
                                    <xsl:for-each select="../Options/RoleMan">
                                        <xsl:sort select="@sort" data-type="number"/>
                                        <xsl:if test="@id != 'X'">
                                            <tr bgcolor="{$pdcolor}">
                                                <td title="{@id}">
                                                    <xsl:value-of select="."/>
                                                </td>
                                                <td>
                                                    <xsl:apply-templates select="../../Subobj" mode="Role">
                                                        <xsl:with-param name="Role">
                                                            <xsl:value-of select="@id"/>
                                                        </xsl:with-param>
                                                    </xsl:apply-templates>
                                                </td>
                                            </tr>
                                        </xsl:if>
                                    </xsl:for-each>
                                </xsl:if>
                            </xsl:for-each>
                        </table>
                    </form>
                </td>
            </tr>
        </table>
    </xsl:template>
    <xsl:template name="username">
        <xsl:param name="n" />
        <xsl:variable name="output">
            <xsl:choose>
                <xsl:when test="starts-with($n,'Polling') and contains($n,'_')">
                    <xsl:value-of select="substring-after($n,'_')"/>
                </xsl:when>
                <xsl:when test="contains($n,'\')">
                    <xsl:value-of select="substring-after($n,'\')"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="$n"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <xsl:call-template name="toolong">
            <xsl:with-param name="output" select="$output"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="toolong">
        <xsl:param name="output"/>
        <xsl:param name="l" select="12"/>
        <xsl:choose>
            <xsl:when test="string-length($output) &gt; $l+2">
                <xsl:value-of select="substring($output,1,$l)"/>
                <xsl:text>...</xsl:text>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="$output"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="jscript_sel">
        <script language="JavaScript" type="text/javascript">
            function getUrlParam( paramName ) {
            var reParam = new RegExp( '(?:[\?&amp;]|&amp;)' + paramName + '=([^&amp;]+)', 'i' ) ;
            var match = window.location.search.match(reParam) ;
            return ( match &amp;&amp; match.length > 1 ) ? match[ 1 ] : null ;
            }
            var funcNum = getUrlParam( 'CKEditorFuncNum' );
            function ChangeDir(url){
            <xsl:choose>
                <xsl:when test="count(/ShowPage/CKEditorFuncNum)">
                    url += '&amp;CKEditorFuncNum' + '=' +  (0 + 0<xsl:value-of select="/ShowPage/CKEditorFuncNum"/>);   //funcNum;
                </xsl:when>
            </xsl:choose>
            location.assign(url);
            }
            function SetTargetValueAndClose(s1,s2){
            var doc;
            if(opener!=null)
            doc=opener.document;
            else
            doc=top.document;
            s2 = uf3(s2);
            <xsl:choose>
                <xsl:when test="/ShowPage/param = 'cke4'">
                    opener.CKEDITOR.tools.callFunction(funcNum,s1,function(){
                    try {this.getDialog().getContentElement('info','txtAlt').setValue(s2); } catch(err) {;} ;
                    });
                </xsl:when>
                <xsl:when test="/ShowPage/param='ckelink4'">
                    opener.CKEDITOR.tools.callFunction(funcNum,s1+ ' '+s2);
                </xsl:when>
                <xsl:when test="/ShowPage/param = 'cke'">
                    opener.CKEDITOR.tools.callFunction(2,s1,function(){
                    try {this.getDialog().getContentElement('info','txtAlt').setValue(s2); } catch(err) {;} ;
                    });
                </xsl:when>
                <xsl:when test="/ShowPage/param='ckelink'">
                    opener.CKEDITOR.tools.callFunction(2,s1+ ' '+s2);
                </xsl:when>
                <xsl:otherwise>

                    if(doc.title=='Link Properties'){
                    if(doc.form1.sTitle.value=='')
                    doc.form1.sTitle.value =s2;
                    doc.form1.cmbLinkProtocol.value = '';
                    doc.form1.txtUrl.value = s1;
                    doc.form1.txtUrl.focus();
                    }
                    else if(doc.title=='Image Properties') {
                    doc.getElementById('txtUrl').value = s1;
                    doc.getElementById('txtAlt').value = s2;
                    doc.getElementById('txtAttTitle').value = s2;
                    doc.getElementById('txtUrl').focus();
                    }
                    else if(doc.title=='MovePage'){
                    doc.form1.sName.value = s1;
                    if(doc.form1.sTitle.value=='')
                    doc.form1.sTitle.value = s2;
                    doc.form1.sName.focus();
                    }
                    else {
                    doc.form1.sName.value = s1;
                    <!-- if(doc.form1.sTitle.value=='') -->
                    doc.form1.sTitle.value = s2;
                    doc.form1.bSave.checked = true;
                    doc.form1.sName.focus();


                    }
                </xsl:otherwise>
            </xsl:choose>
            if(opener!=null)window.close();
            }
        </script>
    </xsl:template>
    <xsl:template match="ShowPage" mode="map">
        <!-- indexmap or tree -->
        <xsl:call-template name="jscript_sel"/>
        <xsl:call-template name="IfTooMany"/>
        <table>
            <tbody>
                <xsl:choose>
                    <xsl:when test="sTemplate[.='NextBib.xsl' or .='NextContact.xsl']">
                        <xsl:apply-templates select="Subobj" mode="Dynalist">
                            <xsl:sort select="sTitle"/>
                            <xsl:with-param name="width">0</xsl:with-param>
                        </xsl:apply-templates>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:apply-templates select="Subobj" mode="Dynalist">
                            <xsl:sort select="@sort"/>
                            <xsl:with-param name="width">0</xsl:with-param>
                        </xsl:apply-templates>
                    </xsl:otherwise>
                </xsl:choose>
            </tbody>
        </table>
        <xsl:call-template name="IfTooMany"/>
        <script  language="JavaScript" type="text/javascript" >
            try{
            var e = document.getElementById('<xsl:value-of select="FocusPage"/>');
            e.scrollIntoView();
            window.scrollBy(0,-100);
            }
            catch(e){
            }

        </script>
    </xsl:template>
    <xsl:template match="ShowPage" mode="makelist">

            <select id="goquick" style="width: 70px; background: {$pdcolor}; border: 0px;" onchange="ShowItems(this);">
                <option>
                    <xsl:value-of select="$lsAllItems"/>
                </option>
                <xsl:for-each select="/ShowPage/Options/User">
                    <xsl:sort select="."/>
                    <xsl:if test=". = /ShowPage/Subobj/@authorname" >
                        <option>
                            <xsl:call-template name="username">
                                <xsl:with-param name="n" select="."/>
                            </xsl:call-template>
                        </option>
                    </xsl:if>

                </xsl:for-each>
            </select>

    </xsl:template>
    <xsl:template match="ShowPage" mode="todo">
        <!-- todo -->
        <xsl:variable name="bgcolor">
            <xsl:choose>
                <xsl:when test="/ShowPage/bgcolor[.!='']">
                    <xsl:value-of select="/ShowPage/bgcolor"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="$pdcolor"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <script language="JavaScript" type="text/javascript">
            function ShowItems(ctrl){
            var k = ctrl.options[ctrl.selectedIndex].text;
            var t = document.getElementById("tasks");
            var l = t.getElementsByTagName("tr");
            var i;
            for(i=0; i &lt; l.length; i++){
            if(k=='<xsl:value-of select="$lsAllItems"/>')
            l[i].style.display = '';
            else {
            var a = l[i].getElementsByTagName("td")[4];
            if(a==null);
            else if(a.innerHTML==k)l[i].style.display = '';
            else l[i].style.display = 'none';
            }

            }
            }
        </script>
        <table cellspacing="1" border="0" bgcolor="#FFFFFF" width="680" id="tasks">
            <tr bgcolor="{$pdcolor}">
                <td class="under2">
                    <a>
                        <xsl:if test="Sort != 'Status' or count(Sort)=0">
                            <xsl:attribute name="href">
                                <xsl:value-of select="Script"/>
                                <xsl:text>?f=</xsl:text>
                                <xsl:value-of select="@id"/>
                                <xsl:text>&amp;sort=Status</xsl:text>
                                <xsl:if test="ex > 0">
                                    <xsl:text>&amp;ex=</xsl:text>
                                    <xsl:value-of select="ex"/>
                                </xsl:if>
                            </xsl:attribute>
                        </xsl:if>
                        <b>
                            <xsl:value-of select="$lsType"/>
                        </b>
                    </a>
                </td>
                <td class="under2">
                    <a>
                        <xsl:if test="Sort != ''">
                            <xsl:attribute name="href">
                                <xsl:value-of select="Script"/>
                                <xsl:text>?f=</xsl:text>
                                <xsl:value-of select="@id"/>
                                <xsl:if test="ex > 0">
                                    <xsl:text>&amp;ex=</xsl:text>
                                    <xsl:value-of select="ex"/>
                                </xsl:if>
                            </xsl:attribute>
                        </xsl:if>
                        <b>
                            <xsl:value-of select="$lsSchedule"/>
                        </b>
                    </a>
                </td>
                <td class="under2" nowrap="nowrap">
                    <a>
                        <xsl:if test="Sort != 'Wichtig' or count(Sort)=0">
                            <xsl:attribute name="href">
                                <xsl:value-of select="Script"/>
                                <xsl:text>?f=</xsl:text>
                                <xsl:value-of select="@id"/>
                                <xsl:text>&amp;sort=Wichtig</xsl:text>
                                <xsl:if test="ex > 0">
                                    <xsl:text>&amp;ex=</xsl:text>
                                    <xsl:value-of select="ex"/>
                                </xsl:if>
                            </xsl:attribute>
                        </xsl:if>
                        <b>
                            <xsl:value-of select="$lsPrio"/>
                        </b>
                    </a>
                </td>
                <td  style="text-align: right;">
                    <xsl:if test="count(/ShowPage/Options/User)">
                        <xsl:attribute name="colspan">2</xsl:attribute>
                    </xsl:if>
                    <xsl:apply-templates select="." mode="makelist"/>
                </td>
            </tr>
            <xsl:for-each select="Subobj">
                <tr valign="top" bgcolor="{$pdcolor}">
                    <td class="under2" nowrap="nowrap">
                        <xsl:choose>
                            <xsl:when test="/ShowPage/@name='toread'">
                                <xsl:apply-templates select="Status/@class"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <a  href="javascript:EditPage('{@id}');">
                                    <xsl:apply-templates select="Status/@class"/>
                                </a>
                            </xsl:otherwise>
                        </xsl:choose>
                    </td>
                    <td class="small" nowrap="nowrap">
                        <xsl:value-of select="Status/@time"/>
                    </td>
                    <td align="center" class="small">
                        <xsl:value-of select="Status/@importance"/>
                    </td>
                    <td class="small">
                        <a href="?f={@id}" target="_blank">
                            <xsl:value-of select="sTitle"/>
                        </a>
                    </td>
                    <xsl:if test="count(/ShowPage/Options/User)">
                        <xsl:variable name="id">
                            <xsl:value-of select="@author"/>
                        </xsl:variable>
                        <xsl:variable name="user">
                            <xsl:value-of select="/ShowPage/Options/User[@id=$id]"/>
                        </xsl:variable>
                        <td>
                            <xsl:attribute name="title">
                                <xsl:apply-templates select=".." mode="getemail">
                                    <xsl:with-param name="name">
                                        <xsl:value-of select="$user"/>
                                    </xsl:with-param>
                                </xsl:apply-templates>
                            </xsl:attribute>
                            <xsl:call-template name="username">
                                <xsl:with-param name="n" select="$user"/>
                            </xsl:call-template>
                        </td>
                    </xsl:if>
                </tr>
            </xsl:for-each>
        </table>
    </xsl:template>
    <xsl:template match="ShowPage" mode="sessions">
        <!-- sessions -->
        <table>
            <xsl:for-each select="Subobj">
                <xsl:sort select="id"/>
                <tr valign="top">
                    <td nowrap="nowrap">
                        <xsl:value-of select="substring(sTitle,1,17)"/>
                    </td>
                    <xsl:variable name="rest" select="substring(sTitle,18)"/>
                    <td>
                        <xsl:if test="true or substring-before($rest,' ')!='0'">
                            <xsl:value-of select="substring-before($rest,' ')"/>
                        </xsl:if>
                    </td>
                    <xsl:variable name="data" select="substring-after($rest,'- ')"/>
                    <td>
                        <a href="?f=index&amp;as={substring-before($data,' ')}">
                            <xsl:attribute name="title">
                                <xsl:apply-templates select=".." mode="getemail">
                                    <xsl:with-param name="name">
                                        <xsl:value-of select="substring-before($data,' ')"/>
                                    </xsl:with-param>
                                </xsl:apply-templates>
                            </xsl:attribute>
                            <xsl:choose>
                                <xsl:when test="substring($data,1,7)='Polling'">
                                    <xsl:text>G</xsl:text>
                                    <xsl:call-template name="toolong">
                                        <xsl:with-param name="output" select="substring(substring-before($data,' '),8)"/>
                                        <xsl:with-param name="l" select="16"/>
                                    </xsl:call-template>
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:value-of select="substring-before($data,' ')"/>
                                </xsl:otherwise>
                            </xsl:choose>
                        </a>
                    </td>
                    <td>
                        <xsl:variable name="info" select="substring-before(concat(substring-after($data,' '),':'),':')"/>
                        <a href="?f=single&amp;INFO={$info}">
                            <xsl:call-template name="toolong">
                                <xsl:with-param name="output" select="$info"/>
                                <xsl:with-param name="l" select="20"/>
                            </xsl:call-template>
                        </a>
                    </td>
                    <xsl:choose>
                        <xsl:when test="not(contains(substring-after($data,' '),':'))">
                            <td>
                                <a href="{/ShowPage/Script}?f={/ShowPage/@id}&amp;ex=extend&amp;param={substring-after($data,' ')}">
                                    <xsl:value-of select="substring-before(@super,' ')"/>
                                </a>
                            </td>
                        </xsl:when>
                        <xsl:otherwise>
                            <td>
                                <a href="http://ip-address-lookup-v4.com/ip/{substring-after(substring-after($data,' '),':')}" target="_blank">
                                    <xsl:call-template name="toolong">
                                        <xsl:with-param name="output" select="substring-after(substring-after($data,' '),':')"/>
                                        <xsl:with-param name="l" select="20" />
                                    </xsl:call-template>
                                </a>
                            </td>
                        </xsl:otherwise>
                    </xsl:choose>
                </tr>
            </xsl:for-each>
            <tr>
                <td>&#160;</td>
            </tr>
            <tr>
                <td colspan="4">
                    <xsl:text>System Build: </xsl:text>
                    <xsl:value-of select="dlldatetime"/>
                    <xsl:text> Assembly: </xsl:text>
                    <xsl:value-of select="dlldatetime/@assembly"/>
                </td>
            </tr>
        </table>
    </xsl:template>
    <xsl:template match="ShowPage" mode="getemail">
        <xsl:param name="name"/>
        <xsl:param name="key">
            <xsl:choose>
                <xsl:when test="contains($name,'\')">
                    <xsl:value-of select="substring-before($name,'\')"/>
                    <xsl:text>\</xsl:text>
                    <xsl:value-of select="translate(substring-after($name,'\'),'ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ','abcdefghijklmnopqrstuvwxyzäöü')"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="$name"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:param>
        <xsl:value-of select="Options/EMail[@id=$key]"/>
    </xsl:template>
    <xsl:template match="ShowPage" mode="others">
        <table cellspacing="0" cellpadding="0">
            <tr>
                <td style="width: 23px;"/>
                <td>
                    <xsl:choose>
                        <xsl:when test="@name='single'">
                            <!-- single -->
                            <form method="get" action="{Script}?f=single">
                                <input type="hidden" name="f" value="single"/>
                                <input type="text" style="width: 200px;" name="INFO"/>
                                <input type="submit" value="{$lsSubmit}"/>
                            </form>
                        </xsl:when>
                        <xsl:when test="@name[.='search' or .='searchsel'] ">
                            <!-- search -->
                            <form name="search" method="get"  class="fs11">
                                <xsl:attribute name="action">
                                    <xsl:value-of select="Script"/>
                                </xsl:attribute>
                                <input type="hidden" name="f" value="{@name}"/>
                                <input type="hidden" name="param" value="{param}" />
                                <input type="hidden" name="CKEditorFuncNum" value="{/ShowPage/CKEditorFuncNum}" />
                                <input type="text" style="width: 550px;" name="sSearch" value="{sSearch}"/>
                                <input type="submit" value="{$lsSearch}"/>
                                <br/>
                                <xsl:if test="count(Options/sTemplate)">
                                    <select style="margin-left: 0px; "  name="o"  class="fs11">
                                        <option value="">
                                            <xsl:value-of select="$lsTemplate"/> ...
                                        </option>
                                        <option value="PrivateFile">
                                            <xsl:if test="/ShowPage/SearchOption/@template='PrivateFile'">
                                                <xsl:attribute name="selected">selected</xsl:attribute>
                                            </xsl:if>
                                            <xsl:value-of select="$lsSearchFile"/>
                                        </option>
                                        <option value="Xtern">
                                            <xsl:if test="/ShowPage/SearchOption/@template='Xtern'">
                                                <xsl:attribute name="selected">selected</xsl:attribute>
                                            </xsl:if>
                                            <xsl:value-of select="$lsSearchLink"/>
                                        </option>
                                        <xsl:for-each select="Options/sTemplate[contains(@id,'.xsl')]">
                                            <option value="{@id}">
                                                <xsl:if test="/ShowPage/SearchOption/@template=@id">
                                                    <xsl:attribute name="selected">selected</xsl:attribute>
                                                </xsl:if>
                                                <xsl:value-of select="."/>
                                            </option>
                                        </xsl:for-each>
                                    </select>
                                    <xsl:text> </xsl:text>
                                </xsl:if>
                                <select name="eWhere"  class="fs11">
                                    <option value="">
                                        <xsl:value-of select="$lsSearchAll"/>
                                    </option>
                                    <option value="titleonly">
                                        <xsl:if test="count(SearchOption/@titleonly)">
                                            <xsl:attribute name="selected">selected</xsl:attribute>
                                        </xsl:if>
                                        <xsl:value-of select="$lsSearchTitle"/>
                                    </option>
                                    <option value="tagonly">
                                        <xsl:if test="count(SearchOption/@tagonly)">
                                            <xsl:attribute name="selected">selected</xsl:attribute>
                                        </xsl:if>
                                        <xsl:value-of select="$lsSearchTag"/>
                                    </option>
                                </select>
                                <xsl:if test="/ShowPage/@dbms='MySQL'">
                                    <input type="checkbox" name="eWord" value="wordonly"  class="fs11" >
                                        <xsl:if test="count(SearchOption/@wordonly) or count(sSearch)=0 or sSearch=''">
                                            <xsl:attribute name="checked"/>
                                        </xsl:if>
                                    </input>
                                    <xsl:value-of select="$lsWholeWord"/>
                                </xsl:if>
                                <xsl:if test="ex!=''">
                                    <xsl:text> </xsl:text>
                                    <input name="ex" type="hidden" value="{ex}"/>
                                    <input name="eSub" type="checkbox" value="subonly"  class="fs11">
                                        <xsl:if test="count(param[.= 'index'])=0 and (count(SearchOption/@subonly) or count(SearchOption)=0)">
                                            <xsl:attribute name="checked"/>
                                        </xsl:if>
                                    </input>
                                    <xsl:value-of select="$lsSearchUnder"/>
                                </xsl:if>
                                <xsl:text> </xsl:text>
                                <input type="checkbox"  name="param" value="map"  class="fs11">
                                    <xsl:if test="count(param[.='map'])">
                                        <xsl:attribute name="checked"/>
                                    </xsl:if>
                                </input>
                                <xsl:value-of select="$lsAsMap"/>
                                <br/>
                                <br/>
                            </form>
                        </xsl:when>
                        <xsl:when test="@name='login'">
                            <!-- login -->
                            <form method="post">
                                <xsl:attribute name="action">
                                    <xsl:value-of select="Script"/>
                                    <xsl:text>?f=login</xsl:text>
                                </xsl:attribute>
                                <table border="0" cellpadding="5" cellspacing="0">
                                    <tr>
                                        <td width="100">
                                            <xsl:value-of select="$lsUser"/>
                                            <xsl:text>:</xsl:text>
                                        </td>
                                        <td>
                                            <input type="text" name="sUser"  style="width: 300px;"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <xsl:value-of select="$lsPassword"/>
                                            <xsl:text>:</xsl:text>
                                        </td>
                                        <td>
                                            <input type="password" name="sPassword"  style="width: 300px;"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td/>
                                        <td>
                                            <input type="submit"   style="width: 150px;">
                                                <xsl:attribute name="value">
                                                    <xsl:value-of select="$lsSubmit"/>
                                                </xsl:attribute>
                                            </input>
                                            <!--input type="reset" style="width:150px;">
                                                <xsl:attribute name="value" >
                                                    <xsl:value-of select="$lsReset"/>
                                                </xsl:attribute>
                                            </input-->
                                        </td>
                                    </tr>
                                </table>
                            </form>
                        </xsl:when>
                        <xsl:when test="starts-with(@name,'Error')">
                            <!-- error -->
                            <font size="2" style="background-color: yellow;">
                                <br/>
                                <xsl:value-of select="$lsError"/>: <xsl:value-of select="ex"/>
                                <br/>
                                <br/>
                            </font>
                        </xsl:when>
                        <xsl:when test="@name[.='day' or .='newsel']">
                            <xsl:attribute name="width">656</xsl:attribute>
                            <xsl:attribute name="align">right</xsl:attribute>
                            <xsl:apply-templates select="." mode="month" />
                        </xsl:when>
                        <xsl:when test="starts-with(@name,'loginmsg')">
                            <form action="{Script}">
                                <xsl:if test="count(param)">
                                    <input type="hidden" name="f" value="{param}"/>
                                </xsl:if>
                                <input type="submit" value="{$lsOK}" style="width: 150px;"/>
                            </form>
                        </xsl:when>
                        <xsl:otherwise>
                            <br/>
                        </xsl:otherwise>
                    </xsl:choose>
                </td>
            </tr>
        </table>
        <xsl:call-template name="IfTooMany"/>
        <xsl:if test="count(Subobj)">
            <xsl:if test="@name[.='searchsel' or .='newsel']">
                <xsl:call-template name="jscript_sel"/>
            </xsl:if>
            <xsl:choose>
                <xsl:when test="count(param[.='map'])">
                    <table border="0" cellspacing="0" cellpadding="0" width="680" id="detail">
                        <tbody>
                            <xsl:apply-templates select="Subobj" mode="top">
                                <xsl:sort select="count(oAncestor)" data-type="number"/>
                            </xsl:apply-templates>
                        </tbody>
                    </table>
                </xsl:when>
                <xsl:otherwise>
                    <form action="{/ShowPage/Script}" method="get" name="movethem">
                        <input type="hidden" name="f" value="move"/>
                        <input type="hidden" name="ex" >
                            <xsl:attribute name="value">
                                <xsl:choose>
                                    <xsl:when test="/ShowPage/ex!=''">
                                        <xsl:value-of select="/ShowPage/ex"/>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <xsl:value-of select="/ShowPage/@id"/>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </xsl:attribute>
                        </input>
                        <table border="0" cellspacing="0" cellpadding="1"  id="detail" width="100%">
                            <tbody>
                                <tr class="header" nodrag="true" nodrop="true">
                                    <td>
                                        <input type="checkbox" name="xAll" onclick="doitforall(this);"/>
                                    </td>
                                    <xsl:choose>
                                        <xsl:when test="/ShowPage/@name[.='newpage' or .='newcomment' or .='day' or .= 'newsel']">
                                            <td colspan="4" align="right">
                                                <input type="image" src="{/ShowPage/ImgDir}move.gif" title="{$lsMove}"
                     onclick="this.form.submit();"/>
                                            </td>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <td colspan="3" align="right">
                                                <input type="image" src="{/ShowPage/ImgDir}move.gif" title="{$lsMove}"
                                               onclick="this.form.submit();"/>
                                                <img src="{/ShowPage/ImgDir}save_s.gif" id="savesort" style="display:none;" onclick="SaveSort();"/>&#160;
                                            </td>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </tr>
                                <xsl:for-each select="Subobj[sTemplate!='Empty']">
                                    <xsl:variable name="type">
                                        <xsl:choose>
                                            <xsl:when test="count(sName)">
                                                <xsl:value-of select="translate(substring-after(sName,'.'),'JPENGIF','jpengif')"/>
                                            </xsl:when>
                                            <xsl:otherwise>
                                                <xsl:value-of select="translate(substring-after(@name,'.'),'JPENGIF','jpengif')"/>
                                            </xsl:otherwise>
                                        </xsl:choose>
                                    </xsl:variable>
                                    <xsl:variable name="author">
                                        <xsl:choose>
                                            <xsl:when test="count(@authorname)">
                                                <xsl:value-of select="@authorname"/>
                                            </xsl:when>
                                            <xsl:when test="count(@author)">
                                                <xsl:value-of select="@author"/>
                                            </xsl:when>
                                            <xsl:otherwise>
                                                <xsl:value-of select="@name"/>
                                            </xsl:otherwise>
                                        </xsl:choose>
                                    </xsl:variable>
                                    <tr id="{@id}">
                                        <td align="center" style="cursor: pointer; border-top: 1px solid #cccccc;">
                                            <input type="checkbox" name="para" value="{@id}" style="height: 14px;"/>
                                        </td>
                                        <td class="under2" width="100%" style="border-top: 1px solid #cccccc;">
                                            <xsl:if test="../@name[.='neues' or .= 'newpage' or .= 'newcomment' or .='day' or .='newsel']">
                                                <xsl:attribute name="colspan">2</xsl:attribute>
                                            </xsl:if>
                                            <a target="{../Target}" title="{sTitle}" style="text-decoration: none;">
                                                <xsl:attribute name="href">
                                                    <xsl:choose>
                                                        <xsl:when test="/ShowPage/@name[.='searchsel' or .= 'newsel']">
                                                            <xsl:text>javascript:SetTargetValueAndClose('</xsl:text>
                                                            <xsl:value-of select="/ShowPage/SysURL"/>
                                                            <xsl:text>?f=</xsl:text>
                                                            <xsl:value-of select="@id"/>
                                                            <xsl:text>','</xsl:text>
                                                            <xsl:apply-templates select="sTitle"/>
                                                            <xsl:text>')</xsl:text>
                                                        </xsl:when>
                                                        <xsl:when test="sTemplate='PrivateFile' and ($type='gif' or $type='jpg' or $type='jpeg' or $type='png')">
                                                            <xsl:value-of select="../Script"/>
                                                            <xsl:text>?f=</xsl:text>
                                                            <xsl:value-of select="@id"/>
                                                            <xsl:text>&amp;v=imgview.xsl</xsl:text>
                                                        </xsl:when>
                                                        <xsl:when test="sTemplate[.='PrivateFile' or .='PublicFile' or .='Xtern']">
                                                            <xsl:value-of select="../Script"/>
                                                            <xsl:text>?f=</xsl:text>
                                                            <xsl:value-of select="@id"/>
                                                            <xsl:text>&amp;INFO=</xsl:text>
                                                            <xsl:value-of select="../INFO"/>
                                                        </xsl:when>
                                                        <xsl:when test="../@name='newcomment'">
                                                            <xsl:value-of select="/ShowPage/Script"/>
                                                            <xsl:text>?f=</xsl:text>
                                                            <xsl:value-of select="@id"/>
                                                            <xsl:text>&amp;m=comment&amp;ex=all</xsl:text>
                                                        </xsl:when>
                                                        <xsl:otherwise>
                                                            <xsl:value-of select="/ShowPage/Script"/>
                                                            <xsl:text>?f=</xsl:text>
                                                            <xsl:value-of select="@id"/>
                                                            <xsl:text>&amp;sSearch=</xsl:text>
                                                            <xsl:value-of select="/ShowPage/SearchOption/@search"/>
                                                        </xsl:otherwise>
                                                    </xsl:choose>
                                                </xsl:attribute>
                                                <xsl:apply-templates select="sTitle" mode="toolong">
                                                    <xsl:with-param name="l" select="70"/>
                                                </xsl:apply-templates>
                                                <xsl:if test="normalize-space(sTitle)='' or count(sTitle)=0">
                                                    [<xsl:value-of select="$lsNoTitle"/>]
                                                </xsl:if>
                                            </a>
                                        </td>
                                        <td class="under2" nowrap="nowrap" style="border-top: 1px solid #cccccc;">
                                            <xsl:if test="contains(sTemplate,'.xsl') and sTemplate!='DocView.xsl'">
                                                <xsl:attribute name="colspan">2</xsl:attribute>
                                            </xsl:if>
                                            <xsl:choose>
                                                <xsl:when test="../@name[.='neues' or .= 'newpage' or .= 'newcomment' or .='day' or .='newsel' or .='search' or .='searchsel']">
                                                    <xsl:attribute name="title">
                                                        <xsl:apply-templates select="/ShowPage" mode="getemail">
                                                            <xsl:with-param name="name" select="$author"/>
                                                        </xsl:apply-templates>
                                                        <xsl:text> (</xsl:text>
                                                        <xsl:value-of select="$author"/>
                                                        <xsl:text>)</xsl:text>
                                                    </xsl:attribute>
                                                    <xsl:choose>
                                                        <xsl:when test="count(/ShowPage/@version)=0 or /ShowPage/@version &lt; 3.0">
                                                            <xsl:value-of select="@sort"/>
                                                        </xsl:when>
                                                        <xsl:otherwise>
                                                            <xsl:value-of select="@time"/>
                                                        </xsl:otherwise>
                                                    </xsl:choose>
                                                    <xsl:if test="$author!='-' and $author!='' and $author!=0">
                                                        <xsl:text>, </xsl:text>
                                                        <xsl:call-template name="username">
                                                            <xsl:with-param name="n" select="$author"/>
                                                        </xsl:call-template>
                                                    </xsl:if>
                                                </xsl:when>
                                                <xsl:otherwise>
                                                    <xsl:value-of select="@time"/>
                                                </xsl:otherwise>
                                            </xsl:choose>
                                        </td>
                                        <xsl:choose>
                                            <xsl:when test="not(contains(sTemplate,'.xsl'))">
                                                <td style="border-top: 1px solid #cccccc; text-align: center;">
                                                    <a target="{../Target}" href="{//ShowPage/Script}?f={@super}">
                                                        <img border="0" title="{$lsClosedGif}" alt="{$lsClosedGif}" src="{../ImgDir}closed.gif" align="top" style="margin-top: 2px;"/>
                                                    </a>
                                                </td>
                                            </xsl:when>
                                            <xsl:when test="sTemplate='DocView.xsl'">
                                                <td style="border-top: 1px solid #cccccc; text-align: center;">
                                                    <a target="{../Target}" href="{//ShowPage/Script}?f={@super}">
                                                        <img border="0" title="{$lsComment}" alt="{$lsComment}" src="{../ImgDir}AddComment.gif" align="top" style="margin-top: 2px;"/>
                                                    </a>
                                                </td>
                                            </xsl:when>
                                        </xsl:choose>
                                    </tr>
                                </xsl:for-each>
                            </tbody>
                        </table>
                    </form>
                    <xsl:if test="/ShowPage/@name[.!='newpage' and .!='newcomment' and .!='search' and .!='searchsel' and .!='day' and .!='newsel']">
                        <script type="text/javascript" src="tablednd.js">  </script>
                        <script language="JavaScript" type="text/javascript">
                            var table2 = document.getElementById('detail');
                            var tableDnD2 = new TableDnD();
                            tableDnD2.init(table2);
                            function SaveSort(){
                            var f = document.sortform;
                            var sSortList = "";
                            var rows = document.getElementById('detail').tBodies[0].rows;
                            <![CDATA[
              for(var i=0; i<rows.length; i++){
                sSortList += rows[i].id + " ";
              }
            ]]>
                            f.sSortList.value = sSortList;
                            f.submit();
                            }
                            tableDnD2.onDrop = function(table, row){
                            document.getElementById('savesort').style.display = '';
                            }
                        </script>
                        <form name="sortform" action="{/ShowPage/Script}?m=move" method="post">
                            <input type="hidden" name="ex" value="{/ShowPage/@id}"/>
                            <input type="hidden" name="sSortList"/>
                        </form>
                    </xsl:if>
                    <script  type="text/javascript">
                        function doitforall(ctrl){
                        var f = ctrl.form;
                        for(var i=0; i &lt; f.elements.length; i++){
                        var e = f.elements[i];
                        if(e.name == "para")e.checked = ctrl.checked;
                        }
                        }
                    </script>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:if>
        <xsl:call-template name="IfTooMany"/>
    </xsl:template>
    <xsl:template match="Subobj" mode="top">
        <xsl:variable name="l" select="count(oAncestor)"/>
        <xsl:variable name="o" select="oAncestor[@f=$l]/@i"/>
        <xsl:if test="count(../Subobj[@id=$o])=0">
            <xsl:apply-templates select="." mode="layer">
                <xsl:with-param name="top" select="1" />
            </xsl:apply-templates>
        </xsl:if>
    </xsl:template>
    <xsl:template match="Subobj" mode="layer">
        <xsl:param name="top" select="0"/>
        <xsl:variable name="layer" select="count(oAncestor) + 1"/>
        <xsl:variable name="id" select="@id"/>
        <xsl:apply-templates select="." mode="show">
            <xsl:with-param name="top" select="$top" />
        </xsl:apply-templates>
        <xsl:apply-templates select="../Subobj[count(oAncestor) = $layer and oAncestor[@f = $layer and @i = $id]]" mode="layer">
            <xsl:sort select="sTitle" data-type="text"/>
        </xsl:apply-templates>
    </xsl:template>
    <xsl:template match="Subobj" mode="show">
        <xsl:param name="top" select="0"/>
        <xsl:variable name="layer" select="count(oAncestor)"/>
        <tr>
            <td>
                <xsl:attribute name="style">
                    <xsl:text>padding-left: </xsl:text>
                    <xsl:value-of select="($layer - 1) * 15"/>
                    <xsl:text>px;</xsl:text>
                    <xsl:if test="$top = 1">
                        <xsl:text>border-top: 1px solid #cccccc;</xsl:text>
                    </xsl:if>
                </xsl:attribute>
                <a href="?f={@id}" target="_blank">
                    <img src="{/ShowPage/ImgDir}dynclose.gif" border="0" style="vertical-align: top; margin-top: 0px;"/>
                    <xsl:value-of select="sTitle"/>
                </a>
            </td>
        </tr>
    </xsl:template>
    <xsl:template match="Subobj" mode="ex">
        <xsl:if test="@id=//ex">
            <xsl:value-of select="sTitle"/>
        </xsl:if>
    </xsl:template>
    <xsl:template match="Subobj" mode="Role">
        <xsl:param name="Role"/>
        <xsl:if test="@id=//ex">
            <xsl:choose>
                <xsl:when test="contains(XMLtext,$Role) or contains(Xtext,$Role)">
                    <input type="checkbox" checked="true">
                        <xsl:attribute name="name">
                            <xsl:value-of select="$Role"/>
                        </xsl:attribute>
                    </input>
                </xsl:when>
                <xsl:otherwise>
                    <input type="checkbox">
                        <xsl:attribute name="name">
                            <xsl:value-of select="$Role"/>
                        </xsl:attribute>
                    </input>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:if>
    </xsl:template>
    <xsl:template match="Subobj" mode="oneline">
        <xsl:param name="width" select="20"/>
        <tr id="{@id}">
            <xsl:choose>
                <xsl:when test="(@id = /ShowPage/para or (count(/ShowPage/para)=0 and ../@id=/ShowPage/ex)) and /ShowPage/@name ='move'">
                    <td style="padding-left: {$width}px;">
                        <img src="{/ShowPage/ImgDir}move.gif" title="{$lsMove}" alt="{$lsMove}"/>
                        <xsl:text> </xsl:text>
                        <xsl:value-of select="sTitle"/>
                        <xsl:if test="@id=/ShowPage/para">
                            <xsl:call-template name="saveicon"/>
                        </xsl:if>
                    </td>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:if test="/ShowPage/@name='move'">
                        <xsl:attribute name="nodrag">true</xsl:attribute>
                    </xsl:if>
                    <td style="padding-left: {$width}px;">
                        <a style="text-decoration: none;">
                            <xsl:attribute name="href">
                                <xsl:text>javascript:ChangeDir('</xsl:text>
                                <xsl:value-of select="/ShowPage/Script"/>
                                <xsl:text>?f=</xsl:text>
                                <xsl:value-of select="/ShowPage/@name"/>
                                <xsl:text>&amp;ex=</xsl:text>
                                <xsl:value-of select="@id"/>
                                <xsl:for-each select="/ShowPage/param">
                                    <xsl:text>&amp;param=</xsl:text>
                                    <xsl:value-of select="."/>
                                </xsl:for-each>
                                <xsl:for-each select="/ShowPage/para">
                                    <xsl:text>&amp;para=</xsl:text>
                                    <xsl:value-of select="."/>
                                </xsl:for-each>
                                <xsl:text>')</xsl:text>
                                <!--
                                <xsl:value-of select="/ShowPage/Script"/>
                                <xsl:text>?f=</xsl:text>
                                <xsl:value-of select="/ShowPage/@name"/>
                                <xsl:text>&amp;ex=</xsl:text>
                                <xsl:value-of select="@id"/>
                                <xsl:for-each select="/ShowPage/para">
                                    <xsl:text>&amp;para=</xsl:text>
                                    <xsl:value-of select="."/>
                                </xsl:for-each>
                                <xsl:for-each select="/ShowPage/param">
                                    <xsl:text>&amp;param=</xsl:text>
                                    <xsl:value-of select="."/>
                                </xsl:for-each>
                                -->
                            </xsl:attribute>
                            <xsl:apply-templates select="." mode="icon"/>
                        </a>
                        <xsl:text> </xsl:text>
                        <a style="text-decoration: none;">
                            <xsl:if test="Focus>0">
                                <xsl:attribute name="style">
                                    <xsl:text>font-weight: bold;text-decoration: none;</xsl:text>
                                    <xsl:if test="/ShowPage/@name='deltree'"> color: red;</xsl:if>
                                </xsl:attribute>
                            </xsl:if>
                            <xsl:choose>
                                <xsl:when test="/ShowPage/@name='indexsel'">
                                    <xsl:attribute name="href">
                                        <xsl:text>javascript:SetTargetValueAndClose('</xsl:text>
                                        <xsl:value-of select="/ShowPage/SysURL"/>
                                        <xsl:text>?f=</xsl:text>
                                        <xsl:value-of select="@id"/>
                                        <xsl:text>','</xsl:text>
                                        <xsl:apply-templates select="sTitle"/>
                                        <xsl:text>')</xsl:text>
                                    </xsl:attribute>
                                </xsl:when>
                                <xsl:when test="/ShowPage/@name='move' and Focus > 0 and false">
                                </xsl:when>
                                <xsl:when test="/ShowPage/@name='move'">
                                    <xsl:attribute name="href">
                                        <xsl:value-of select="/ShowPage/Script"/>
                                        <xsl:text>?m=move&amp;ex=</xsl:text>
                                        <xsl:value-of select="@id"/>
                                        <xsl:for-each select="/ShowPage/para">
                                            <xsl:text>&amp;f=</xsl:text>
                                            <xsl:value-of select="."/>
                                        </xsl:for-each>
                                    </xsl:attribute>
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:attribute name="target">
                                        <xsl:value-of select="/ShowPage/Target"/>
                                    </xsl:attribute>
                                    <xsl:apply-templates select="." mode="link"/>
                                </xsl:otherwise>
                            </xsl:choose>
                            <xsl:if test="Focus > 0 and string-length(sTitle)=0">[...]</xsl:if>
                            <xsl:value-of select="sTitle"/>
                            <xsl:if test="List != ../List">
                                <xsl:text> </xsl:text>
                                <img src="{/ShowPage/ImgDir}unlocked.gif" title="{List}"/>
                            </xsl:if>
                        </a>
                        <xsl:if test="Focus > 0">
                            <xsl:if test="/ShowPage/@name='move'">
                                <xsl:call-template name="saveicon"/>
                            </xsl:if>
                        </xsl:if>
                    </td>
                </xsl:otherwise>
            </xsl:choose>
        </tr>
    </xsl:template>
    <xsl:template name="saveicon">
        <xsl:text>&#160;</xsl:text>
        <a href="javascript:SaveSort();">
            <img align="textTop" src="{/ShowPage/ImgDir}save_s.gif" alt="{$lsSubmit}" title="{$lsSubmit}" border="0"/>
        </a>
    </xsl:template>
    <xsl:template match="Subobj" mode="Dynalist">
        <!-- one or more trs -->
        <xsl:param name="width"/>
        <!--
            <xsl:if test="Focus = 2 or Focus = 1">
                <xsl:attribute name="id">
                    <xsl:text>M</xsl:text>
                    <xsl:value-of select="/ShowPage/ex"/>
                </xsl:attribute>
            </xsl:if>
        -->
        <xsl:apply-templates select="." mode="oneline">
            <xsl:with-param name="width" select="$width"/>
        </xsl:apply-templates>
        <xsl:choose>
            <xsl:when test="Focus > 0 and /ShowPage/@name='move'">
                <tr>
                    <td>
                        <table id="tablednd" cellspacing="0" cellpadding="0" border="0">
                            <tbody>
                                <xsl:apply-templates select="Subobj" mode="oneline">
                                    <xsl:sort order="ascending" data-type="number" select="@sort"/>
                                    <xsl:with-param name="width" select="$width + 20"/>
                                </xsl:apply-templates>
                            </tbody>
                        </table>

                    </td>
                </tr>
                <script type="text/javascript" src="tablednd.js">  </script>
                <script language="JavaScript" type="text/javascript">
                    var table2 = document.getElementById('tablednd');
                    var tableDnD2 = new TableDnD();
                    tableDnD2.init(table2);
                    function SaveSort(){
                    var f = document.sortform;
                    var sSortList = "";
                    var rows = document.getElementById('tablednd').tBodies[0].rows;
                    <![CDATA[
              for(var i=0; i<rows.length; i++){
                sSortList += rows[i].id + " ";
              }
            ]]>
                    f.sSortList.value = sSortList;
                    f.submit();
                    }
                </script>
                <form name="sortform" action="{/ShowPage/Script}?m=move" method="post">
                    <input type="hidden" name="ex" value="{/ShowPage/ex}"/>
                    <input type="hidden" name="sSortList"/>
                    <input type="hidden" name="f"/>
                </form>
            </xsl:when>
            <xsl:when test="sTemplate[.='NextBib.xsl' or .='NextContact.xsl' or . ='Glossary.xsl']">
                <xsl:apply-templates select="Subobj" mode="Dynalist">
                    <xsl:sort select="sTitle"/>
                    <xsl:with-param name="width">
                        <xsl:value-of select="$width + 20"/>
                    </xsl:with-param>
                </xsl:apply-templates>
            </xsl:when>
            <xsl:otherwise>
                <xsl:apply-templates select="Subobj" mode="Dynalist">
                    <xsl:sort select="@sort" data-type="number"/>
                    <xsl:with-param name="width">
                        <xsl:value-of select="$width + 20"/>
                    </xsl:with-param>
                </xsl:apply-templates>
            </xsl:otherwise>
        </xsl:choose>
        <xsl:if test="Focus = 2 and /ShowPage/@name='deltree'">
            <xsl:if test="count(Subobj)=0">
                <script language="JavaScript" type="text/javascript">
                    <xsl:text>window.location.replace(".?f=</xsl:text>
                    <xsl:value-of select="../@id"/>");
                </script>
            </xsl:if>
            <tr>
                <td>
                    <table cellspacing="0" cellpadding="0" border="0">
                        <tr>
                            <td height="3"/>
                        </tr>
                        <tr>
                            <td width="{$width + 20 }"/>
                            <td colspan="3" style="font-weight: bold; background-color: yellow;">
                                <xsl:value-of select="/ShowPage/sTitle"/>
                            </td>
                        </tr>
                        <tr>
                            <td height="3"/>
                        </tr>
                        <tr>
                            <td/>
                            <td style="font-weight: bold; background-color: #ff8888;">
                                <a href="{/ShowPage/Script}?f={/ShowPage/ex}&amp;m=xdel&amp;yes={/ShowPage/INFO}">
                                    <xsl:value-of select="$lsDeleteAll"/>
                                </a>
                            </td>
                            <td width="10"/>
                            <td style="font-weight: bold; background-color: #cccccc;">
                                <a href="javascript:window.close();">
                                    <xsl:value-of select="$lsCancel"/>
                                </a>
                            </td>
                        </tr>
                        <tr>
                            <td height="3"/>
                        </tr>
                    </table>

                </td>
            </tr>
        </xsl:if>
        <xsl:if test="Focus > 0 and /ShowPage/@name='indexsel' and count(Append)">
            <script language="JavaScript" type="text/javascript">
                function PutFilename(){
                //var s = new String(document.addform.sUpload.value);
                //var i = s.lastIndexOf("\\");
                //if(document.addform.sTitle.value=='')
                //document.addform.sTitle.value = s.substr(i+1);
                var af = document.addform;
                var url = af.getAttribute('action');
                af.setAttribute('action',url + '%26CKEditorFuncNum' + '=' + funcNum);
                af.submit();
                };
            </script>
            <tr>
                <td style="padding-left: {$width + 20}px;">
                    <xsl:variable name="link">
                        <xsl:text>next=show_indexsel</xsl:text>
                        <xsl:text>%26param=</xsl:text>
                        <xsl:value-of select="/ShowPage/param"/>
                    </xsl:variable>
                    <form name="addform" method="post" ENCTYPE="multipart/form-data"
                      action="{/ShowPage/Script}?f={/ShowPage/ex}&amp;m=create&amp;v=PrivateFile&amp;{$link}">
                        <!--<input type="hidden" name="sTemplate" value="PrivateFile"/>
                            <input type="hidden" name="sName" value="child{/ShowPage/@id}"/>
                             <input type="hidden" name="sTitle"/>              -->
                        <input type="file" name="sUpload" multiple="multiple" onChange="PutFilename();" size="20" class="fs12"/>

                    </form>
                </td>
            </tr>

        </xsl:if>
    </xsl:template>
    <xsl:template match="Subobj" mode="icon">
        <xsl:choose>
            <xsl:when test="@id = /ShowPage/para and /ShowPage/@name='move'">
                <img src="{/ShowPage/ImgDir}move.gif" alt="{$lsMove}" title="{$lsMove}" border="0"/>
            </xsl:when>
            <xsl:when test="nUnder &gt; 0">
                <img src="{/ShowPage/ImgDir}closed.gif" alt="{$lsClosedGif}" title="{$lsClosedGif}" border="0"/>
            </xsl:when>
            <xsl:when test="count(Subobj)">
                <img src="{/ShowPage/ImgDir}open.gif" alt="{$lsOpennedGif}" title="{$lsOpennedGif}" border="0"/>
            </xsl:when>
            <xsl:when test="sTemplate='Xtern'">
                <img src="{/ShowPage/ImgDir}connection.gif" alt="{$lsConnectionGif}" title="{$lsConnectionGif}" border="0"/>
            </xsl:when>
            <xsl:otherwise>
                <img src="{/ShowPage/ImgDir}page.gif" alt="{$lsPageGif}" title="{$lsPageGif}" border="0"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template match="sTitle">
        <xsl:call-template name="NoApostrophe">
            <xsl:with-param name="s" select="."/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="NoApostrophe">
        <xsl:param name="s"/>
        <xsl:variable name="apos">'</xsl:variable>
        <xsl:choose>
            <xsl:when test="contains($s,$apos)">
                <xsl:value-of select="concat(substring-before($s,$apos),'\',$apos)"/>
                <xsl:call-template name="NoApostrophe">
                    <xsl:with-param name="s" select="substring-after($s,$apos)"/>
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="$s"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template match="@class">
        <xsl:choose>
            <xsl:when test=".='Appointment'">
                <xsl:value-of select="$lsAppointment"/>
            </xsl:when>
            <xsl:when test=".='Deadline'">
                <xsl:value-of select="$lsDeadline"/>
            </xsl:when>
            <xsl:when test=".='Todo'">
                <xsl:value-of select="$lsTodo"/>
            </xsl:when>
            <xsl:when test=".='Important'">
                <xsl:value-of select="$lsImportant"/>
            </xsl:when>
            <xsl:when test=".='Done'">
                <xsl:value-of select="$lsDone"/>
            </xsl:when>
            <xsl:when test=".='Unpaid'">
                <xsl:value-of select="$lsUnpaid"/>
            </xsl:when>
            <xsl:when test=".='Paid'">
                <xsl:value-of select="$lsPaid"/>
            </xsl:when>
            <xsl:when test=".='Inactive'">
                <xsl:value-of select="$lsInactive"/>
            </xsl:when>
            <xsl:when test=".='Canceled'">
                <xsl:value-of select="$lsCanceled"/>
            </xsl:when>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="up-href">
        <xsl:value-of select="/ShowPage/Script"/>
        <xsl:text>?f=</xsl:text>
        <xsl:choose>
            <xsl:when test="/ShowPage/@name='$Role$' and /ShowPage/ex!=''">$Role$</xsl:when>
            <xsl:when test="count(/ShowPage/ListOption/@super)">
                <xsl:value-of select="/ShowPage/ListOption/@super"/>
            </xsl:when>
            <xsl:when test="/ShowPage[ex !='' and not(starts-with(translate(@name,'E','e'),'error'))]">
                <xsl:value-of select="/ShowPage/ex"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="/ShowPage/@super"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:param name="lsDeleteAll">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">全部删除！</xsl:when>
            <xsl:when test="$lsLanguage='de'">Ja, alles löschen!</xsl:when>
            <xsl:otherwise>Yes, delete'em all!</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsOtherGroups">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">其它小组</xsl:when>
            <xsl:when test="$lsLanguage='de'">Andere Teams</xsl:when>
            <xsl:otherwise>Other teams</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsGroupHomePage">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">主页</xsl:when>
            <xsl:when test="$lsLanguage='de'">Startseite</xsl:when>
            <xsl:otherwise>Home page</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsCancel">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">不对！</xsl:when>
            <xsl:when test="$lsLanguage='de'">Nein!</xsl:when>
            <xsl:otherwise>No, don't do that!</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsSearchFile">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">文件</xsl:when>
            <xsl:otherwise>File</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsSearchLink">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">链接</xsl:when>
            <xsl:otherwise>Link</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsOnetime">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">访客</xsl:when>
            <xsl:when test="$lsLanguage='de'">Gastzugang</xsl:when>
            <xsl:otherwise>Access for guests</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsAccessCode">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">密码</xsl:when>
            <xsl:when test="$lsLanguage='de'">Zugangscode</xsl:when>
            <xsl:otherwise>Access Code</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsGroupID">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">小组编号</xsl:when>
            <xsl:when test="$lsLanguage='de'">ID der Arbeitsgruppe</xsl:when>
            <xsl:otherwise>Workgroup ID</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsOK">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">好</xsl:when>
            <xsl:when test="$lsLanguage='de'">OK</xsl:when>
            <xsl:otherwise>OK</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsLoginAs">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">以此用户名登录</xsl:when>
            <xsl:when test="$lsLanguage='de'">Anmelden als</xsl:when>
            <xsl:otherwise>Login as</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsUser">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">用户</xsl:when>
            <xsl:when test="$lsLanguage='de'">Kennung</xsl:when>
            <xsl:otherwise>Username</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsPassword">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">密码</xsl:when>
            <xsl:when test="$lsLanguage='de'">Passwort</xsl:when>
            <xsl:otherwise>Password</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsTeamName">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">小组简称</xsl:when>
            <xsl:when test="$lsLanguage='de'">Kurzer Name der Gruppe</xsl:when>
            <xsl:otherwise>Short name of the group</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsTeamDescription">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">小组简介</xsl:when>
            <xsl:when test="$lsLanguage='de'">Kurze Beschreibung</xsl:when>
            <xsl:otherwise>Short description</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsUpdate">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">更新</xsl:when>
            <xsl:when test="$lsLanguage='de'">Aktualisieren</xsl:when>
            <xsl:otherwise>Update</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsEditor">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">编辑程序</xsl:when>
            <xsl:otherwise>Editor</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsScayt">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">随键检错</xsl:when>
            <xsl:when test="$lsLanguage='de'">Rechtschreibung</xsl:when>
            <xsl:otherwise>SCAYT (spell cheker)</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsAutoStart">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">自动启动(CKeditor 4.x)</xsl:when>
            <xsl:otherwise>auto start (CKeditor 4.x)</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsManualStart">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">手动启动(CKeditor 4.x)</xsl:when>
            <xsl:when test="$lsLanguage='de'">manuell (CKeditor 4.x)</xsl:when>
            <xsl:otherwise>manual (CKeditor 4.x)</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsNativeSpellChecker">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">采用浏览器功能</xsl:when>
            <xsl:when test="$lsLanguage='de'">Browser benutzen</xsl:when>
            <xsl:otherwise>using browser</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsDisplay">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">显示屏幕</xsl:when>
            <xsl:otherwise>Display</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsNormal">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">普通</xsl:when>
            <xsl:otherwise>normal</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsSmall">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">小型</xsl:when>
            <xsl:when test="$lsLanguage='de'">Klein</xsl:when>
            <xsl:otherwise>small</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsMouseover">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">使用鼠标悬停</xsl:when>
            <xsl:when test="$lsLanguage='de'">Mouseover anwenden</xsl:when>
            <xsl:otherwise>Using mouseover</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsModerateUsage">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">少量使用</xsl:when>
            <xsl:when test="$lsLanguage='de'">reduziert</xsl:when>
            <xsl:otherwise>moderate</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsNoUsage">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">不使用</xsl:when>
            <xsl:when test="$lsLanguage='de'">keine Anwendung</xsl:when>
            <xsl:otherwise>no usage</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsSearchUnder">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">在下属对象中搜寻</xsl:when>
            <xsl:when test="$lsLanguage='de'">in Untergeordneten</xsl:when>
            <xsl:otherwise>in subobjects</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsAsMap">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">树状显示</xsl:when>
            <xsl:when test="$lsLanguage='de'">als Baumstruktur</xsl:when>
            <xsl:otherwise>shown as map</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsWholeWord">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">搜寻外文全词</xsl:when>
            <xsl:when test="$lsLanguage='de'">ganzes Wort</xsl:when>
            <xsl:otherwise>wohle word</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsSearchTitle">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">搜寻题目</xsl:when>
            <xsl:when test="$lsLanguage='de'">in Überschriften</xsl:when>
            <xsl:otherwise>titles only</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsSearchTag">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">搜寻分类</xsl:when>
            <xsl:when test="$lsLanguage='de'">in Kategorien</xsl:when>
            <xsl:otherwise>tags only</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsSearchAll">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">搜寻全部</xsl:when>
            <xsl:when test="$lsLanguage='de'">überall</xsl:when>
            <xsl:otherwise>everywhere</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsAllItems">All</xsl:param>
</xsl:stylesheet>
