<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
	<xsl:output method="html" indent="no"/>
	<xsl:decimal-format NaN=""/>
	<xsl:param name="dvt_apos">'</xsl:param>
	<xsl:param name="ManualRefresh"></xsl:param><xsl:variable name="dvt_1_automode">0</xsl:variable>
	<xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
		<div id="rhn_ad_spotlight">
			<div id="rhn_ad_link" class="rhn_adText"><a href="/Mall/Pages/Advertisers.aspx">Purchase this area for your ad!</a></div>
			<div id="rhn_ad" class="rhn_adText">Advertisement</div>
			<xsl:call-template name="dvt_1"/>
		</div>
	</xsl:template>
	<xsl:template name="dvt_1">
		<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[@Display = 'Yes' and @ContentType0 = 'Ad']"/>
		<xsl:variable name="dvt_RowCount" select="count($Rows)"/>
		<xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
		<xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0"/>		
		<xsl:choose>
			<xsl:when test="$dvt_IsEmpty">
				<xsl:call-template name="dvt_1.spotlight"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:call-template name="dvt_1.body">
					<xsl:with-param name="Rows" select="$Rows"/>
				</xsl:call-template>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="dvt_1.body">
		<xsl:param name="Rows"/>
		<xsl:for-each select="$Rows">
			<xsl:call-template name="dvt_1.rowview" />
		</xsl:for-each>
	</xsl:template>
	<xsl:template name="dvt_1.rowview">
		<style>
		#rhn_ad {display:block}
		#rhn_ad_link {display:none}
		</style>
		<xsl:choose>
			<xsl:when test="@AdURL = ''">
				<div id="rhn_ad_container" style="background:#E4E4E4 url('{@AdImage}') no-repeat"  name="{@AdImage.desc}" title="{@AdImage.desc}">&#160;</div>
			</xsl:when>
			<xsl:otherwise>
				<a href="{@AdURL}" target="_blank"><div id="rhn_ad_container" style="background:#E4E4E4 url('{@AdImage}') no-repeat"  name="{@AdImage.desc}" title="{@AdImage.desc}">&#160;</div></a>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="dvt_1.spotlight">
		<style>
		#rhn_ad {display:none}
		#rhn_ad_link {display:block}
		</style>
	    <xsl:variable name="randomNum" select="ddwrt:Random(1,count(/dsQueryResponse/Rows/Row[@Display.value = 1 and @ContentType0 = 'Member Spotlight']))" />
	    <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[@Display = 'Yes' and @ContentType0 = 'Member Spotlight']"/>
	    <!--xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[position() = $randomNum]"/-->
		<xsl:variable name="dvt_RowCount" select="count($Rows)"/>
		<xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
		<xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0"/>		
		<xsl:choose>
			<xsl:when test="$dvt_IsEmpty">
				<xsl:call-template name="dvt_1.empty"/>
			</xsl:when>
			<xsl:otherwise>	
				<div id="rhn_spotlight_container">
					<xsl:call-template name="dvt_2.body">
						<xsl:with-param name="Rows" select="$Rows"/>
					</xsl:call-template>
				</div>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="dvt_2.body">
		<xsl:param name="Rows"/>
		<xsl:for-each select="$Rows">
			<xsl:call-template name="dvt_2.rowview" />
		</xsl:for-each>
	</xsl:template>
	<xsl:template name="dvt_2.rowview">
		<h2>Member Spotlight</h2>
		<xsl:choose>
			<xsl:when test="@MemberPicture = ''">
				<img border="0" src="/images/photo_na.jpg" alt="{@MemberPicture.desc}" width="120" height="150" />
			</xsl:when>
			<xsl:otherwise>
				<img border="0" src="{@MemberPicture}" alt="{@MemberPicture.desc}" width="120" height="150" />
			</xsl:otherwise>
		</xsl:choose>				
		<h3><xsl:value-of select="@Title" /></h3>
		<div>
			<xsl:choose>
				<xsl:when test="@AdURL != ''">
					<a href="{@AdURL}" target="_blank"><xsl:if test="@MemberPosition != ''"><xsl:value-of select="@MemberPosition" />,&#160;</xsl:if><xsl:if test="@MemberCompany != ''"><xsl:value-of select="@MemberCompany" /></xsl:if></a>
				</xsl:when>
				<xsl:otherwise>
					<xsl:if test="@MemberPosition != ''"><xsl:value-of select="@MemberPosition" />,&#160;</xsl:if><xsl:if test="@MemberCompany != ''"><xsl:value-of select="@MemberCompany" /></xsl:if>
				</xsl:otherwise>
			</xsl:choose>
		</div>
		<div>ACCE Member:&#160;<xsl:value-of select="@MemberYears" />&#160;years</div>
		<!--p class="text12"><a href="/Pages/MemberSpotlight.aspx">View all member spotlights</a></p-->
	</xsl:template>
	<xsl:template name="dvt_1.empty">
		<div id="rhn_ad_container_empty">
			<br /><br /><br /><br />
			<p class="text18">Advertise your company here!</p>
			<p class="text13"><a href="/Mall/Pages/Advertisers.aspx" target="_self">Click here</a> for more information!</p>
		</div>
	</xsl:template>
</xsl:stylesheet>