<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "http://commons.omniupdate.com/dtd/standard.dtd">
<!--
07/26/2016	-	choose to support older navigation or new navigation
-->
<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"
				xmlns="http://www.w3.org/1999/xhtml"
				exclude-result-prefixes="ou xsl xs fn ouc">

	<xsl:template name="navigation">
		<xsl:param name="title" select="ou:pcf-param('breadcrumb')" />
		<xsl:variable name="nav-start"><xsl:value-of select="if ($ou:navigation-start != '') then $ou:navigation-start else $dirname" /></xsl:variable>
		

		
		<xsl:variable name="parentdir" select="ou:find-prev-dir($dirname)"/>
		<xsl:variable name="this-props-path" select="concat($ou:root, $ou:site, $dirname, $props-file)"/>
		<xsl:variable name="parent-this-props-path" select="concat($ou:root, $ou:site, $parentdir, $props-file)"/>
		<xsl:variable name="link-start" select="''"/>
 		<xsl:variable name="parenttitle">
			<xsl:choose>
				<xsl:when test="doc-available($this-props-path)">
					<xsl:value-of select="document($parent-this-props-path)/document/ouc:properties[@label='config']/parameter[@name='breadcrumb']"/>
				</xsl:when>
				<xsl:otherwise><xsl:if test="$ou:action!='pub'">System Message: Props File Not Found</xsl:if></xsl:otherwise>
			</xsl:choose>
		</xsl:variable> 
		<xsl:variable name="current-title">
			<xsl:choose>
				<!-- test if there is a props file before trying to read it -->
				<xsl:when test="doc-available($this-props-path)">
					<xsl:value-of select="document($this-props-path)/document/ouc:properties[@label='config']/parameter[@name='breadcrumb']"/>
				</xsl:when>
				<xsl:otherwise><xsl:if test="$ou:action!='pub'">System Message: Props File Not Found</xsl:if></xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
					
		<!-- <div id="accordion" class="accordion box-btm"> -->
<!-- 			breadcrumb<xsl:value-of select="$title"/>
			<br></br>breadcrumb<xsl:value-of select="document($this-props-path)/document/ouc:properties[@label='config']/parameter[@name='breadcrumb']"/>
			<br></br>this-props-path<xsl:value-of select="$this-props-path"/>
			<br></br>path<xsl:value-of select="$dirname"/>
			<br></br>prpath<xsl:value-of select="$prpath"/> -->
			
