+ <!-- side_proof -->
+ <xsl:when test="$name='side_proof'">
+ <xsl:variable name="nonce" select="generate-id()"/>
+ <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
+ <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
+ <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
+ <xsl:variable name="freshid4" select="concat('d',$nonce)"/>
+ <span ID="{$freshid1}">
+ <xsl:apply-templates select="*[position()=2]">
+ <xsl:with-param name="current_indent" select="$current_indent"/>
+ </xsl:apply-templates>
+  
+ </span>
+ <script>
+ if(document.getElementById) {
+ document.write('\
+ <span ID="{$freshid2}">\
+ <a style="text-decoration:underline ; color:green" href="" onClick="Show(document.getElementById(\'{$freshid1}\')); Hide(document.getElementById(\'{$freshid2}\'));Show(document.getElementById(\'{$freshid3}\'));Show(document.getElementById(\'{$freshid4}\'));return (0==1);">Justification</a>\
+ </span>\
+ <span ID="{$freshid3}">\
+ <br/>\
+ <xsl:call-template name="make_indent">
+ <xsl:with-param name="current_indent" select="$current_indent"/>
+ </xsl:call-template>\
+ <a style="text-decoration:underline ; color:red" href="" onClick="Hide(document.getElementById(\'{$freshid1}\')); Show(document.getElementById(\'{$freshid2}\'));Hide(document.getElementById(\'{$freshid3}\'));Hide(document.getElementById(\'{$freshid4}\'));return (0==1);">we proved</a>\
+ </span>\
+ ');
+ document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
+ document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
+ document.to_be_deleted.push('<xsl:value-of select="$freshid4"/>');
+ document.write(' ');
+ } else {
+ document.write('\
+ <br/>\
+ <xsl:call-template name="make_indent">
+ <xsl:with-param name="current_indent" select="$current_indent"/>
+ </xsl:call-template>\
+ <FONT color="red">we proved </FONT>\
+ ');
+ }
+ </script>
+ <span ID="{$freshid4}">
+ <xsl:apply-templates select="*[position()=3]">
+ <xsl:with-param name="current_indent" select="$current_indent + 16"/>
+ </xsl:apply-templates>
+ </span>
+ </xsl:when>
+ <!-- eq_chain -->
+ <xsl:when test="$name='eq_chain'">
+ <FONT color="red">We have the following equality chain:</FONT>
+ <xsl:for-each select="*[position() mod 2 = 0]">
+ <xsl:variable name="pos" select="position()"/>
+ <br/>
+ <xsl:call-template name="make_indent">
+ <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+ </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="$pos=1">
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+ </xsl:apply-templates>
+ <xsl:text> =</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>= </xsl:text>
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="$pos != last()">
+ <br/>
+ <xsl:call-template name="make_indent">
+ <xsl:with-param name="current_indent" select="$current_indent + 15"/>
+ </xsl:call-template>
+ <xsl:apply-templates select="../*[position()=2*$pos +1]">
+ <xsl:with-param name="current_indent" select="$current_indent + 15"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:when>
+ <!-- diseq_chain -->
+ <xsl:when test="$name='diseq_chain'">
+ <FONT color="red">We have the following chain of disequalities:</FONT>
+ <xsl:for-each select="*[position() mod 3 = 2]">
+ <xsl:variable name="pos" select="position()"/>
+ <br/>
+ <xsl:call-template name="make_indent">
+ <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+ </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="$pos=1">
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+ </xsl:apply-templates>
+ <xsl:text> </xsl:text>
+ <xsl:apply-templates mode="inline" select="../*[position()=3*$pos]"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates mode="inline" select="../*[position()=3*($pos - 1)]"/>
+ <xsl:text> </xsl:text>
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="$pos != last()">
+ <br/>
+ <xsl:call-template name="make_indent">
+ <xsl:with-param name="current_indent" select="$current_indent + 15"/>
+ </xsl:call-template>
+ <xsl:apply-templates select="../*[position()=3*$pos +1]">
+ <xsl:with-param name="current_indent" select="$current_indent + 15"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:when>