<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet>
<!-- 
IMPLEMENTATION VARIABLES for UAEX 2013 IMPLEMENTATION
Define global implementation variables here, so that they may be accessed by all page types and in the info/debug tabs.
This also provides a convenient area for complicated logic to exist without clouding up the general xsl/html structure.

Contributors: Caroline Spooner
Last Updated 10/08/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"/> <!-- system variables -->
		
	<!-- 
	
	Utility Variables (depended on by utility xsls for consistency and flexbility)
	
	-->
	
	<!-- remove propsparams function, debug references, and modify breadcrumbs xsl if not using these 2 variables -->
	<xsl:param name="props-file" select="'_props.pcf'"/> 	
	<xsl:param name="props-path" select="concat($ou:root, $ou:site, $dirname, $props-file)"/>		
	
	<xsl:param name="dirname" select="if(string-length($ou:dirname) = 1) then $ou:dirname else concat($ou:dirname,'/')" />
	
	<xsl:param name="domain" select="substring($ou:httproot,1,string-length($ou:httproot)-1)" />				
	<xsl:param name="path" select="substring($ou:root,1,string-length($ou:httproot)-1)"/>

	<xsl:param name="serverType" select="'asp'"/> <!-- php or asp used by functions, nested nav xsl -->
	<xsl:param name="index-file" select="'default'"/> <!-- index or default used by archive, breadcrumb, nested nav xsl -->
	<xsl:param name="extension" select="'aspx'"/> <!-- html, asp, php, etc. used by archive, baedcrumb, nested nav xsl -->

	<!-- 
	
	Implementation Specific Variables (Directory Variables, Page Variables, Special Tests, Variable Precendence Tests) 
	
	-->
	
	<!-- 
	
	DIR VAR / VAR FALLBACKS
	
	-->
	
	<xsl:param name="ou:bodyClass"/>
	<xsl:param name="bodyClass">
		<xsl:choose><!-- decide theme of page depending on page type. -->
			<xsl:when test="string-length(normalize-space($ou:bodyClass))>0"><xsl:value-of select="$ou:bodyClass"/></xsl:when><!-- dir var -->
		 	<xsl:when test="contains($pageType,'main')">none</xsl:when> <!-- division -->
		 	<xsl:when test="contains($pageType,'4h')">green-theme</xsl:when><!-- 4h -->
		 	<xsl:when test="contains($pageType,'division')">inner-style</xsl:when> <!-- division -->
			<xsl:when test="contains($pageType,'counties')">grey-theme</xsl:when> <!-- counties -->
			<xsl:otherwise>none</xsl:otherwise>
		</xsl:choose>
	</xsl:param>
	
	<xsl:param name="ou:bedeworkXML"/> <!-- where the folder starts -->
	<xsl:param name="ou:bedeworkCounty"/> <!-- County Name in Bedework -->

	<!-- to-do: use uaex link once events have been created -->
	<xsl:variable name="bedeworkXML" select="ou:assignVariable('bedeworkXML',$ou:bedeworkXML,'NO FEED SPECIFIED')"/>


	<!-- breadcrumbs/navigation -->
	<xsl:param name="ou:breadcrumbStart"/> <!-- where the folder starts -->
	<xsl:variable name="breadcrumbStart" select="ou:testVariable($ou:breadcrumbStart,'/')"/> 
	<xsl:param name="ou:navigationStart"/> <!-- where the folder starts -->
	<xsl:variable name="navigationStart" select="ou:testVariable($ou:navigationStart,'/')"/>

	<!-- social media -->
	<xsl:param name="ou:og-image" />
	<xsl:param name="ou:twitter-creator" />
	<xsl:param name="ou:twitter-site" />
	<xsl:param name="ou:fb-admins" />
	<xsl:param name="ou:fb-app_id" />
	
	<!-- 
	
	OTHER VARIABLES 
	
	-->
	
	<xsl:param name="ou:publishBlankPages"/>

	
	<!-- access key of the link to mark as current section in the top navigation  -->
	<xsl:param name="ou:accessKey"/>
		
	<!-- display title from the section where navigation starts -->
	<xsl:variable name="navigationTitle" select="ou:propsparam('sectionTitle',concat($ou:root,$ou:site,$navigationStart,$props-file))"/>

	<!-- general page information -->
	<xsl:variable name="pageType" select="ou:pcfparam('pagetype')"/>
	<xsl:variable name="pageTitle" select="/document/*:properties/title" />
	<xsl:variable name="breadcrumbTitle" select="ou:pcfparam('breadcrumbTitle')" />
	<xsl:variable name="galleryType" select="ou:assignVariable('galleryType','PrettyPhoto')"/>	
	
	<!-- For clarity, create a varaible that contains all the relevant information from page properties about page display -->
	<xsl:variable name="pageOptions" select="concat(string-join(ou:pcfparam('middleContentOptions')),string-join(ou:pcfparam('specialOptions')))"/>
	<!-- determine the outer HTML structure of the page -->
	<xsl:variable name="pageColumns" select="ou:pcfparam('pageColumns')"/>
	
	<xsl:variable name="pageLayout" select="ou:assignVariable('layout','2-1')"/>								
	
	
	
</xsl:stylesheet>
