+
+<xsl:template match="mowgli:change-frame-settings">
+ <br/>
+ <p>
+ <xsl:choose>
+ <xsl:when test="$use_frames = 'yes'">
+ [<a href="../html_no_frames" target="_top">No frames</a>]
+ </xsl:when>
+ <xsl:otherwise>
+ [<a href="{$path_to_top}/../html_yes_frames" target="_top">Frames</a>]
+ </xsl:otherwise>
+ </xsl:choose>
+ </p>
+</xsl:template>
+
+<xsl:template name="a_menu">
+ <xsl:copy>
+ <xsl:choose>
+ <xsl:when test="starts-with(@href,'/') or
+ starts-with(@href,'http://') or
+ starts-with(@href,'mailto:')">
+ <xsl:copy-of select="@href"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="href">
+ <xsl:value-of select="$path_to_top"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="@href"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:value-of select="text()"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template mode="menu" match="*|text()|@*">
+ <xsl:choose>
+ <xsl:when test="name(.) = 'a'">
+ <xsl:call-template name="a_menu"/>
+ </xsl:when>
+ <xsl:when test="name(.) = 'mowgli:change-frame-settings'">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy>
+ <xsl:apply-templates mode="menu" select="*|text()|@*"/>
+ </xsl:copy>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+