﻿<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="ImageURL" />
  	<xsl:param name="WebPartHeigh" />
  	<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">
    	<xsl:call-template name="dvt_1"/>
  </xsl:template>
  	<xsl:template name="dvt_1">
    	<xsl:variable name="dvt_StyleName">2ColFrm</xsl:variable>
    	<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" />
		<xsl:variable name="RowLimit" select="3" />
    <table class="TableTopNewStyle" cellpadding="0" cellspacing="0" id="tbBroad">
      <tr><td class="NewTitleMainpage">最新资讯</td></tr>
      <tr>
        <xsl:call-template name="dvt_1.body">
          	<xsl:with-param name="Rows" select="$Rows" />
			<xsl:with-param name="FirstRow" select="1" />
			<xsl:with-param name="LastRow" select="$RowLimit" />
        </xsl:call-template>
      </tr>
    </table>
  	<div style=" overflow:hidden; border-bottom:1px black dotted; margin: 10 0 25 0;"></div>
  	<script language="JavaScript" type="text/javascript"><xsl:comment><![CDATA[
		function OnActiveNewsTab(thumbnail,tdActive)
		{
			document.getElementById("tbBroad").children(0).children(1).children(0).children(0).src = thumbnail;
			
			document.getElementById("tbBroad").children(0).children(1).children(1).children(0).className = "TDTopNewsBgStyleUnselect";
			document.getElementById("tbBroad").children(0).children(2).children(0).children(0).className = "TDTopNewsBgStyleUnselect";
			document.getElementById("tbBroad").children(0).children(3).children(0).children(0).className = "TDTopNewsBgStyleUnselect";
			
			tdActive.children(0).className = "TDTopNewsBgStyleSelect";
		}
	]]></xsl:comment></script>
  </xsl:template>
  	<xsl:template name="dvt_1.body">
    	<xsl:param name="Rows" />
		<xsl:param name="FirstRow" />
		<xsl:param name="LastRow" />
    	<xsl:for-each select="$Rows">
    		<xsl:sort select="@Modified" order="descending" />
			<xsl:variable name="dvt_KeepItemsTogether" select="false()" />
			<xsl:variable name="dvt_HideGroupDetail" select="false()" />
			<xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow) or $dvt_KeepItemsTogether">
				<xsl:if test="not($dvt_HideGroupDetail)" ddwrt:cf_ignore="1">
					<xsl:call-template name="dvt_1.rowview" >
						<xsl:with-param name="NewsURL" select="concat(substring-before(@FileRef, '/Lists/'),'/Lists/',substring-before(substring-after(@FileRef, '/Lists/'),'/'))" />
					</xsl:call-template>
				</xsl:if>
			</xsl:if>
	    </xsl:for-each>
  	
  </xsl:template>
  	<xsl:template name="dvt_1.rowview">
   		<xsl:param name="NewsURL" />
   		<xsl:choose>
			<xsl:when test="position() = 1">
				<xsl:choose>
					<xsl:when test="@thumbnail != ''"> 
  		    <td rowspan="3" valign="top"><img class="BroadImageStyle" src="{@ImageURL}" /></td>
        </xsl:when> 
					<xsl:otherwise> 
  		    <td rowspan="3"><img class="BroadImageStyle" src="{$ImageURL}" /></td>
  			</xsl:otherwise>
	  			</xsl:choose>
	  	<td class="ms-vb TdTopNewsRightBroad" onmousemove="OnActiveNewsTab('{@ImageURL}',this)">
            <a href="{$NewsURL}/DispForm.aspx?ID={@ID}" title="{@Title}" target="_self" class="TDTopNewsBgStyleSelect">
            <div class="DivTopNewsBroad">
				<xsl:value-of select="@Title" disable-output-escaping="yes" />
			</div>
            </a>
        </td>
		</xsl:when>
			<xsl:otherwise> 
	    <td class="ms-vb TdTopNewsRightBroad" onmousemove="OnActiveNewsTab('{@ImageURL}',this)">
            <a href="{$NewsURL}/DispForm.aspx?ID={@ID}" title="{@Title}" target="_self" class="TDTopNewsBgStyleUnselect">
            <div class="DivTopNewsBroad">
				<xsl:value-of select="@Title" disable-output-escaping="yes" />
			</div>
            </a>
        </td>
		</xsl:otherwise>
		</xsl:choose>
    	<xsl:if test="position() mod 1 = 0" ddwrt:cf_ignore="1">
      		<xsl:text disable-output-escaping="yes">&lt;/tr&gt;</xsl:text>
      		<xsl:if test="position() != last()" ddwrt:cf_ignore="1">
        		<xsl:text disable-output-escaping="yes">&lt;tr&gt;</xsl:text>
      </xsl:if>
    </xsl:if>
    	<xsl:if test="position() = last()" ddwrt:cf_ignore="1">
      		<xsl:if test="position() mod 1 != 0" ddwrt:cf_ignore="1">
        <td>
          	<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
        </td>
      </xsl:if>
    </xsl:if>
  </xsl:template></xsl:stylesheet>
