<?xml version="1.0" encoding="UTF-8"?>
<xslt:stylesheet version="1.0" xmlns:xslt="http://www.w3.org/1999/XSL/Transform">

	<xslt:template name="buildlink">
		<xslt:param name="linkadress"/>
		<xslt:param name="linktext"/>
		<xslt:param name="target"/>
			<xslt:text disable-output-escaping="yes">&lt;a href="</xslt:text>
			<xslt:value-of select="$linkadress"/>
			<xslt:text disable-output-escaping="yes">" target="</xslt:text>
			<xslt:value-of select="$target"/>
			<xslt:text disable-output-escaping="yes">"&gt;</xslt:text>
			<xslt:value-of select="$linktext"/>
			<xslt:text disable-output-escaping="yes">&lt;/a&gt;</xslt:text>
	</xslt:template>
 
	<xslt:template name="buildmaillink">
		<xslt:param name="recipient"></xslt:param>
		<xslt:param name="carboncopy"></xslt:param>
		<xslt:param name="blindcarboncopy"></xslt:param>
		<xslt:param name="subject"></xslt:param>
		<xslt:param name="body"></xslt:param>
		<xslt:param name="linktext"></xslt:param>
		<xslt:param name="encoding"></xslt:param>
			<xslt:text disable-output-escaping="yes">&lt;a href="javascript:writemail('</xslt:text>
			<xslt:value-of select="$recipient"/>
			','
			<xslt:value-of select="$carboncopy"/>
			','
			<xslt:value-of select="$blindcarboncopy"/>
			','
			<xslt:value-of select="$subject"/>
			','
			<xslt:value-of select="$body"/>
			','
			<xslt:value-of select="$encoding"/>
			<xslt:text disable-output-escaping="yes">');"&gt;</xslt:text>
			<xslt:value-of select="$linktext"/>
			<xslt:text disable-output-escaping="yes">&lt;/a&gt;</xslt:text>
	</xslt:template>

  <xslt:template name="javascript">
    <xslt:text disable-output-escaping="yes">
      function writemail(recipient, carboncopy, blindcarboncopy, subject, body, encoding)
      {
        if(encoding != "utf-8" &amp;&amp; encoding != "utf8")
        {
          recipient = escape(recipient);
          carboncopy = escape(carboncopy);
          blindcarboncopy = escape(blindcarboncopy);
          body = escape(body);
		  subject = escape(subject);
        }
		else
		{
		  recipient = encodeURIComponent(recipient);
          carboncopy = encodeURIComponent(carboncopy);
          blindcarboncopy = encodeURIComponent(blindcarboncopy);
          body = encodeURIComponent(body);
		  subject = encodeURIComponent(subject);
		}
        aditional = "";
        if(carboncopy.length)
          aditional = "?cc=" + carboncopy;
        if(blindcarboncopy.length)
        {
          if(aditional.length)
           aditional += "&amp;";
          else
           aditional += "?";
          aditional += "bcc=" + blindcarboncopy; 
        }
        if(subject.length)
        {
          if(aditional.length)
           aditional += "&amp;";
          else
           aditional += "?";
          aditional += "subject=" + subject; 
        }
        if(body.length)
        {
          if(aditional.length)
           aditional += "&amp;";
          else
           aditional += "?";
          aditional += "body=" + body; 
        }
        window.open("mailto:" + recipient + aditional, '_parent');
      }
    </xslt:text>
  </xslt:template>

  <xslt:template name="buildCSS">
    <style type="text/css">
      BODY
      {
        FONT-SIZE: <xslt:value-of select="XSLT/General/Style/FontSize"/>;
        FONT-FAMILY: <xslt:value-of select="XSLT/General/Style/FontFace"/>;
        FONT-WEIGHT: <xslt:value-of select="XSLT/General/Style/FontWeightNormal"/>;
        BACKGROUND-COLOR: <xslt:value-of select="XSLT/General/Style/BackgroundColor"/>;
        MARGIN: 0px;
        CURSOR: default;
      }
      TABLE.maintable
      {
        padding-bottom:2px;
        padding-left:2px;
		padding-right:2px;
		background-color:#ffffff;
      }
      A
      {
        CURSOR: pointer;
      }
      .boldfont
      {
        FONT-WEIGHT: <xslt:value-of select="XSLT/General/Style/FontWeightBold"/>;
      }
      #contactpopup
      {
        FONT-WEIGHT: <xslt:value-of select="XSLT/General/Style/FontWeightBold"/>;
        CURSOR: hand;
      }
      #contactpopup:hover
      {
        FONT-WEIGHT: <xslt:value-of select="XSLT/General/Style/FontWeightBold"/>;
        text-decoration: underline;
        CURSOR: hand;
      }
	  TD
	  {
		width= 50%;
		border:0px solid #000000;
		text-align:left;
	font-size:12px;
	  }
      </style>
  </xslt:template>
  
</xslt:stylesheet>

