<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="common.xsl"/>
    <xsl:output method="html" indent="no" omit-xml-declaration="yes" />
    <xsl:param name="CKE">
        <!-- 2 = v2, 3 = kama, 4 = office2003, 5 = moono -->
        <xsl:choose>
            <xsl:when test="substring(/ShowPage/@config,1,1) > 0">
                <xsl:value-of select="substring(/ShowPage/@config,1,1)"/>
            </xsl:when>
            <xsl:when test="/ShowPage/Agent[.='MSIE' and @version  &lt; 9]">1</xsl:when>
            <xsl:otherwise>5</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:strip-space elements="p span"/>
    <xsl:template match="ShowPage" mode="block">
        <xsl:param name="TitleOnly" select="''"/>
        <xsl:param name="hide" select="''"/>
        <xsl:param name="title" select="''"/>
        <xsl:param name="addmenu" select="''"/>
        <xsl:variable name="bg">
            <xsl:value-of select="$bgcolorUse"/>
        </xsl:variable>
        <xsl:variable name="pd">
            <xsl:choose>
                <xsl:when test="pdcolor != ''">
                    <xsl:value-of select="pdcolor"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="$pdcolor"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <!--
            -->
        <xsl:if test="$CKE > 1 or /ShowPage/Agent[. != 'MSIE' or @version >  8.9]">
            <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE HTML&gt;
        </xsl:text>
        </xsl:if>
        <html>
            <xsl:if test="Modus='cache'">
                <xsl:attribute name="manifest">
                    <xsl:text>?f=</xsl:text>
                    <xsl:value-of select="@id"/>
                    <xsl:text>&amp;m=manifest</xsl:text>
                </xsl:attribute>
            </xsl:if>
            <head>
                <meta name="viewport" content="width=750"/>
                <meta http-equiv="content-language" content="{$lsLanguage}" />
                <link rel="icon" href="favicon.ico"> </link>
                <link rel="SHORTCUT ICON" href="favicon.ico"> </link>
                <title>
                    <xsl:value-of select="sTitle"/>
                </title>
                <meta name="TIMER" content="{Timer}"> </meta>
                <meta name="count" content="{count(//Subobj)}" > </meta>
                <xsl:apply-templates select="meta" mode="copy"/>
                <xsl:apply-templates select="." mode="style" />
                <xsl:apply-templates select="." mode="addstyle"/>
                <style type="text/css" media="print">
                    #ancestor {display: none;}
                </style>
                <style type="text/css">
                    @media screen and (min-width: 900px){
                    #ancestortext {display: none;}
                    }
                    <xsl:choose>
                        <xsl:when test="pgcolor != ''">
                            <xsl:text>.white {background: </xsl:text>
                            <xsl:value-of select="pgcolor"/>
                            <xsl:text>; filter: alpha(opacity=75); opacity: 0.75;}
              .pad {background: </xsl:text>
                            <xsl:value-of select="pgcolor"/>;}
                        </xsl:when>
                        <xsl:otherwise>
                            .white {background: #ffffff; filter: alpha(opacity=75); opacity: 0.75;}
                            .pad {background: white;}
                        </xsl:otherwise>
                    </xsl:choose>
                    .gradient {
                    <xsl:choose>
                        <xsl:when test="/ShowPage/Agent[.='Firefox' and substring-before(@version,'.') &lt; 4]">
                            height: 710px; background-color: <xsl:value-of select="$bg"/>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:call-template name="gradient">
                                <xsl:with-param name="bg" select="$bg" />
                                <xsl:with-param name="pd" select="$pd" />
                            </xsl:call-template>
                        </xsl:otherwise>
                    </xsl:choose>
                    }
                    .hide {color: <xsl:choose>
                        <xsl:when test="pgcolor !=''">
                            <xsl:value-of select="pgcolor"/>
                        </xsl:when>
                        <xsl:otherwise>
                            #fefefe
                        </xsl:otherwise>
                    </xsl:choose>;}
                    .noul {text-decoration: none;}
                </style>

                <xsl:apply-templates select="Richtext/style|Richtext/p/style" mode="richtextstyle"/>
                <script language="JavaScript" type="text/javascript">
                    var excanvas = false;
                </script>
                <xsl:if test="count(//canvas) and /ShowPage/Agent[.='MSIE' and @version &lt; '9.0']">
                    <script language="JavaScript" type="text/javascript">
                        excanvas = true;
                    </script>
                    <script language="JavaScript" type="text/javascript" src="excanvas.js">
                        ()
                    </script>

                </xsl:if>
                <xsl:if test="count(/ShowPage/script)">
                    <script language="JavaScript" type="text/javascript">
                        <xsl:value-of select="/ShowPage/script"/>
                    </script>
                </xsl:if>
                <xsl:apply-templates select="." mode="script"/>
            </head>
            <body rightmargin="0" topmargin="0" leftmargin="0" bottommargin="0">
                <xsl:apply-templates select="." mode="books"/>
                <div title="{$lsBackgroundImage}">
                    <xsl:attribute name="style">
                        <xsl:text>left: 0px; position: absolute; TOP: 40px; z-index: 0; width:100%; height: 90px;background-image: url(</xsl:text>
                        <xsl:choose>
                            <xsl:when test="sImage != ''">
                                <xsl:value-of select="ImgDir"/>
                                <xsl:apply-templates select="sImage"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="ImgDir"/>
                                <xsl:text>books.jpg</xsl:text>
                            </xsl:otherwise>
                        </xsl:choose>
                        <xsl:text>);  background-position: left center;</xsl:text>
                    </xsl:attribute>
                    <xsl:text> </xsl:text>
                </div>
                <table id="block" border="0" cellspacing="0" cellpadding="0" 
                       style="left: 0px; position: absolute; top: 0px; z-index: 1; width: 100%; height: 100%; min-height: 500px;">
                    <tbody>
                        <!-- ################# Header ################### -->

                        <tr bgcolor="{$bg}">
                            <td height="40" title="{count(//Subobj)}: {/ShowPage/Timer}">
                                <xsl:apply-templates select="/ShowPage/LeftTop" mode="background"/>
                            </td>
                            <td class="pad" >
                                <xsl:apply-templates select="/ShowPage/BackgroundTop" mode="background"/>
                                <xsl:apply-templates select="@super" mode="Oben">
                                    <xsl:with-param name="hide" select="$hide"/>
                                    <xsl:with-param name="title" select="$title"/>
                                    <xsl:with-param name="addmenu" select="$addmenu"/>
                                </xsl:apply-templates>
                            </td>
                            <td>
                                <xsl:apply-templates select="/ShowPage/RightTop" mode="background"/>
                                <table width="100%">
                                    <tbody>
                                        <tr>
                                            <td/>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>

                        <!-- ################# Title ############## -->
                        <tr style="height: 90px;">
                            <td/>
                            <td>
                                <table border="0" cellspacing="0" cellpadding="0" height="100%">
                                    <xsl:choose>
                                        <xsl:when test="/ShowPage/Agent='MSIE'">
                                            <xsl:attribute name="width">100%</xsl:attribute>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <xsl:attribute name="width">700</xsl:attribute>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                    <tr>
                                        <td style="vertical-align:top; height:90px;" class="white">
                                            <table border="0" width="100%" cellspacing="10" cellpadding="0">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <xsl:apply-templates select="." mode="MainTitle"/>
                                                        </td>
                                                        <xsl:if test="count(Logo)!=0">
                                                            <td style="text-align: right;">
                                                                <a>
                                                                    <xsl:if test="count(Logo/@link)">
                                                                        <xsl:attribute name="href">
                                                                            <xsl:value-of select="Logo/@link"/>
                                                                        </xsl:attribute>
                                                                    </xsl:if>
                                                                    <img align="right" alt="{Logo/@alt}" border="0">
                                                                        <xsl:attribute name="src">
                                                                            <xsl:if test="not(contains(Logo,'/'))">
                                                                                <xsl:value-of select="ImgDir"/>
                                                                            </xsl:if>
                                                                            <xsl:value-of select="Logo"/>
                                                                        </xsl:attribute>
                                                                    </img>
                                                                </a>
                                                            </td>
                                                        </xsl:if>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td>&#160;</td>
                        </tr>
                        <!-- ################# Body ############ -->
                        <tr>
                            <!-- ############### Body Left ############ -->
                            <td class="gradient">
                                <xsl:apply-templates select="/ShowPage/Left" mode="background"/>
                            </td>
                            <!-- ############## Body Center ########### -->
                            <td style="vertical-align: top;" class="pad" id="baseT" width="700">
                                <table border="0" cellspacing="0" cellpadding="10" height="100%" style="width: 700px; height: 100%">
                                    <tr>
                                        <td style="vertical-align: top;" class="pad">
                                            <xsl:apply-templates select="/ShowPage/Background" mode="background"/>
                                            <xsl:choose>
                                                <xsl:when test="Modus='ticket' and sTemplate != 'Analyse.xsl'">
                                                    <!-- dummy only-->
                                                    <table border="0" cellspacing="3" cellpadding="0">
                                                        <tr>
                                                            <td>
                                                                <a href="?f={@id}&amp;INFO={Ticket}&amp;m=all&amp;device=IE50">
                                                                    <xsl:value-of select="$lsExportURL"/>
                                                                </a>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <a href=".?f={@id}">
                                                                    <xsl:value-of select="$lsBack"/>
                                                                </a>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </xsl:when>
                                                <xsl:when test="$TitleOnly!=''">
                                                    <xsl:apply-templates select="." mode="Untergeordnet"/>
                                                </xsl:when>
                                                <xsl:when test="not(contains(sTemplate,'.xsl'))">
                                                    <xsl:variable name="type" select="translate(substring-after(sName,'.'),'JPENGIF','jpengif')"/>
                                                    <p>
                                                        <a class="tool">
                                                            <xsl:attribute name="href">
                                                                <xsl:text>?f=</xsl:text>
                                                                <xsl:value-of select="@id"/>
                                                                <xsl:choose>
                                                                    <xsl:when test="Modus='version'">
                                                                        <xsl:text>&amp;m=version&amp;ex=</xsl:text>
                                                                        <xsl:value-of select="ex"/>
                                                                    </xsl:when>
                                                                    <xsl:when test="count(sTemplate[.='PrivateFile']) > 0 and ($type='gif' or $type='jpg' or $type='jpeg' or $type='png')">
                                                                        <xsl:text>&amp;v=imgview.xsl</xsl:text>
                                                                    </xsl:when>
                                                                </xsl:choose>
                                                            </xsl:attribute>
                                                            <xsl:value-of select="sTitle"/>
                                                            <xsl:if test="Modus='version'">
                                                                <xsl:text> (</xsl:text>
                                                                <xsl:value-of select="@time"/>
                                                                <xsl:text>) </xsl:text>
                                                            </xsl:if>
                                                        </a>
                                                    </p>
                                                    <xsl:apply-templates select="." mode="Untergeordnet"/>
                                                    <xsl:apply-templates select="." mode="MainFooter" />
                                                </xsl:when>
                                                <xsl:otherwise>
                                                    <xsl:apply-templates select="." mode="content" />
                                                    <xsl:apply-templates select="." mode="Untergeordnet"/>
                                                    <xsl:apply-templates select="." mode="additems"/>
                                                    <xsl:apply-templates select="." mode="MainFooter" />
                                                </xsl:otherwise>
                                            </xsl:choose>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <!-- ############### Body Right ############### -->
                            <td class="gradient">
                                <xsl:apply-templates select="/ShowPage/Right" mode="background"/>
                                <xsl:apply-templates select="." mode="ancestor"/>
                                <xsl:apply-templates select="." mode="comment"/>
                            </td>
                        </tr>
                        <!-- ################# Footer 1 ############ -->
                        <tr>
                            <td colspan="3">
                                <xsl:attribute name="style">
                                    <xsl:text>height: 20px; background-image: url(</xsl:text>
                                    <xsl:choose>
                                        <xsl:when test="sImage != ''">
                                            <xsl:value-of select="ImgDir"/>
                                            <xsl:apply-templates select="sImage"/>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <xsl:value-of select="ImgDir"/>
                                            <xsl:text>books.jpg</xsl:text>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                    <xsl:text>);  background-position: left center;</xsl:text>
                                </xsl:attribute>
                            </td>
                        </tr>
                        <!-- ################# Footer 2 ############# -->
                        <tr bgcolor="{$pd}">
                            <td width="70">
                                <xsl:apply-templates select="LeftBottom" mode="background"/>
                            </td>
                            <td class="pad" height="20" width="700">
                                <xsl:apply-templates select="BackgroundBottom" mode="background"/>
                                <div class="white"
                                     style="height: 20px; width: 100%; position: relative; top: -20px; z-index: 400;"></div>
                                <div id="footer"  style="height: 20px; width: 680px; position: relative; left: 10px; top: -15px; z-index: 400; " class="fs10">
                                    <xsl:apply-templates select="." mode="LogonUser"/>
                                    <xsl:if test="($lsTemplateSelected='Section.xsl' or $lsFooterEdit = 'true') and count(ListOption/@new) =0">
                                        <xsl:apply-templates select="." mode="footeredit" />
                                    </xsl:if>
                                    <xsl:apply-templates select="." mode="ancestortext"/>
                                </div>
                            </td>
                            <td>
                                <xsl:apply-templates select="/ShowPage/RightBottom" mode="background"/>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <xsl:if test="count(/ShowPage/onload)">
                    <script>
                        <xsl:value-of select="/ShowPage/onload"/>
                    </script>
                </xsl:if>
            </body>
        </html>
    </xsl:template>
    <xsl:template match="ShowPage" mode="content">
        <table cellspacing="0" cellpadding="0" border="0" width="100%">
            <tbody>
                <tr>
                    <td id="baseTD">
                        <xsl:apply-templates select="." mode="MainText" />
                    </td>
                </tr>
            </tbody>
        </table>
    </xsl:template>
    <xsl:template match="ShowPage" mode="MainTitle">
        <div class="title" style="padding-top: 12px; " id="MainTitle">
            <xsl:choose>
                <xsl:when test="mComment/MainTitle != ''">
                    <xsl:for-each select="mComment[count(MainTitle)!=0]">
                        <xsl:sort select="Text/@id" data-type="number" order="descending"/>
                        <xsl:choose>
                            <xsl:when test="position()!=1" />
                            <xsl:when test="count(MainTitle/descendant::node()) > 1">
                                <xsl:apply-templates select="MainTitle" />
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="MainTitle" disable-output-escaping="yes"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:for-each>
                </xsl:when>
                <xsl:when test="Longtitle[.!='' and (count(@lang)=0 or @lang= $lsLanguage)]">
                    <xsl:apply-templates select="Longtitle"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="sTitle"/>
                </xsl:otherwise>
            </xsl:choose>
        </div>
    </xsl:template>
    <xsl:template match="ShowPage" mode="MainFooter">
        <div id="MainFooter">
            <xsl:choose>
                <xsl:when test="mComment/MainFooter != ''">
                    <xsl:for-each select="mComment[count(MainFooter)!=0]">
                        <xsl:sort select="Text/@id" data-type="number" order="descending"/>
                        <xsl:if test="position()=1">
                            <xsl:value-of select="MainFooter" disable-output-escaping="yes"/>
                        </xsl:if>
                    </xsl:for-each>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:apply-templates select="@super" mode="Zusatz"/>
                </xsl:otherwise>
            </xsl:choose>
        </div>
    </xsl:template>
    <xsl:template match="ShowPage" mode="additems">
        <xsl:if test="count(ListOption/@new) &gt; 0 and (contains(Edit/@link,'m=edit') or contains(Edit/@link,'m=append'))">
            <br/>
            <xsl:for-each select="ListOption/@newtext">
                <xsl:choose>
                    <xsl:when test="../@new[. = 'PrivateFile' or .='Xtern']">
                        <a href="javascript:CreatePage({/ShowPage/@id},'{../@new}');" class="tool noul">
                            <xsl:value-of select="."/>
                        </a>
                    </xsl:when>
                    <xsl:otherwise>
                        <a href="?f={/ShowPage/@id}&amp;m=create&amp;v={../@new}" class="tool noul">
                            <xsl:value-of select="."/>
                        </a>
                    </xsl:otherwise>
                </xsl:choose>
                <xsl:text> </xsl:text>
            </xsl:for-each>
        </xsl:if>
    </xsl:template>
    <xsl:template match="@super" mode="Oben">
        <xsl:param name="hide" select="''"/>
        <xsl:param name="title" select="''"/>
        <xsl:param name="addmenu" select="''"/>
        <xsl:param name="usetitle">
            <xsl:choose>
                <xsl:when test="/ShowPage/Modus[.='next' or .='prev']"/>
                <xsl:when test="/ShowPage/Modus[.='nexttitle' or .='prevtitle']">title</xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="$title"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:param>
        <xsl:if test="count(/ShowPage/ListOption/@nosidemenu)=0">
            <xsl:apply-templates select="." mode="sidemenu">
                <xsl:with-param name="hide" select="$hide"/>
                <xsl:with-param name="title" select="$title"/>
            </xsl:apply-templates>
        </xsl:if>

        <div style="height: 40px; position: absolute; width: 690px; z-index: 5000; text-align: right; padding-top: 8px;">
            <xsl:if test="contains($addmenu,'mailer1')">
                <a id="mailer" class="tool hide noul" href="javascript:Mail(1);">
                    <xsl:value-of select="$lsMailer"/>
                </a>
                <xsl:text> </xsl:text>
            </xsl:if>
            <xsl:if test="contains($addmenu,'mailer0')">
                <a id="mailer" class="tool hide noul" href="javascript:Mail(0);">
                    <xsl:value-of select="$lsMailer"/>
                </a>
                <xsl:text> </xsl:text>
            </xsl:if>
            <xsl:if test="contains($addmenu,'|')">
                <xsl:variable name="t" select="substring-before($addmenu,'|')"/>
                <a id="{$t}" class="tool hide noul" href="{substring-after($addmenu,'|')}">
                    <xsl:value-of select="$t"/>
                </a>
                <xsl:text> </xsl:text>
            </xsl:if>
            <xsl:apply-templates select="." mode="standard">
                <xsl:with-param name="hide" select="$hide"/>
            </xsl:apply-templates>
            <xsl:if test="//ShowPage/LogonUser != '' and not(contains($hide,'comment'))">
                <a class="tool noul" href="{//ShowPage/Script}?f={../@id}&amp;m=comment">
                    <xsl:value-of select="$lsComment"/>
                </a>
                <xsl:text> </xsl:text>
            </xsl:if>
            <xsl:choose>
                <xsl:when test="contains(../Edit/@link,'m=edit')">
                    <xsl:if test="count(../Subobj)=0 and not(contains($hide,'delete'))">
                        <a class="tool noul" href="{/ShowPage/Script}?f={../@id}&amp;m=delete">
                            <xsl:value-of select="$lsDeleteSection"/>
                        </a>
                        <xsl:text> </xsl:text>
                    </xsl:if>
                    <xsl:if test="not(contains($hide,'append'))">
                        <a class="tool noul">
                            <xsl:attribute name="href">
                                <xsl:apply-templates select="." mode="new_oben"/>
                            </xsl:attribute>
                            <xsl:value-of select="$lsAppendPage"/>
                        </a>
                        <xsl:text> </xsl:text>
                    </xsl:if>
                    <a class="tool noul" href="javascript:EditPage('{/ShowPage/@id}')">
                        <xsl:value-of select="$lsEditSection"/>
                    </a>
                    <xsl:text> </xsl:text>
                </xsl:when>
                <xsl:when test="contains(../Edit/@link,'m=append') and not(contains($hide,'append'))">
                    <a class="tool noul">
                        <xsl:attribute name="href">
                            <xsl:value-of select="//ShowPage/Script"/>
                            <xsl:text>?f=</xsl:text>
                            <xsl:value-of select="../@id"/>
                            <xsl:text>&amp;m=create&amp;v=</xsl:text>
                            <xsl:apply-templates select="." mode="new"/>
                        </xsl:attribute>
                        <xsl:value-of select="$lsAppendPage"/>
                    </a>
                    <xsl:text disable-output-escaping="yes"> </xsl:text>
                </xsl:when>
            </xsl:choose>
            <xsl:if test="/ShowPage[@name!='index' and @id != @idmicro] and not(contains($hide,'next'))">
                <a class="tool noul" href="{/ShowPage/Script}?f={../@id}&amp;m=prev{$usetitle}&amp;ex={.}">
                    <xsl:value-of select="$lsPrevSect"/>
                </a>
                <xsl:text> </xsl:text>
                <a class="tool noul" href="{/ShowPage/Script}?f={../@id}&amp;m=next{$usetitle}&amp;ex={.}">
                    <xsl:value-of select="$lsNextSect"/>
                </a>
                <xsl:text disable-output-escaping="yes"> </xsl:text>
            </xsl:if>
            <!--   
        </td></tr>
      </table>
      -->
        </div>

    </xsl:template>
    <xsl:template match="@super" mode="standard">
        <xsl:param name="hide" select="''"/>
        <xsl:choose>
            <xsl:when test="/ShowPage[@name!='index' and @id != @idmicro]">
                <xsl:if test="not(contains($hide,'home'))">
                    <a class="tool noul">
                        <xsl:attribute name="href">
                            <xsl:value-of select="/ShowPage/Script"/>
                            <xsl:text>?f=</xsl:text>
                            <xsl:call-template name="index" />
                        </xsl:attribute>
                        <xsl:value-of select="$lsHome"/>
                    </a>
                    <xsl:text> </xsl:text>
                </xsl:if>
                <a class="tool noul">
                    <xsl:attribute name="href">
                        <xsl:call-template name="up-href"/>
                    </xsl:attribute>
                    <xsl:value-of select="$lsUp"/>
                </a>
                <xsl:text> </xsl:text>
            </xsl:when>
            <xsl:when test="string-length(/ShowPage/LogonUser)">
                <a class="tool noul" href="{/ShowPage/Script}">
                    <xsl:value-of select="$lsWelcome"/>
                    <xsl:apply-templates select="/ShowPage/LogonUser" mode="polling"/>
                </a>
            </xsl:when>
        </xsl:choose>
        <xsl:text> </xsl:text>
        <xsl:if test="not(contains($hide,'new'))">
            <a class="tool noul">
                <xsl:attribute name="href">
                    <xsl:call-template name="new-href"/>
                </xsl:attribute>
                <xsl:value-of select="$lsNew"/>
            </a>
            <xsl:text> </xsl:text>
        </xsl:if>
        <xsl:if test="not(contains($hide,'map'))">
            <a class="tool noul">
                <xsl:attribute name="href">
                    <xsl:call-template name="map-href"/>
                </xsl:attribute>
                <xsl:choose>
                    <xsl:when test="/ShowPage/@name='indexmap'">
                        <xsl:value-of select="$lsTreeview"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="$lsSitemap"/>
                    </xsl:otherwise>
                </xsl:choose>
            </a>
            <xsl:text> </xsl:text>
        </xsl:if>
        <xsl:if test="not(contains($hide,'search'))">
            <a class="tool noul">
                <xsl:attribute name="href">
                    <xsl:call-template name="search-href"/>
                </xsl:attribute>
                <xsl:value-of select="$lsSearch"/>
            </a>
            <xsl:text> </xsl:text>
        </xsl:if>
    </xsl:template>
    <xsl:template match="@super" mode="new_oben">
        <xsl:value-of select="/ShowPage/Script"/>
        <xsl:text>?f=</xsl:text>
        <xsl:value-of select="../@id"/>
        <xsl:text>&amp;m=create&amp;v=</xsl:text>
        <xsl:apply-templates select="." mode="new"/>
    </xsl:template>
    <xsl:template match="ShowPage" mode="Untergeordnet">
        <xsl:apply-templates select="." mode="NoTitle"/>
        <xsl:if test="count(sTitle)">
            <table border="0" cellspacing="0" cellpadding="0" width="680" id="untergeordnet">
                <tbody>
                    <xsl:choose>
                        <xsl:when test="count(ListOption/@reverse)">
                            <xsl:apply-templates select="Subobj">
                                <xsl:sort data-type="number" select="@sort" order="descending"/>
                            </xsl:apply-templates>
                        </xsl:when>
                        <xsl:when test="count(ListOption/@stitle)">
                            <xsl:apply-templates select="Subobj">
                                <xsl:sort select="sTitle"/>
                            </xsl:apply-templates>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:apply-templates select="Subobj"/>
                        </xsl:otherwise>
                    </xsl:choose>
                    <xsl:if test="count(ListOption/@new)=0">
                        <xsl:apply-templates select="." mode="append"/>
                    </xsl:if>
                </tbody>
            </table>
        </xsl:if>
    </xsl:template>
    <xsl:template match="ShowPage" mode="append">
        <xsl:if test="contains(Edit/@link,'m=edit') or contains(Edit/@link,'m=append')">
            <xsl:call-template name="append"/>
            <xsl:call-template name="append">
                <xsl:with-param name="link">
                    <xsl:text>javascript:CreatePage(</xsl:text>
                    <xsl:value-of select="@id"/>
                    <xsl:text>,'</xsl:text>
                    <xsl:apply-templates select="@super" mode="new"/>
                    <xsl:text>');</xsl:text>
                </xsl:with-param>
                <xsl:with-param name="title">
                    <xsl:value-of select="$lsAppendPageTitle"/>
                </xsl:with-param>
            </xsl:call-template>
            <!--
            <xsl:call-template name="append">
                <xsl:with-param name="link">
                    <xsl:text>javascript:CreatePage(</xsl:text>
                    <xsl:value-of select="@id"/>
                    <xsl:text>,'</xsl:text>
                    <xsl:apply-templates select="@super" mode="new"/>
                    <xsl:text>');</xsl:text>
                </xsl:with-param>
                <xsl:with-param name="title">
                    <xsl:value-of select="$lsAppendPage"/>
                </xsl:with-param>
                <xsl:with-param name="link2">
                    <xsl:text>javascript:CreatePage(</xsl:text>
                    <xsl:value-of select="@id"/>
                    <xsl:text>,'PrivateFile');</xsl:text>
                </xsl:with-param>
                <xsl:with-param name="title2">
                    <xsl:value-of select="$lsNewFile"/>
                </xsl:with-param>
                <xsl:with-param name="link2">
                    <xsl:text>javascript:CreatePage(</xsl:text>
                    <xsl:value-of select="@id"/>
                    <xsl:text>,'Xtern');</xsl:text>
                </xsl:with-param>
                <xsl:with-param name="title2">
                    <xsl:value-of select="$lsNewLink"/>
                </xsl:with-param>
                <xsl:with-param name="link3">
                    <xsl:text>?f=</xsl:text>
                    <xsl:value-of select="@id"/>
                    <xsl:text>&amp;m=xcopy&amp;ex=1</xsl:text>
                </xsl:with-param>
                <xsl:with-param name="title3">
                    <xsl:value-of select="$lsCopyPage"/>
                </xsl:with-param>
            </xsl:call-template>
-->
        </xsl:if>
    </xsl:template>
    <xsl:template name="append">
        <xsl:param name="link" select="''"/>
        <xsl:param name="title" select="''"/>
        <xsl:param name="onclick" select="''" />
        <xsl:param name="link2" select="''" />
        <xsl:param name="title2" select="''" />
        <xsl:param name="link3" select="''" />
        <xsl:param name="title3" select="''" />
        <xsl:param name="link4" select="''" />
        <xsl:param name="title4" select="''" />
        <tr class="appendmenu">
            <xsl:choose>
                <xsl:when test="$title=$lsAppendComplex">
                    <script>
                        function doit(ctrl){
                        var id = <xsl:value-of select="/ShowPage/@id"/>;
                        switch(ctrl.selectedIndex){
                        case 1: CreatePage(id,'Section.xsl'); break;
                        case 2: CreatePage(id,'PrivateFile'); break;
                        case 3: CreatePage(id,'Xtern'); break;
                        default: ctrl.form.submit();
                        }
                        }
                    </script>
                    <td style="width:23px;{$tdstyle}">
                        <img border="0" width="20" height="16" alt="{$lsPageGif}" src="{/ShowPage/ImgDir}DynClose.gif" 
                            style="vertical-align: top; margin-top: 4px;"/>
                    </td>
                    <td style="vertical-align: middle; white-space: nowrap;" class="under">
                        <form method="get" action="{/ShowPage/SysURL}">
                            <xsl:value-of select="$title"/>
                            <xsl:text>&#160;</xsl:text>
                            <xsl:variable name="color">
                                <xsl:choose>
                                    <xsl:when test="count(/ShowPage/text) = 0">
                                        <xsl:text>#000000;</xsl:text>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <xsl:value-of select="/ShowPage/text"/>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </xsl:variable>
                            <select name="f" onchange="doit(this);" 
                                style="width: 220px; border: 1px #888888 dotted;background-color: transparent;color: {$color} ">
                                <option>...</option>
                                <option>
                                    <xsl:value-of select="$lsNewPage"/>
                                </option>
                                <option>
                                    <xsl:value-of select="$lsNewFile"/>
                                </option>
                                <option>
                                    <xsl:value-of select="$lsNewLink"/>
                                </option>
                                <xsl:for-each select="/ShowPage/Options/sTemplate[not(contains(@id,'.xsl')) and not(starts-with(.,'--'))]">
                                    <option value="{@id}">
                                        <xsl:value-of select="."/>
                                    </option>
                                </xsl:for-each>
                            </select>
                            <input type="hidden" name="param" value="{/ShowPage/@id}"/>
                            <input type="hidden" name="m" value="xcopy"/>
                            <input type="hidden" name="next" value="new" />
                        </form>
                    </td>
                </xsl:when>
                <xsl:when test="$title = $lsAppendPageTitle">
                    <td style="width:23px;{$tdstyle}">
                        <img border="0" width="20" height="16" alt="{$lsPageGif}" src="{/ShowPage/ImgDir}DynClose.gif" 
                            style="vertical-align: top; margin-top: 4px;"/>
                    </td>
                    <td style="vertical-align: middle; white-space: nowrap;" class="under">
                        <form method="post" action="?f={/ShowPage/@id}&amp;m=create">
                            <xsl:variable name="color">
                                <xsl:choose>
                                    <xsl:when test="count(/ShowPage/text) = 0">
                                        <xsl:text>#000000;</xsl:text>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <xsl:value-of select="/ShowPage/text"/>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </xsl:variable>
                            <input type="text" name="sTitle" id="sTitle" autofocus="autofocus" 
                                style="width: 250px; border: 1px #888888 dotted;background-color: transparent;color: {$color} "/>
                            <xsl:text>&#160;</xsl:text>
                            <input type="submit" value="{$lsAppendPageTitle}"/>
                            <input type="hidden" name="f" value="{/ShowPage/@id}"/>
                            <input type="hidden" name="m" value="create"/>
                            <input type="hidden" name="sTemplate" value="Section.xsl"/>
                            <input type="hidden" name="bSave" value="bSave"/>
                            <input type="hidden" name="sNextEdit" value="Super"/>
                        </form>
                        <xsl:text>&#160;</xsl:text>
                        <form name="addform" method="post" enctype="multipart/form-data"
                              action="?f={/ShowPage/@id}&amp;m=create&amp;v=PrivateFile&amp;next=Super">
                            <div style="display: inline; width: 130px; overflow: hidden;">
                                <input type="file" name="sUpload" multiple="multiple" 
                                       style="width: 120px; height: 23px;position: relative; left: 0px; top: 0px; z-index: 200;
                                   -moz-opacity:0; filter:alpha(opacity: 0);  opacity: 0;"
                                    onchange="this.form.submit();" size="20" />
                                <input type="button" value="{$lsUploadFiles}" 
                                    style="position: relative; left: -120px; top: 0px; z-index:100; width: 120px;"/>
                            </div>

                        </form>
                    </td>


                </xsl:when>
                <xsl:when test="$link != ''">
                    <td  style="width: 23px; {$tdstyle}">
                        <a href="{$link}" onclick="{$onclick}">
                            <img border="0" width="20" height="16" alt="{$lsPageGif}" src="{/ShowPage/ImgDir}DynClose.gif"/>
                        </a>
                    </td>
                    <td class="under" style="width: 657px; {$tdstyle}" >
                        <a style="text-decoration: none;" href="{$link}" onclick="{$onclick}">
                            <xsl:value-of select="$title"/>
                        </a>
                        <xsl:text>&#160;</xsl:text>
                        <xsl:if test="$link2 != ''">
                            <xsl:text>|&#160;</xsl:text>
                            <a style="text-decoration: none;" href="{$link2}">
                                <xsl:value-of select="$title2"/>
                            </a>
                            <xsl:text>&#160;</xsl:text>
                        </xsl:if>
                        <xsl:if test="$link3 != ''">
                            <xsl:text>|&#160;</xsl:text>
                            <a style="text-decoration: none;" href="{$link3}">
                                <xsl:value-of select="$title3"/>
                            </a>
                            <xsl:text>&#160;</xsl:text>
                        </xsl:if>
                        <xsl:if test="$link4 != ''">
                            <xsl:text>|&#160;</xsl:text>
                            <a style="text-decoration: none;" href="{$link4}">
                                <xsl:value-of select="$title4"/>
                            </a>
                        </xsl:if>
                    </td>
                </xsl:when>
                <xsl:otherwise>
                    <td colspan="2" style="{$tdstyle}">
                        <hr style="height: 0px; width: 250px; margin-left: 0px; margin-right: 428px;"/>
                    </td>
                </xsl:otherwise>
            </xsl:choose>
        </tr>
    </xsl:template>
    <xsl:template match="ShowPage" mode="NoTitle">
        <xsl:if test="count(param[.='nooutlinesynch'])=0">
            <script language="JavaScript" type="text/javascript">
                <![CDATA[
			    if(self.name == 'new_23' && top.frames.length){
		    ]]>
                var myString = top.frames[0].location.href;
                var myArray = myString.split('&amp;%70ara=');
                top.frames[0].location.href = myArray[0] + '&amp;' + '%70ara=<xsl:value-of select="/ShowPage/@id"/>#focus';
                }

            </script>
        </xsl:if>
        <xsl:if test="count(sTitle)=0">
            <form method="post" name="settitle" action="{Script}?f={@id}&amp;m=update" onsubmit="CheckEmpty(this.sTitle)">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tbody>
                        <tr>
                            <td style="width: 23px;"/>
                            <td>
                                <input type="text" name="sTitle" id="sTitle" size="60" onfocus="ResetEmpty(this);"
                                       style="font-style: italic; color: #888888; width: 600px;" value="{$lsEnterTitle}"/>
                                <br/>
                            </td>
                            <td>
                                <input type="submit" value="{$lsSubmit}"/>
                                <!-- Pflicht -->
                                <input type="hidden" name="bSave" value="bSave"/>
                                <input type="hidden" name="sName" value="{@name}"/>
                                <!-- optional -->
                                <!-- Ende -->
                            </td>
                        </tr>
                        <xsl:apply-templates select="." mode="NoTitleAdd" />
                    </tbody>
                </table>
            </form>
            <script>
                document.getElementById("sTitle").focus();
            </script>
        </xsl:if>
    </xsl:template>
    <xsl:template match="ShowPage" mode="NoTitleAdd">
        <tr>
            <td />
            <td>
                <!-- Pflicht -->
                <select name="sTemplate" style="margin-left: 0px;">
                    <option value="{$lsTemplateSelected}" select="selcted">
                        <xsl:value-of select="$lsTemplateSelected"/>
                    </option>
                    <option value="Section.xsl">
                        <xsl:value-of select="$lsSectionXsl"/>
                    </option>
                    <option value="Blank.xsl">
                        <xsl:value-of select="$lsBlankXsl"/>
                    </option>
                    <option value="NoSection.xsl">
                        <xsl:if test="$lsTemplateSelected = 'NoSection.xsl'">
                            <xsl:attribute name="selected">selected</xsl:attribute>
                        </xsl:if>
                        <xsl:value-of select="$lsNoSection"/>
                    </option>
                    <option value="NoTitle.xsl">
                        <xsl:if test="$lsTemplateSelected = 'NoTitle.xsl'">
                            <xsl:attribute name="selected">selected</xsl:attribute>
                        </xsl:if>
                        <xsl:value-of select="$lsNoTitle"/>
                    </option>
                </select>
                <!-- -->
                ... <xsl:value-of select="$lsAnd"/><xsl:text> </xsl:text><xsl:value-of select="$lsShowSuper"/>
                <input type="checkbox" name="next" checked="checked" value="Super"/>
            </td>
        </tr>

    </xsl:template>
    <xsl:template match="object[@type='application/x-shockwave-flash']">
        <xsl:if test="count(/ShowPage/Agent[.='iPhone'])=0">
            <object>
                <xsl:apply-templates select="@*" mode="copy"/>
                <xsl:apply-templates/>
            </object>
        </xsl:if>
    </xsl:template>
    <xsl:template match="/">
        <xsl:apply-templates select="ShowPage" mode="block">
            <xsl:with-param name="hide">append</xsl:with-param>
        </xsl:apply-templates>
    </xsl:template>
    <xsl:template match="ShowPage" mode="addstyle">
        <style>
            td.under a.status  {visibility: hidden;}
            td.under:hover a.status {visibility: visible;}
        </style>
    </xsl:template>
    <xsl:param name="lsSectionXsl">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">标准页</xsl:when>
            <xsl:when test="$lsLanguage='de'">Standardseite</xsl:when>
            <xsl:otherwise>Standard page</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsBlankXsl">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">白页</xsl:when>
            <xsl:when test="$lsLanguage='de'">Leere Seite</xsl:when>
            <xsl:otherwise>Blank page</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="ls3Col">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">3列</xsl:when>
            <xsl:when test="$lsLanguage='de'">3 Spalten</xsl:when>
            <xsl:otherwise>3 columns</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsNoTitle">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">无标题</xsl:when>
            <xsl:when test="$lsLanguage='de'">Ohne Titel</xsl:when>
            <xsl:otherwise>No Title</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsNoSection">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">无编号</xsl:when>
            <xsl:when test="$lsLanguage='de'">Ohne Nummerierung</xsl:when>
            <xsl:otherwise>No Section/Number</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsAppendLink">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">增添一链接</xsl:when>
            <xsl:when test="$lsLanguage='de'">Anfügen eines Links</xsl:when>
            <xsl:otherwise>Add a link</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsMailer">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">邮寄</xsl:when>
            <xsl:otherwise>E-mail</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsAppendComplex">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">增添: </xsl:when>
            <xsl:when test="$lsLanguage='de'">Anfügen: </xsl:when>
            <xsl:otherwise>Add: </xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsAppendPageTitle">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">增添题目</xsl:when>
            <xsl:when test="$lsLanguage='de'">Anfügen eines Titels</xsl:when>
            <xsl:otherwise>Add a new title</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsNewPage">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">新一页</xsl:when>
            <xsl:when test="$lsLanguage='de'">Seite</xsl:when>
            <xsl:otherwise>page</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsNewFile">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">新文件</xsl:when>
            <xsl:when test="$lsLanguage='de'">Datei</xsl:when>
            <xsl:otherwise>file</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsNewLink">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">新链接</xsl:when>
            <xsl:when test="$lsLanguage='de'">Link</xsl:when>
            <xsl:otherwise>link</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsUploadFiles">
        <xsl:choose>
            <xsl:when test="$lsLanguage='zh-cn'">文件上传</xsl:when>
            <xsl:when test="$lsLanguage='de'">Dateien uploaden</xsl:when>
            <xsl:otherwise>Upload files</xsl:otherwise>
        </xsl:choose>
    </xsl:param>
    <xsl:param name="lsFooterEdit"></xsl:param>
    <xsl:param name="lsTemplateSelected">Section.xsl</xsl:param>

</xsl:stylesheet>
