<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE document SYSTEM "http://commons.omniupdate.com/dtd/standard.dtd"> 
<!-- 
INTERIOR PAGE for UAEX 2013 Implementation
A simple main-site-content-page-2.

Contributors: Vinit Varghese
Last Updated 6/2013
-->
<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="ouvariables.xsl"/>
    <xsl:strip-space elements="*"/>
    <xsl:output method="html" indent="yes" encoding="UTF-8" omit-xml-declaration="yes"/>
    
    <xsl:template match="/">    
        <xsl:choose>
            <xsl:when test="not($ouc:action='edt')">
                <div class="nav-block">
                    <div class="holder">
                        <nav class="container cf">
                            <!-- top navigation: begin -->
                            <ul id="nav">
                                <xsl:apply-templates select="/document/nav-section1/node()" mode="top-nav"/>
                                <xsl:apply-templates select="/document/nav-section2/node()" mode="top-nav"/>
                                <xsl:apply-templates select="/document/nav-section3/node()" mode="top-nav"/>
                                <xsl:apply-templates select="/document/nav-section4/node()" mode="top-nav"/>
                                <xsl:apply-templates select="/document/nav-section5/node()" mode="top-nav"/>
                                <xsl:apply-templates select="/document/nav-section6/node()" mode="top-nav"/>
                            </ul>
                        </nav>
                    </div>
                </div>
            </xsl:when>
            <xsl:otherwise>
                <xsl:copy-of select="/document/nav-section1/node()" />
                <xsl:copy-of select="/document/nav-section2/node()" />
                <xsl:copy-of select="/document/nav-section3/node()" />
                <xsl:copy-of select="/document/nav-section4/node()" />
                <xsl:copy-of select="/document/nav-section5/node()" />
                <xsl:copy-of select="/document/nav-section6/node()" />
            </xsl:otherwise>
        </xsl:choose>
        
    </xsl:template>
    
    <xsl:template match="attribute()|text()|comment()|node()" mode="top-nav">
        <xsl:copy >
            <xsl:apply-templates select="attribute()|node()|text()" mode="top-nav"/>
        </xsl:copy>
    </xsl:template> 
    
    <xsl:template match="table[@class='topnav-table']" mode="top-nav">
        <li><xsl:copy-of select="thead/tr/th/node()"/> 
            <div class="drop">
                <div class="drop-holder">
                    <div class="col">
                        <ul>
                            <xsl:for-each select="tbody/tr">
                                <xsl:if test="td[1]/*[normalize-space()]">
                                     <li>
                                         <strong class="title"><xsl:copy-of select="td[1]/node()"/></strong>
                                         <p><xsl:copy-of select="td[2]/node()"/></p>
                                     </li>
                                </xsl:if>
                            </xsl:for-each>
                         </ul>
                    </div>
                    <div class="col">
                        <ul>
                            <xsl:for-each select="tbody/tr">
                                <xsl:if test="td[3]/*[normalize-space()]">
                                <li>
                                    <strong class="title"><xsl:copy-of select="td[3]/node()"/></strong>
                                    <p><xsl:copy-of select="td[4]/node()"/></p>
                                </li>
                                </xsl:if>
                            </xsl:for-each>
                            
                        </ul>
                    </div>
                </div>
            </div>
            <!-- drop: end -->
        </li>
    </xsl:template>

</xsl:stylesheet>