﻿<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output
		omit-xml-declaration="yes"
		method="xml"
		version="1.0"
		encoding="CP-1252"
		indent="yes"
		doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
		doctype-public="-//W3C//DTD XHTML 1.1//EN"
		/>
	<xsl:strip-space elements="*"/>
	<xsl:variable name="urlgalleria" select="concat($XMLPath,'/galleria_articolo.php?id=',/shEdit/idNotizia)"/>
	<xsl:variable name="galleria" select="document($urlgalleria)"/>
	<xsl:template match="/">
		<html xml:lang="it">
			<xsl:attribute name="xmlns">http://www.w3.org/1999/xhtml</xsl:attribute>
  		<xsl:variable name="vd" select="/shEdit/query/parametro[nome='vd']/valore"/>
			<xsl:variable name="idcat">
			<!--
				<xsl:if test="/shEdit/categorie/cat/cat[id != 1572] and /shEdit/categorie/cat/cat/cat[id != 1572]">
					<xsl:value-of select="/shEdit/categorie/cat/cat[id != 1572]/../id[1]"/>
				</xsl:if>
				<xsl:if test="/shEdit/categorie/cat/cat[id = 1572] or /shEdit/categorie/cat/cat/cat[id = 1572]">
					<xsl:value-of select="1543"/>
				</xsl:if>
			-->
				<xsl:value-of select="/shEdit/query/parametro[nome='c']/valore"/>
			</xsl:variable>
			<xsl:call-template name="head">
				<xsl:with-param name="idcat" select="$idcat"/>
				<xsl:with-param name="jsvideo" select="1"/>
			</xsl:call-template>
			<body>
				<div class="container">
					<xsl:variable name="b" select="/shEdit/query/parametro[nome='b']/valore"/>
					<xsl:variable name="albero" select="document(concat($XMLPath,'/getalberocat.php?id=',$idcat))"/>
					<xsl:comment>
						<xsl:value-of select="concat($XMLPath,'/getalberocat.php?id=',$idcat)"/>
					</xsl:comment>
					<xsl:if test="$albero/albero/categoria[1]/cat_id = 1543">
						<xsl:call-template name="header">
							<xsl:with-param name="b" select="$b"/>
							<xsl:with-param name="livelloI" select="$albero/albero/categoria[2]/cat_id"/>
							<xsl:with-param name="livelloII" select="$albero/albero/categoria[3]/cat_id"/>
							<xsl:with-param name="livelloIII" select="$albero/albero/categoria[4]/cat_id"/>
							<xsl:with-param name="livelloIV" select="$albero/albero/categoria[5]/cat_id"/>
						</xsl:call-template>
					</xsl:if>
					<xsl:if test="not($albero/albero/categoria[1]/cat_id = 1543)">
						<xsl:call-template name="header">
							<xsl:with-param name="b" select="$b"/>
							<xsl:with-param name="livelloI" select="$albero/albero/categoria[3]/cat_id"/>
							<xsl:with-param name="livelloII" select="$albero/albero/categoria[4]/cat_id"/>
							<xsl:with-param name="livelloIII" select="$albero/albero/categoria[5]/cat_id"/>
							<xsl:with-param name="livelloIV" select="$albero/albero/categoria[6]/cat_id"/>
						</xsl:call-template>
					</xsl:if>
					<xsl:call-template name="path">
						<xsl:with-param name="b" select="$b"/>
						<xsl:with-param name="idcat" select="$idcat"/>
						<xsl:with-param name="last" select="/shEdit/titolo/testo"/>
					</xsl:call-template>
					<xsl:if test="$albero/albero/categoria[1]/cat_id = 1543">
						<xsl:call-template name="leftbar">
							<xsl:with-param name="b" select="$b"/>
							<xsl:with-param name="livelloI" select="$albero/albero/categoria[2]/cat_id"/>
							<xsl:with-param name="livelloII" select="$albero/albero/categoria[3]/cat_id"/>
							<xsl:with-param name="livelloIII" select="$albero/albero/categoria[4]/cat_id"/>
							<xsl:with-param name="livelloIV" select="$albero/albero/categoria[5]/cat_id"/>
							<xsl:with-param name="livelloV" select="$albero/albero/categoria[6]/cat_id"/>
							<xsl:with-param name="tipovisualizzazione" select="1"/>
						</xsl:call-template>
					</xsl:if>
					<xsl:if test="not($albero/albero/categoria[1]/cat_id = 1543)">
						<xsl:call-template name="leftbar">
							<xsl:with-param name="b" select="$b"/>
							<xsl:with-param name="livelloI" select="$albero/albero/categoria[3]/cat_id"/>
							<xsl:with-param name="livelloII" select="$albero/albero/categoria[4]/cat_id"/>
							<xsl:with-param name="livelloIII" select="$albero/albero/categoria[5]/cat_id"/>
							<xsl:with-param name="livelloIV" select="$albero/albero/categoria[6]/cat_id"/>
							<xsl:with-param name="livelloV" select="$albero/albero/categoria[7]/cat_id"/>
							<xsl:with-param name="tipovisualizzazione" select="1"/>
						</xsl:call-template>
					</xsl:if>
					<div class="ext-center t-space">
						<span id="content" />
						<div class="ext-center ht-space">
							<span class="verde f-size-tit">
								<xsl:value-of select="/shEdit/titolo/testo"/>
							</span>
						</div>
						<xsl:if test="not(/shEdit/immagine/url)">
							<div class="ext-center ht-space">
								<hr class="hidden"/>
							</div>
						</xsl:if>
						<xsl:if test="/shEdit/immagine/url">
							<div class="ext-center ht-space">
								<xsl:if test="/shEdit/immagine">
                  <xsl:if test="contains(/shEdit/immagine/fs,'.flv')">
                    <div class="nrm-center" style="margin-top:0.9em!important;display:inline;">
                      <xsl:comment>Il flash video player e' realizzato da Jeroen Wijering e rilasciato sotto licenza creative commons come specificato dallo stesso autore nella pagina http://www.jeroenwijering.com/?item=Flash_Video_Player</xsl:comment>
                      <span id="player1">Installa il <a href="http://www.regione.sardegna.it/nopluginflash.html">plug-in</a> per visualizzare il video</span>
                      <script type="text/javascript">
                        var FO = {
                          movie:"http://www.sardegnaambiente.it/editoriale/swf/flvplayer.swf",
                          width:'<xsl:value-of select="/shEdit/immagine/width"/>',
                          height:'<xsl:value-of select="/shEdit/immagine/height + 20"/>',
                          majorversion:"7",
                          build:"0",
                          bgcolor:"#FFFFFF",
                          allowfullscreen:"true",
                          flashvars:'file=<xsl:value-of select="/shEdit/immagine/fs"/><xsl:text disable-output-escaping="yes">&amp;</xsl:text>image=http://www.sardegnaambiente.it<xsl:value-of select="/shEdit/immagine/url"/>'
                        };
                        UFO.create(	FO, "player1");
                      </script>
                    </div>
                  </xsl:if>
                  <xsl:if test="not(contains(/shEdit/immagine/fs,'.flv'))">
                    <xsl:if test="/shEdit/immagine/width = 368">
                      <img
                        src="{/shEdit/immagine/url}"
                        alt="{/shEdit/immagine/alt}"
                        title="{/shEdit/immagine/alt}"
                        class="img368"
                      />
                    </xsl:if>
                    <xsl:if test="not(/shEdit/immagine/width = 368)">
                      <div class="column r-space">
                        <img
                          src="{/shEdit/immagine/url}"
                          alt="{/shEdit/immagine/alt}"
                          title="{/shEdit/immagine/alt}"
                          class="photo2"/>
                      </div>
                    </xsl:if>
  								</xsl:if>
								</xsl:if>
							</div>
						</xsl:if>
						<xsl:if test="shEdit/datamodif">
            <div class="ext-center t-space">
						<xsl:text>Ultimo aggiornamento: </xsl:text>
						<xsl:value-of select="substring-before(shEdit/datamodif, ' ')"/>
						</div>
						<br/>
						</xsl:if>						
						<xsl:if test="/shEdit/breve/testo != ''">
							<div>
								<xsl:attribute name="class">
									<xsl:text>ext-center</xsl:text>
									<xsl:if test="/shEdit/immagine/url">
										<xsl:text> t-space</xsl:text>
									</xsl:if>
								</xsl:attribute>
								<span class="title4">
									<xsl:apply-templates select="/shEdit/breve/testo"/>
								</span>
							</div>
						</xsl:if>
						<xsl:if test="/shEdit/corpo/testo != ''">
							<div style="overflow:hidden">
								<xsl:attribute name="class">
									<xsl:text>ext-center</xsl:text>
									<xsl:if test="/shEdit/immagine/url or /shEdit/breve/testo != ''">
										<xsl:text> t-space</xsl:text>
									</xsl:if>
								</xsl:attribute>
								<xsl:apply-templates select="/shEdit/corpo/testo"/>
                <xsl:if test="$vd > 0">
                  <br/><br/><br/>
                  <xsl:call-template name="formatDateYYYY">
                    <xsl:with-param name="DateToFormat" select="shEdit/datainit"/>
                  </xsl:call-template>
                </xsl:if>
								<xsl:if test="string-length(/shEdit/corpo/testo) &lt; 1000">
									<br/>
									<br/>
									<br/>
									<br/>
									<br/>
								</xsl:if>
							</div>
						</xsl:if>
					</div>
					<xsl:call-template name="footer">
						<xsl:with-param name="b" select="$b"/>
						<xsl:with-param name="query" select="/shEdit/query"/>
					</xsl:call-template>
				</div>
			</body>
		</html>
	</xsl:template>
	<!--
	<xsl:template name="formatDateYYYY">
		<xsl:param name="DateToFormat"/>
		<xsl:variable name="giorno" select="substring-before($DateToFormat, '/')"/>
		<xsl:variable name="mese" select="substring-before(substring-after($DateToFormat, '/'), '/')"/>
		<xsl:variable name="anno" select="substring(substring-after(substring-after($DateToFormat, '/'), '/'), 1 , 4)"/>
		<xsl:value-of select="concat($giorno, '.', $mese, '.', $anno)"/>
	</xsl:template>
	-->
	<xsl:template match="img">
		<xsl:copy-of select="."/>
	</xsl:template>
	<xsl:template match="br | span | ul | li | ol | b | i | u | abbr | acronym">
		<xsl:copy-of select="."/>
	</xsl:template>
	<xsl:template match="a">
		<xsl:if test="@class='linkurl'">
			<xsl:if test="not(starts-with(@href,'mailto'))">
				<a class="title4" href="{@href}">
					<xsl:attribute name="rel">
						<xsl:value-of select="'blank'"/>
					</xsl:attribute>
					<xsl:if test="@title">
						<xsl:attribute name="title">
							<xsl:value-of select="@title"/>
						</xsl:attribute>
					</xsl:if>
					<xsl:value-of select="."/>
				</a>
			</xsl:if>
			<xsl:if test="starts-with(@href,'mailto')">
				<a class="{@class}" href="{@href}">
					<img class="icone" src="{$ImgPath}/mail.gif" alt="Indirizzo email"/>
					<xsl:value-of select="."/>
				</a>
			</xsl:if>
		</xsl:if>
		<xsl:if test="not(@class='linkurl')">
			<xsl:copy-of select="."/>
		</xsl:if>
	</xsl:template>
	<!-- include -->
	<xsl:include href="/xsl/xsl_141.xsl"/>
	<!-- head -->
	<xsl:include href="/xsl/xsl_142.xsl"/>
	<!-- header -->
	<xsl:include href="/xsl/xsl_143.xsl"/>
	<!-- funzioni -->
	<xsl:include href="/xsl/xsl_144.xsl"/>
	<!-- footer -->
	<xsl:include href="/xsl/xsl_145.xsl"/>
	<!-- path -->
	<xsl:include href="/xsl/xsl_146.xsl"/>
	<!-- leftbar -->
	<xsl:include href="/xsl/xsl_150.xsl"/>
	<!-- galleria -->
	<xsl:include href="/xsl/xsl_405.xsl"/>
</xsl:stylesheet>
