<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:include href="/app/tools/common/production/templates/global.xsl" />

    <!-- Moved from common/production/templates/globals.xsl -->

    <xsl:include href="/app/tools/rps/templates/variables.xsl" />
    <xsl:include href="/app/tools/rps/templates/id_to_name.xsl" />
    <xsl:include href="/app/tools/common/production/templates/inline_pop.xsl" />
    <xsl:include href="/app/tools/rps/templates/list.xsl" />
    <xsl:include href="/app/tools/rps/templates/messaging.xsl" />
    <xsl:include href="/app/tools/rps/templates/navigation.xsl" />
    <xsl:include href="/app/tools/rps/templates/raptor.xsl" />
    <xsl:include href="/app/tools/rps/templates/search.xsl" />
    <xsl:include href="/app/tools/rps/templates/shared_templates.xsl" />
	<xsl:include href="/app/tools/rps/templates/royalty_run_status.xsl" />
	<xsl:include href="/app/tools/rps/templates/base_includes.xsl" />


    <xsl:template name="body">
				<xsl:if test="$area = 'statement' and $cmd != 'main'">
					<xsl:attribute name="id">statement</xsl:attribute>
				</xsl:if>
        <xsl:call-template name="rpsBaseIncludes" />

                <xsl:choose>

                    <xsl:when test="not(Params/_inline)">
                        <xsl:call-template name="inlinePop" />
						<xsl:call-template name="header" />

                        <xsl:choose>
                            <xsl:when test="$hideLinks = 0">
                                <xsl:call-template name="navigation" />
                            </xsl:when>
                            <xsl:otherwise>
                                <div id="loginTop">&#160;</div><div class="loginSpacer"></div>
                            </xsl:otherwise>
                        </xsl:choose>

  		    	        <div id="content">

							<xsl:if test="$accessDenied != 1">
					    	    <xsl:if test="(not(Params/_inline) and $app = 'rps' and $area != 'statement' and $hideLinks = 0) or ($area = 'statement' and $cmd = 'main') or $area = 'jobqueue' or $area = 'locale'">
									<xsl:call-template name="searchForm" />
				  	  	        </xsl:if>
      	                        <xsl:if test="$action = 'm'">
        	                        <xsl:call-template name="greeting" />
          	                    </xsl:if>
							</xsl:if>

                            <xsl:call-template name="sectionHeader" />

                            <div class="sectionBody">
              	                <xsl:choose>
              		                <xsl:when test="$accessDenied = 1">
										<xsl:call-template name="accessDeniedLayout" />
								    </xsl:when>
									<xsl:otherwise>
                		                <xsl:call-template name="pickLayout" />
                	                </xsl:otherwise>
                                </xsl:choose>
                            </div>

                        </div>
                        <xsl:call-template name="footer" />
                    </xsl:when>

                    <xsl:otherwise>
						<xsl:call-template name="inlinePopLayout" />
                    </xsl:otherwise>

                </xsl:choose>
    </xsl:template>



</xsl:stylesheet>
