<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dyn="http://exslt.org/dynamic" extension-element-prefixes="dyn">
    <xsl:output method="html" indent="no" doctype-system="" />

    <xsl:include href="/app/tools/rps/templates/ajax_request.xsl" />
    <xsl:include href="shared.xsl" />

    <xsl:template name="pickLayout">
        <div class="MainBaseSection">
            <xsl:for-each select="/Root/SaleGroup/Sale">
                <xsl:call-template name="saleRow">
                    <xsl:with-param name="ajax">
                        <xsl:value-of select="/Root/Params/index" />
                    </xsl:with-param>
                </xsl:call-template>
            </xsl:for-each>
        </div>
    </xsl:template>

    <xsl:variable name="saleID" select="/Root/SaleGroup/Sale/SaleID" />

    <xsl:variable name="saleProductType">
        <xsl:choose>
            <xsl:when test="/Root/SaleImportErrorList/SaleImportError[SaleID = $saleID and ErrorType = 3 and Mapped = 'N']"></xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="/Root/SaleGroup/Sale[SaleID = $saleID]/ProductType" />
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>

</xsl:stylesheet>