<!-- 			<br></br>prsubtitle<xsl:value-of select="$parenttitle"/>
			<br></br>subtitle<xsl:value-of select="$current-title"/> -->
		
			<!-- <xsl:choose>
				<xsl:when test="$parentdir != '/'">
					<div class="accordion-header">
						<a id="accordiontitle" class="collapsed title-text mobileCollapse" data-toggle="collapse" data-parent="#accordion" href="#menuCollapse" aria-expanded="true">
							<a class="accordion-link" href="{concat($link-start,$parentdir)}"><xsl:value-of select="$parenttitle"/></a></a>
					</div>
					<ul id="menuCollapse" class="collapse show" style="">
						<li class="collapseToggle">
							<a class="title hasCollapse" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" >
								<a class="accordion-link" href="{concat($link-start,$dirname)}"><xsl:value-of select="$current-title"/></a></a>
						</li>
						<ul id="collapseTwo" class="sub-link collapse show" style="">
							<xsl:choose>
								<xsl:when test="lower-case(normalize-space($ou:use-legacy-nav)) = 'yes' or lower-case(normalize-space($ou:use-legacy-nav)) = 'true'">
									<xsl:apply-templates select="ouc:div[@label='temp-nav']" />
								</xsl:when>
								<xsl:otherwise>
									<xsl:choose>
										<xsl:when test="$ou:action != 'pub'">
											<xsl:value-of disable-output-escaping="yes" select="unparsed-text(concat($domain, '/_resources/cs/get-nav.ashx?navfile=', $nav-start,'z-nav.inc'))"/> 
										</xsl:when>
										<xsl:otherwise>
											<xsl:text disable-output-escaping="yes">&lt;%</xsl:text>OUC.NestedNav nestedNav = new OUC.NestedNav();
											Response.Write(nestedNav.GetNav("<xsl:value-of select="$nav-start"/>z-nav.inc"));<xsl:text disable-output-escaping="yes">%&gt;</xsl:text>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:otherwise>
							</xsl:choose></ul></ul>
				</xsl:when>
				<xsl:otherwise>
					
					<div class="accordion-header">
						<a id="accordiontitle" class="collapsed title-text mobileCollapse" data-toggle="collapse" data-parent="#accordion" href="#menuCollapse" aria-expanded="true">
							<a class="accordion-link" href="{concat($link-start,$dirname)}"><xsl:value-of select="$current-title" /></a></a>
					</div>
					<ul id="menuCollapse" class="collapse show" style="">
					<xsl:choose>
								<xsl:when test="lower-case(normalize-space($ou:use-legacy-nav)) = 'yes' or lower-case(normalize-space($ou:use-legacy-nav)) = 'true'">
									<xsl:apply-templates select="ouc:div[@label='temp-nav']" />
								</xsl:when>
								<xsl:otherwise>
									<xsl:choose>
										<xsl:when test="$ou:action != 'pub'">
											<xsl:value-of disable-output-escaping="yes" select="unparsed-text(concat($domain, '/_resources/cs/get-nav.ashx?navfile=', $nav-start,'z-nav.inc'))"/> 
										</xsl:when>
										<xsl:otherwise>
											<xsl:text disable-output-escaping="yes">&lt;%</xsl:text>OUC.NestedNav nestedNav = new OUC.NestedNav();
											Response.Write(nestedNav.GetNav("<xsl:value-of select="$nav-start"/>z-nav.inc"));<xsl:text disable-output-escaping="yes">%&gt;</xsl:text>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:otherwise>
							</xsl:choose></ul>
				</xsl:otherwise>
			</xsl:choose>
			
				</div>
		-->
		<!-- <xsl:text disable-output-escaping="yes">&lt;%</xsl:text> -->
		<!-- <xsl:value-of disable-output-escaping="yes" select="unparsed-text(concat($domain, '/_resources/cs/get-nav.ashx?navfile=', $nav-start,'z-nav.inc'))"/> -->
		<!-- Response.Write(<xsl:value-of select="$nav-start"/>z-nav.inc);-->
		<!-- <xsl:text disable-output-escaping="yes">%&gt;</xsl:text> -->
		
		<xsl:choose>
								<xsl:when test="lower-case(normalize-space($ou:use-legacy-nav)) = 'yes' or lower-case(normalize-space($ou:use-legacy-nav)) = 'true'">
									<xsl:apply-templates select="ouc:div[@label='temp-nav']" />
								</xsl:when>
								<xsl:otherwise>
									<xsl:choose>
										<xsl:when test="$ou:action != 'pub'">
											<xsl:value-of disable-output-escaping="yes" select="unparsed-text(concat($domain, '/_resources/cs/get-nav.ashx?navfile=', $nav-start,'z-nav.inc'))"/>
										</xsl:when>
										<xsl:otherwise>
											<xsl:text disable-output-escaping="yes">&lt;%</xsl:text>OUC.NestedNav nestedNav = new OUC.NestedNav();
											Response.Write(nestedNav.GetNav("<xsl:value-of select="$nav-start"/>z-nav.inc"));<xsl:text disable-output-escaping="yes">%&gt;</xsl:text>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:otherwise>
							</xsl:choose>


			
				<script type="text/javascript">
				/*if(document.getElementById("menuCollapse").getElementsByTagName("li").length == 0){
						var element = document.getElementById("accordiontitle");
						element.classList.remove("title-text");
					}
					

					if (("undefined" == typeof window.ekMenuEx_ekmenuArray)
					|| (null == window.ekMenuEx_ekmenuArray)) {
					window.ekMenuEx_ekmenuArray = new Array;
					}
					window.ekMenuEx_ekmenuArray[window.ekMenuEx_ekmenuArray.length] = "f5d30978_108_0";
					if (("undefined" == typeof window.ekMenuEx_startupSubmenuBranchId)
					|| (null == window.ekMenuEx_startupSubmenuBranchId)) {
					window.ekMenuEx_startupSubmenuBranchId = new Array;
					}
					window.ekMenuEx_startupSubmenuBranchId["f5d30978"] = "";
					if (("undefined" == typeof window.ekMenuEx_autoCollapseBranches)
					|| (null == window.ekMenuEx_autoCollapseBranches)) {
					window.ekMenuEx_autoCollapseBranches = new Array;
					}
					window.ekMenuEx_autoCollapseBranches["f5d30978"] = "true";
					if (("undefined" == typeof window.ekMenuEx_startCollapsed)
					|| (null == window.ekMenuEx_startCollapsed)) {
					window.ekMenuEx_startCollapsed = new Array;
					}
					window.ekMenuEx_startCollapsed["f5d30978"] = "true";
					if (("undefined" == typeof window.ekMenuEx_startWithRootFolderCollapsed)
					|| (null == window.ekMenuEx_startWithRootFolderCollapsed)) {
					window.ekMenuEx_startWithRootFolderCollapsed = new Array;
					}
					window.ekMenuEx_startWithRootFolderCollapsed["f5d30978"] = "false";
					*/
				</script>

				<!-- Ektron SmartMenu Menu 108, Block Ends -->


			<script type="text/javascript">
				function GetPreviewURL() {
				var url = self.location.href;
				var arString = url.split('?')
				if (arString.length <xsl:text disable-output-escaping="yes">&gt;</xsl:text> 1) { url = url + "<xsl:text disable-output-escaping="yes">&amp;</xsl:text>cmsMode=Preview"}
				else { url = url + "?cmsMode=Preview"}
				return url;
				}
			</script>
			<script type="text/javascript">
				function PopUpWindow(url, hWind, nWidth, nHeight, nScroll, nResize) { return (EkTbWebMenuPopUpWindow (url, hWind, nWidth, nHeight, nScroll, nResize));}
				function ecmPopUpWindow (url, hWind, nWidth, nHeight, nScroll, nResize) {
				PopUpWindow(url, hWind, nWidth, nHeight, nScroll, nResize) ;
				}
			</script>
	</xsl:template>

</xsl:stylesheet>
