<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp   "&#160;">
<!ENTITY lsaquo   "&#8249;">
<!ENTITY apos   "&#39;">
<!ENTITY rsaquo   "&#8250;">
<!ENTITY laquo  "&#171;">
<!ENTITY raquo  "&#187;">
<!ENTITY copy   "&#169;">
]>
<!-- Footer pcf to include file structure -->
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ou="http://omniupdate.com/XSL/Variables"
    xmlns:fn="http://omniupdate.com/XSL/Functions" xmlns:ouc="http://omniupdate.com/XSL/Variables" exclude-result-prefixes="ou xsl xs fn ouc">
    
    <xsl:import href="../common.xsl"/>
    
    <xsl:output method="html" version="4.0" indent="no" encoding="UTF-8" include-content-type="no" omit-xml-declaration="yes"/>
    <xsl:strip-space elements="*"/>
    
    <xsl:variable name="message-styling" select="'color: #a94442; background-color: #f2dede; border-color: #ebccd1; padding: 15px; border: 1px solid transparent; border-radius: 4px;'"/>
    <!-- variable for creating the id elements -->
    <xsl:variable name="allowed-symbols" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'"/>
    
    <xsl:template match="/document[$ou:action = 'pub']">
        <xsl:call-template name="content"/>
    </xsl:template>
    
    <xsl:template match="/document[not($ou:action = 'pub')]">
        <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;</xsl:text>
        <html>
            <head>
                <title>Global Header PCF to Include</title>
                <xsl:if test="$ou:action != 'pub'">
                    <xsl:call-template name="common-headcode" />
                    
                    <link rel="stylesheet" href="/_resources/css/oustyles.css"/>
                    <script src="https://code.jquery.com/jquery-1.11.3.min.js"/>
                    <script src="http://ad-wb-wvc01.wvc.edu/_resources/js/legendShow.js"/>
                    
                </xsl:if>
                
            </head>
            <body style="">
                <xsl:if test="$ou:action = 'edt'">
                    <div style="{$message-styling}">
                        <p style="margin-bottom: 0px; font-size: 15px;">Content outside the tables will be stripped out after editing, please only edit inside of the table</p>
                        <p style="font-size: 15px;">Please navigate to preview mode to see how the quick links header will appear on all pages.</p>
                    </div>
                </xsl:if>
                <xsl:call-template name="content"/>
            </body>
        </html>
    </xsl:template>
    
    <xsl:template name="content">
        
        <header id="header" class="type-2">
            <div class="container">
                
                <xsl:if test="$ou:action = 'edt'">
                    <div style="float: left;">
                        <xsl:copy-of select="ou:get-edit-button(ouc:div[@label = 'links-left'])" />
                    </div>
                </xsl:if>
                <div class="links-left">
                    <xsl:apply-templates select="ouc:div[@label='links-left']/*"/>
                </div>
                
                <xsl:if test="$ou:action = 'edt'">
                    <div style="float: right;">
                        <xsl:copy-of select="ou:get-edit-button(ouc:div[@label = 'links-right'])" />
                    </div>
                </xsl:if>
                <div class="links-right">
                    <xsl:apply-templates select="ouc:div[@label='links-right']/*"/>
                </div>
               
            </div>
        </header>
        <!-- / header -->
        
    </xsl:template>
    
    <xsl:template match="ouc:div[@label='links-left']/ul|ouc:div[@label='links-right']/ul">
        <xsl:apply-templates/>
    </xsl:template>
    
    <xsl:template match="ouc:div[@label='links-left']/ul/li|ouc:div[@label='links-right']/ul/li">
        <xsl:apply-templates/>
    </xsl:template>
    
    <xsl:template match="ouc:div[@label='header-bar']/ul">
        <xsl:choose>
            <xsl:when test="contains(@class,'links')">
                <ul class="{@class}">
                    <xsl:apply-templates select="attribute()|node()"/>
                </ul>
            </xsl:when>
            <xsl:otherwise>
                <ul class="{@class} links">
                    <xsl:apply-templates select="attribute()[name() != 'class']|node()"/>
                </ul>
            </xsl:otherwise>
        </xsl:choose>
        
    </xsl:template>
    
    
</xsl:stylesheet>
