<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns="http://www.w3.org/TR/REC-html40">

  <!-- =========================================== -->
  <!--  person.xsl (v001) for HF                   -->
  <!--  18.05.05 - kristian.syversen@usit.uio.no   -->
  <!-- =========================================== -->

  <!-- general -->
  <xsl:import href="../../../system/api-v001.xsl" />

  <!-- =========================================== -->
  <!--  This stylesheet uses '/common/person',     -->
  <!--  while extending it by adding HF institute  -->
  <!--  HTML-profile and also features automatic   -->
  <!--  display of institute nave (based on code)  -->
  <!-- =========================================== --> 
  <xsl:import href="../../../uio/person/v001/person.xsl" />


  <!-- common templates -->
  <xsl:include href="../../../felles/ressurser/breadcrumb-v001.xsl" />
  <xsl:include href="../../../felles/ressurser/output-method-html-v001.xsl" />


  <xsl:strip-space elements="*"/>    

  <xsl:template match="/">

    <html>
      <head>
        <title>
          <xsl:value-of select="$firstname"/>&#160;<xsl:value-of select="$lastname"/> - <xsl:value-of select="$title"/>
        </title>        
        <link rel="stylesheet" href="http://www.hf.uio.no/css/rammeverk-stilark.css" type="text/css" />
      </head>

      <body>

        <xsl:variable name="institute-code" select="//institute/text()" />
        
        <h1> 
          <xsl:call-template name="institute">
            <xsl:with-param name="code" select="$institute-code"/>
          </xsl:call-template>
          &#160; <!-- default, to ensure H1 tag gets closed -->
        </h1>
        
        <!-- wrapping contents with HF institute web profile (folders) -->
        <table class="hovedtabell-bredde" cellpadding="5" cellspacing="0">
          <tr>
            <td width="10%" class="roed-meny-celle-passiv"><a href="../../../">Forside</a></td>
            <td width="2%" class="roed-mellomcelle">&#160;</td>
            <td width="15%" class="roed-meny-celle-passiv"><a href="../../../studier/">Studier ved <xsl:value-of select="$institute-code"/> </a></td>
            <td width="2%" class="roed-mellomcelle">&#160;</td>
            <td width="18%" class="roed-meny-celle-passiv"><a href="../../../forskning/">Forskning ved <xsl:value-of select="$institute-code"/> </a></td>

            <td width="2%" class="roed-mellomcelle">&#160;</td>
            <td width="10%" class="roed-meny-celle-aktiv"><a href="../../">Om <xsl:value-of select="$institute-code"/> </a></td>
            <td width="2%" class="roed-mellomcelle">&#160;</td>
            <td width="13%" class="roed-meny-celle-passiv"><a href="../../../for-ansatte/">For ansatte</a></td>
            <td class="roed-english-celle"><!-- In English -->&#160;</td>
          </tr>
          <tr valign="top" class="roed-kropp">
            <td colspan="10" class="roed-kropp">  
        
              <!-- content wrapper (for proper padding) -->
              <div style="padding: 15px;">
                <small>Du er her: <xsl:call-template name="breadcrumb" /></small>
                
                <!-- matching PERSON which is transformed by general 'person.xsl' -->
                <xsl:apply-templates />

              </div>             
            </td>
          </tr>
        </table>

      </body>
    </html>
  </xsl:template>
  
  
  <!-- overriding template to display correct institute name -->
  <xsl:template name="institute">
    <xsl:param name="code" />
    <xsl:choose>
      <xsl:when test="$code='IAKH'">
        Institutt for arkeologi, konservering og historiske studier
      </xsl:when>
      <xsl:when test="$code='IKOS'">
        Institutt for kulturstudier og orientalske språk
      </xsl:when>
      <xsl:when test="$code='IFIKK'">
        Institutt for filosofi, ide- og kunsthistorie og klassiske språk
      </xsl:when>
      <xsl:when test="$code='ILOS'">
        Institutt for litteratur, områdestudier og europeiske språk
      </xsl:when>
      <xsl:when test="$code='ILN'">
        Institutt for lingvistiske og nordiske studier
      </xsl:when>
      <xsl:when test="$code='IMK'">
        Institutt for medier og kommunikasjon
      </xsl:when>
      <xsl:when test="$code='IMV'">
        Institutt for musikkvitenskap
      </xsl:when>
      <!-- tom kode -->
      <xsl:when test="$code=''">
        Institutt-kode mangler
      </xsl:when>
      <!-- default -->
      <xsl:otherwise>
        <xsl:value-of select="//institute" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

</xsl:stylesheet>
