<!--                                                                  -->
<!--  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="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML 4.01//EN" encoding="utf-8" />

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


    <xsl:template name="pickLayout">
        <div id="statement">
            <xsl:call-template name="helpLink">
                <xsl:with-param name="helpCommand">show_mechanical</xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="pdfInlineLayout" />
        </div>
        <xsl:call-template name="buttons" />
    </xsl:template>
    
    
    <xsl:template name="pdfInlineLayout">
    
        <xsl:variable name="labelView">
            <xsl:choose>
                <xsl:when test="not(normalize-space(Params/_pubView))">1</xsl:when>
                <xsl:otherwise>0</xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
    
        <div style="float: left; padding: 10px; text-align: left">
            <a href="/rps/publisher?PublisherID={Statement/Publisher/PublisherID}&amp;c=show">
                <b><xsl:value-of select="Statement/Publisher/PublisherName" /></b>
            </a>
            <xsl:if test="Statement/Publisher/IsAdmin = 1"> (Admin)</xsl:if>
            <br />
            <br />
            <strong>
                <xsl:choose>
                    <xsl:when test="$labelView = 1">
                        Label View
                    </xsl:when>
                    <xsl:otherwise>
                        <a href="/rps/statement?c=show_mechanical_pdf&amp;MechanicalStatementID={Statement/MechanicalStatementID}">
                            Label View
                        </a>
                    </xsl:otherwise>
                </xsl:choose>
            </strong>
            <xsl:text> </xsl:text>
            <a href="/rps/statement?c=pdf_mechanical&amp;MechanicalStatementID={Statement/MechanicalStatementID}&amp;_full=1"><img src="/production/images/pdficon_small.gif" height="17" width="17" style="vertical-align: text-bottom; margin-right: 2px; margin-left: 4px" />Download</a>         
            <xsl:text> | </xsl:text>
            <strong>
                <xsl:choose>
                    <xsl:when test="$labelView = 1">            
                        <a href="/rps/statement?c=show_mechanical_pdf&amp;MechanicalStatementID={Statement/MechanicalStatementID}&amp;_pubView=1">
                            Publisher View
                        </a>
                    </xsl:when>
                    <xsl:otherwise>
                        Publisher View
                    </xsl:otherwise>
                </xsl:choose>
            </strong>
            <xsl:text> </xsl:text>
            <a href="/rps/statement?c=pdf_mechanical&amp;MechanicalStatementID={Statement/MechanicalStatementID}"><img src="/production/images/pdficon_small.gif" height="17" width="17" style="vertical-align: text-bottom; margin-right: 2px; margin-left: 4px" />Download</a>

            <xsl:text> | </xsl:text>
            <a href="?c=text_mechanical&amp;MechanicalStatementID={Statement/MechanicalStatementID}" title="Download Electronic Format">
                <img src="/production/images/icons/office/Document-(16x16).gif" height="16" width="16" style="vertical-align: text-bottom; margin-right: 2px;" />
			</a>
		    <a href="?c=text_mechanical&amp;MechanicalStatementID={Statement/MechanicalStatementID}">Electronic Format</a>

		</div>
		
	    <xsl:variable name="pdfType">
	        <xsl:if test="$labelView = 1">
	            <xsl:text>Label</xsl:text>
	        </xsl:if>
	        <xsl:if test="$labelView = 0">
	            <xsl:text>Publisher</xsl:text>
	        </xsl:if>	        
	    </xsl:variable>
		
	    <xsl:variable name="pdfName">
	        <xsl:if test="$labelView = 1">
	            <xsl:value-of select="Statement/LabelViewPDF" />
	        </xsl:if>
	        <xsl:if test="$labelView = 0">
	            <xsl:value-of select="Statement/PublisherViewPDF" />
	        </xsl:if>	        
	    </xsl:variable>		
		
		<div id="statementHolder" style="width: 100%; height: 600px; margin: 0 auto; padding: 0">
            <object data="/rps/statement/us_mechanical_pdf/{Statement/MechanicalStatementID}/{$pdfType}/{$pdfName}#pagemode=thumbs&amp;toolbar=1&amp;navpanes=1" width="100%" height="600" id="statementFrame" type="application/pdf" style="border-bottom: 1px solid #6b6b6b"/>   
	    </div>
	    
	    <br class="superBreak" />
        <br />
        <br />
        <br />
        <br />        
	         
    </xsl:template>
  
 
    <xsl:template name="submitButton">
        <xsl:attribute name="class" />
    </xsl:template>


    <xsl:template name="cancelButton">
        <input type="button" name="Back" value="Back to Statements" onClick="location.href='mechanical?MechanicalRunID={Statement/Run/MechanicalRunID}&amp;c=show&amp;PayorID={Statement/Run/PayorID}'" />
    </xsl:template>
    

</xsl:stylesheet>

