﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
  <xsl:output method="xml" indent="yes"/>

  <xsl:template match="/">
    <xsl:variable name="BrandID" select="AjaxRequest/Params/BrandID"></xsl:variable>
    <xsl:variable name="BrandName" select="AjaxRequest/Params/BrandName"></xsl:variable>
    <xsl:variable name="UserName" select="AjaxRequest/UserName"></xsl:variable>
    <xsl:variable name="Email" select="AjaxRequest/Params/Email"></xsl:variable>
    <xsl:variable name="CompanyName" select="AjaxRequest/Params/CompanyName"></xsl:variable>
    <xsl:variable name="CompanyURL" select="AjaxRequest/Params/CompanyURL"></xsl:variable>

    <xsl:variable name="Name" select="AjaxRequest/Params/Name"></xsl:variable>
    <xsl:variable name="Phone" select="AjaxRequest/Params/Phone"></xsl:variable>
    <xsl:variable name="BestTime" select="AjaxRequest/Params/BestTime"></xsl:variable>
    <xsl:variable name="Comment" select="AjaxRequest/Params/Comment"></xsl:variable>
	  <xsl:variable name="source" select="AjaxRequest/Params/source"></xsl:variable>

    <table class="tableMaster" cellpadding="5" cellspacing="5">
      <tr>
        <td colspan="2">
          <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
          </span>
        </td>
      </tr>
      <tr>
        <td width="30%">
          <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
            Name:
          </span>
        </td>
        <td width="70%">
          <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
            <xsl:choose>
              <xsl:when test="$Name = ''">
                <xsl:value-of select="$UserName"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$Name"/>
              </xsl:otherwise>
            </xsl:choose>
          </span>
        </td>
      </tr>
      <xsl:if test="$Phone!=''">
        <tr>
          <td>
            <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
              Phone:
            </span>
          </td>
          <td>
            <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
              <xsl:value-of select="$Phone"/>
            </span>
          </td>
        </tr>
      </xsl:if>
      <xsl:if test="$BestTime!=''">
        <tr>
          <td>
            <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
              BestTime:
            </span>
          </td>
          <td>
            <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
              <xsl:value-of select="$BestTime"/>
            </span>
          </td>
        </tr>
      </xsl:if>
      <xsl:if test="$Comment!=''">
        <tr>
          <td>
            <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
              Comment:
            </span>
          </td>
          <td>
            <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
              <xsl:value-of select="$Comment"/>
            </span>
          </td>
        </tr>
      </xsl:if>
      <tr>
        <td>
          <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
            E-mail:
          </span>
        </td>
        <td>
          <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
            <xsl:value-of select="$Email"/>
          </span>
        </td>
      </tr>
      <tr>
        <td>
          <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
            Company Name:
          </span>
        </td>
        <td>
          <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
            <xsl:value-of select="$CompanyName"/>
          </span>
        </td>
      </tr>
      <tr>
        <td>
          <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
            Company URL
          </span>
        </td>
        <td>
          <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
            <xsl:value-of select="$CompanyURL"/>
          </span>
        </td>
      </tr>
		<tr>
			<td>
				<span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
					Source
				</span>
			</td>
			<td>
				<span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold; color: #376092;">
					<xsl:value-of select="$source"/>
				</span>
			</td>
		</tr>
    </table>
  </xsl:template>
</xsl:stylesheet>
