<?xml version="1.0" encoding="cp866"?>
<xsl:stylesheet version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:dt="urn:schemas-microsoft-com:datatypes"
	xmlns:user="demon:xslt-function"
	xmlns:msxsl="urn:schemas-microsoft-com:xslt"
>
  <xsl:output omit-xml-declaration="yes" indent="yes"/>
  
  <xsl:template match="/">
    <div>
      <xsl:apply-templates select="//server" />
    </div>
  </xsl:template>

  <xsl:template match="server">
    <table id="ttitle">
      <tr>
        <td id="namecell">
          <xsl:value-of select="@name"/>
        </td>
      </tr>
      <tr>
        <td id="desccell">
          <xsl:value-of select="@desc"/>
        </td>
      </tr>
    </table>
    
    <table id="tdetails" cellspacing="1">
      <tr>
        <td rowspan="4" id="imgcell">
          <img id="mimg" src="img/nomap.png" />
        </td>
        <td id="mapcell">
          <div><xsl:value-of select="@map"/></div></td>
      </tr>
      <tr>        
        <td id="playerscell">Players: <span class="players"><xsl:value-of select="@players"/>/<xsl:value-of select="@playersmax"/></span>
          <xsl:if test="number(@bots)&gt;0">
        <![CDATA[ ]]>(<xsl:value-of select="@bots"/><![CDATA[ bot]]><xsl:if test="number(@bots)!=1">s</xsl:if>)
            </xsl:if></td>
      </tr>
      <tr>        
        <td id="detailscell">
          <xsl:if test="@secure='1'"><img src="img/VAC.png" /><![CDATA[ VAC]]></xsl:if>
          <xsl:if test="@password='1'"><xsl:if test="@secure='1'"><![CDATA[    ]]></xsl:if>
            <img src="img/PASS.png" /><![CDATA[ Password]]>
          </xsl:if>
        </td>
      </tr>
      <tr>        
        <td id="actionscell">
          <input id="connb" type="button" value="Connect">
            <xsl:attribute name="onclick">
            connect('<xsl:value-of select="@address"/>');
          </xsl:attribute>            
          </input>
          
          <input id="connb" type="button" value="Close">
            <xsl:attribute name="onclick">
            closeflayout();
          </xsl:attribute>            
          </input>
        </td>
      </tr>
    </table>
    
  </xsl:template>
</xsl:stylesheet>