<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY amp   "&#38;">
<!ENTITY copy   "&#169;">
<!ENTITY gt   "&#62;">
<!ENTITY hellip "&#8230;">
<!ENTITY laquo  "&#171;">
<!ENTITY lsaquo   "&#8249;">
<!ENTITY lsquo   "&#8216;">
<!ENTITY lt   "&#60;">
<!ENTITY nbsp   "&#160;">
<!ENTITY quot   "&#34;">
<!ENTITY raquo  "&#187;">
<!ENTITY rsaquo   "&#8250;">
<!ENTITY rsquo   "&#8217;">
]>


<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:template name="template-headcode"/>
	<xsl:template name="template-footcode"/>

	<xsl:template name="page-content"> 

		<!-- see breadcrumbs xsl -->
		<div id="breadcrumb">
			<xsl:call-template name="breadcrumb">
				<xsl:with-param name="path" select="$ou:dirname"/>								
			</xsl:call-template>
		</div>

		<!-- <div id="page-title"> -->
		<!--BeginEditable Name="Page Title" Description="Users can edit."-->		
		<!-- <h1><xsl:value-of select="$page-title"/></h1> -->
		<!--EndEditable Name="Page Title"-->
		<!-- </div> -->

		<!-- Added for Ticket #36027 -->
		<div id="{div/@id}">
			<h1><xsl:value-of select='ouc:properties[@label="config"]/parameter[@name="heading"]'/></h1>
		</div>			


		<!-- If Sidebar is enabled - Edited sidebar editable region per ticket #41335 - OU Support-->
		<!-- 		<xsl:if test="count(ouc:div[@label='sidebar']/child::*) > 1 and ouc:div[@label='sidebar']/text() !='' and $sidebar = 'true'"> -->
		<xsl:if test="$sidebar = 'true'">
			<div id="sidebar-show">
				Show/Hide information in sidebar
			</div>

			<div id="sidebar">
				<!--BeginEditable Name="Sidebar" Description="Users can add links and other content to sidebar."-->
				<xsl:apply-templates select="ouc:div[@label='sidebar']" />	
				<!--EndEditable Name="Sidebar"-->
			</div>
		</xsl:if>



		<main>
			<!--<div id="content-wrap">
<xsl:apply-templates select="ouc:div[@label='maincontent']" />	
</div>-->
			<!-- begin edit -->
			<xsl:choose>
				<xsl:when test="$sidebar = 'true'">
					<div id="content-wrap-sidebar">
						<xsl:call-template name="news-details"/>
						<xsl:apply-templates select="ouc:div[@label='maincontent']" />
					</div>
				</xsl:when>
				<xsl:otherwise>
					<div id="content-wrap">
						<xsl:call-template name="news-details"/>
						<xsl:apply-templates select="ouc:div[@label='maincontent']" />
					</div>
				</xsl:otherwise>
			</xsl:choose>
			<!-- end edit -->
		</main>

		<div id="last-updated-bar">
			<!-- <script>
var date = new Date(document.lastModified)
document.writeln("Last Updated " + (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear())
</script> -->

			<!-- edited for ticket #36630 -->
			<p>Last Updated <xsl:value-of select="ou:dateFromDateTime($ou:modified,'/')" /></p>
		</div>

	</xsl:template>
	
	<xsl:template name="news-details" expand-text="yes">
		<p>{ou:to-display-date(ou:multiedit-field('pubDate'))}</p>
		<xsl:variable name="image" select="ou:multiedit-field('image')" />
		<xsl:if test="$image/img/@src!=''">
			<img src="{$image/img/@src}" alt="{$image/img/@alt}" class="thumbnail" />
		</xsl:if>
		<xsl:if test="$tags and $tags !=''"><p><strong>Tags: </strong>
			<xsl:for-each select="tokenize($tags, ',')">
			<a href="{concat($dirname, 'index.html?tag=', .)}">{.}</a><xsl:if test="position() != last()">, </xsl:if> 
		</xsl:for-each>
			</p></xsl:if>
	</xsl:template>

</xsl:stylesheet>