<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns=''>
<xsl:output method="html" version="1.0" indent="yes" encoding="ISO-8859-1"/>

<xsl:template match="/">
<xsl:apply-templates select="location" /></xsl:template>

<xsl:template match="location">
    <div style="padding-right: 8px; margin-top: 2px; width:30em;">
        <xsl:apply-templates select="info" />
    </div>
</xsl:template>

<xsl:template match="img">
    <td>
    <xsl:attribute name="style">
            <xsl:if test = "not(position()=1)">display:none</xsl:if>
        </xsl:attribute>
        <img style="width:104px; height:78px" alt="" >
            <xsl:attribute name="src"><xsl:value-of select="@src" />.jpg</xsl:attribute>
        </img>
    </td>    
</xsl:template>

<xsl:template match="images">
    <td align="left">
        <a>
            <xsl:attribute name="href">javascript:loadStyle('<xsl:value-of select="./../@id" />', <xsl:value-of select="position()" />, "photo")</xsl:attribute>    
            Photos
        </a>
    </td>
<xsl:comment>
    <div style='margin-top: 4px;' align='center'>
        <table style='cursor:pointer'>
            <tr>
                <td id='first_no_photo' align='left' width='30px;' onclick='_showPreviousPicture(this)'>
                    <img style="width:15px; height:15px" alt="">
                        <xsl:attribute name="src">map4_files/icons/zoom-minus.png</xsl:attribute>
                    </img>
                </td>
                <xsl:apply-templates select="./img" />    
                <td id='last_no_photo' align='right' width='30px;' onclick='_showNextPicture(this)'>
                    <img style="width:15px; height:15px" alt="">
                        <xsl:attribute name="src">map4_files/icons/zoom-plus.png</xsl:attribute>
                    </img>
                </td>
            </tr>
        </table>
    </div>
</xsl:comment>
</xsl:template>

<xsl:template match="info" >
    <xsl:variable name="page" select="../@arg0"/>
    <div style='font-size:10pt' align='center'>
        <b>
            <a>
                <xsl:attribute name="href"><xsl:value-of select="../url" /></xsl:attribute>
                <xsl:value-of select="./title" />
            </a>
        </b>
    </div>
    
    <br/>
    <xsl:comment>
    <xsl:apply-templates select="../images" />
    </xsl:comment>
    <br/>
    
    <div style='font-size:9pt'>
        <span>
            <xsl:value-of select="./description" />
        </span>
    </div>
    
    <br/>
    
    <div style='font-size:9pt'>
        <span>
            Price: <xsl:value-of select="format-number(./price, '$###,###.00')" />
        </span>
    </div>
    
    <br/>
    
    <div style='font-size:9pt'>
        <span>
            Address: <xsl:value-of select="./address" />
        </span>
    </div>
    
    <br/>
    
    <div style='font-size:9pt'>
        <span>
            <a>
                <xsl:attribute name="href"><xsl:value-of select="./realtor/@url" /></xsl:attribute>
                Realtor: <xsl:value-of select="./realtor" />
            </a>
        </span>
    </div>
    
    <br/>
    
    <div style='font-size:8pt'>
        <table width="100%">
            <tr>
                <xsl:apply-templates select="../images" />
                <td align="center">
                    <a>
                        <xsl:attribute name="href">javascript:_m.map.closeInfoWindow();_m.map.recenterOrPanToLatLng(new n(<xsl:value-of select="./../point/@lng"/>, <xsl:value-of select="./../point/@lat"/>));showLocationInfo('<xsl:value-of select="./../@id" />')</xsl:attribute>    
                        Recenter
                    </a>
                </td>
                <td align="right">
                    <a>
                        <xsl:attribute name="href">javascript:loadStyle('<xsl:value-of select="./../@id" />', <xsl:value-of select="position()" />, "directions")</xsl:attribute>    
                        Directions
                    </a>
                </td>
            </tr>
        </table>
    </div>

</xsl:template>
</xsl:stylesheet>
