﻿<?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="PortalItemID" select="AjaxRequest/Params/PortalItemID"></xsl:variable>
    <xsl:variable name="SourcesXML" select="AjaxRequest/SourcesXML/."></xsl:variable>
	  <xsl:variable name="BetaVersion" select="AjaxRequest/Settings/BetaVersion"></xsl:variable>
    <xsl:variable name="TemplateURL" select="AjaxRequest/TemplateURL"></xsl:variable>
	  <xsl:variable name="DivID">
		  <xsl:choose>
			  <xsl:when test="$BetaVersion >= 3">
				  <xsl:text>divClientPortalOperations_Contain</xsl:text>  
			  </xsl:when>
			  <xsl:otherwise>
				  <xsl:text>divClientPortalOperations_Container</xsl:text>
			  </xsl:otherwise>
	  </xsl:choose>
	  </xsl:variable>

    <div id="div_DataXSources_{$PortalItemID}" style="display:none;"></div>

    <table class="tableMaster" cellpadding="1" cellspacing="0">
      <xsl:for-each select="$SourcesXML/Source">
        <tr>
          <td>
            <span class="packageTitle onMouseOver"
                  onclick="LoadSourceDetail('{SourceID}','{$PortalItemID}','{$DivID}');">
              <xsl:value-of select="Source"/>
            </span>
          </td>
        </tr>
      </xsl:for-each>
      <tr>
        <td>
          <div class="verticallyMiddle onMouseOver divBrowseGradient spanBrowseGradientTextGray" style="width:120px;line-height:22px;"
              onmouseover="document.getElementById('img_Cancel').src='{$TemplateURL}Web/Images/Ver_2_0/icon_add_over.png';"
              onmouseout="document.getElementById('img_Cancel').src='{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png';"
              onclick="DataX_AddNewSource('{$PortalItemID}','div_DataXSources_{$PortalItemID}');">
            <img id="img_Cancel" src="{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png" align="absmiddle" style="padding-left:8px;" class="marginRight5"></img>
            <span id="span_Source" class="capitalFont">add a source</span>
          </div>
        </td>
      </tr>
    </table>



  </xsl:template>
</xsl:stylesheet>
