<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date">

    <xsl:variable name="pageName">
        <xsl:choose>
            <xsl:when test="$area = 'user'">
                <xsl:choose>
                    <xsl:when test="$cmd = 'edit' and normalize-space(/Root/Form/AppUser/UserID)">Edit User</xsl:when>
                    <xsl:when test="$cmd = 'edit'">Add User</xsl:when>
                    <xsl:when test="$cmd = 'show'">View User</xsl:when>
                    <xsl:when test="$cmd = 'profile'">Edit Profile</xsl:when>
                    <xsl:when test="$cmd = 'changepw'">Change Password</xsl:when>
                    <xsl:when test="$cmd = 'import'">Import User</xsl:when>
                    <xsl:when test="$cmd = 'terms'">Master Software &amp; Services Subscription Agreement </xsl:when>
                    <xsl:when test="$cmd = 'view_terms'">View Subscription Agreement</xsl:when>
                    <xsl:when test="$cmd = 'contact'">Contact RoyaltyShare</xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="/Root/PageName" />
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="/Root/PageName" />
            </xsl:otherwise>
        </xsl:choose>

        <xsl:if test="normalize-space(/Root/Report/Publisher/PublisherName)">
            <xsl:text> - </xsl:text><xsl:value-of select="/Root/Report/Publisher/PublisherName" />
        </xsl:if>
        <xsl:if test="normalize-space(/Root/Report/Imprint/ImprintName) and (/Root/Params/c != 'is' or not(/Root/Params/c))">
            <xsl:text> - </xsl:text><xsl:value-of select="/Root/Report/Imprint/ImprintName" />
        </xsl:if>
    </xsl:variable>
    
    <xsl:variable name="author"><xsl:value-of select="/Root/Params/author" /></xsl:variable>
    
    <xsl:variable name="publisherID">
        <xsl:choose>
            <xsl:when test="/Root/Report/Publisher/PublisherID">
                <xsl:value-of select="/Root/Report/Publisher/PublisherID" />
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="/Root/Params/publisher" />
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>

    <xsl:variable name="publisherName">
        <xsl:choose>
            <xsl:when test="$publisherID != ''">
                <xsl:value-of select="/Root/Report/Publishers/PublisherName" />
            </xsl:when>
            <xsl:otherwise>
                All Publishers
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>

    <xsl:variable name="imprintID">
        <xsl:choose>
            <xsl:when test="/Root/Report/Imprint/ImprintID">
                <xsl:value-of select="/Root/Report/Imprint/ImprintID" />
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="/Root/Params/imprint" />
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>

    <xsl:variable name="imprintName">
        <xsl:choose>
            <xsl:when test="$imprintID != ''">
                <xsl:value-of select="/Root/Report/Imprint/ImprintName" />
            </xsl:when>
            <xsl:otherwise>
                All Imprints
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>

    <xsl:variable name="period"><xsl:value-of select="/Root/Report/Period/PeriodID" /></xsl:variable>
    
    <xsl:variable name="periodType"><xsl:value-of select="translate(/Root/Report/Period/PeriodType, 'YQM','yqm')" /></xsl:variable>


</xsl:stylesheet>

