<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" omit-xml-declaration = "yes" indent="yes" version="4.0"/>
	<!--
	Copyright (C) 2003-2006 Newasp.Net. All rights reserved.
	Software：NewCloud Site Management System
	Web: http://www.newasp.net/,http://www.newasp.cn/
	Email: newasp@yeah.net	QQ：94022511
	-->
<xsl:variable name="slidetype" select="xml/setting/@slidetype"/><!--设置幻灯片类型,1=FLASH,2=vbscript-->
<xsl:variable name="myscript">
<![CDATA[
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
	document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="'+swf_path+'images/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
	document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
	document.write('<embed src="'+swf_path+'images/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
]]>
</xsl:variable>
<xsl:variable name="myvbscript">
<![CDATA[
FileListArr = Split(FileList,"|")
LinkArr = Split(LinkList,"|")
TxtListArr = Split(TxtList,"|")

CanPlay = CInt(Split(Split(navigator.appVersion,";")(1)," ")(2))>5

FilterStr = "RevealTrans(duration=2,transition=23)"
FilterStr = FilterStr + ";BlendTrans(duration=2)"
If CanPlay Then
	FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.Fade(duration=2,overlap=0)"
	FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.Wipe(duration=3,gradientsize=0.25,motion=reverse)"
Else
	Msgbox "幻灯片播放具有多种动态图片切换效果，但此功能需要您的浏览器为IE5.5或以上版本，否则您将只能看到部分的切换效果。",64
End If

FilterArr = Split(FilterStr,";")

PlayImg_M = 5 * 1000  

I = 1

Sub ChangeImg()
	Do While FileListArr(I)=""
		I = I + 1
		If I>UBound(FileListArr) Then I = 0
	Loop
	Dim J
	If I>UBound(FileListArr) Then I = 0
	Randomize
	J = Int(Rnd * (UBound(FilterArr)+1))
	Img.style.filter = FilterArr(J)
	Img.filters(0).Apply
	Img.Src = FileListArr(I)
	Img.filters(0).play
	Link.Href = LinkArr(I)
	I = I + 1
	If I>UBound(FileListArr) Then I = 0
	TempImg.src = FileListArr(I)
	TempLink.href = LinkArr(I)
	SetTimeout "ChangeImg", PlayImg_M,"VBScript"
End Sub
]]>
</xsl:variable>
<xsl:variable name="slideTxtList">
	<xsl:value-of select="xml/slide[@slideid=1]/@title" disable-output-escaping="yes"/><xsl:for-each select="xml/slide[@slideid!=1]">|<xsl:value-of select="@title" disable-output-escaping="yes"/></xsl:for-each>
</xsl:variable>
<xsl:variable name="slidePicList">
	<xsl:value-of select="xml/slide[@slideid=1]/@picurl" disable-output-escaping="yes"/><xsl:for-each select="xml/slide[@slideid!=1]">|<xsl:value-of select="@picurl" disable-output-escaping="yes"/></xsl:for-each>
</xsl:variable>
<xsl:variable name="slideLinkList">
	<xsl:value-of select="xml/slide[@slideid=1]/@url" disable-output-escaping="yes"/><xsl:for-each select="xml/slide[@slideid!=1]">|<xsl:value-of select="@url" disable-output-escaping="yes"/></xsl:for-each>
</xsl:variable>
<xsl:variable name="classid" select="xml/@classid"/>
<xsl:variable name="maxpic" select="xml/setting/@maxpic"/>
<xsl:variable name="maxlen" select="xml/setting/@maxlen"/>
<xsl:variable name="ChannelID" select="xml/setting/@ChannelID"/>
<xsl:template  match="/">
	<xsl:choose>
		<xsl:when test="$slidetype='1'">
			<xsl:call-template name="slideCode1"/>
		</xsl:when>
		<xsl:when test="$slidetype='2'">
			<xsl:call-template name="slideCode2"/>
		</xsl:when>
	<xsl:otherwise>
		<xsl:call-template name="slideCode1"/>
	</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template name="slideCode1">
	<script type="text/javascript">
	var focus_width=<xsl:value-of select="xml/setting/@width" disable-output-escaping="yes"/>
	var focus_height=<xsl:value-of select="xml/setting/@height" disable-output-escaping="yes"/>
	var text_height=<xsl:value-of select="xml/setting/@text_height" disable-output-escaping="yes"/>
	var swf_path='<xsl:value-of select="xml/setting/@path" disable-output-escaping="yes"/>';
	var swf_height=focus_height+text_height
	
	var pics='<xsl:value-of select="$slidePicList" disable-output-escaping="yes" />';
	var links='<xsl:value-of select="$slideLinkList" disable-output-escaping="yes" />';
	var texts='<xsl:value-of select="$slideTxtList" disable-output-escaping="yes" />';
	<xsl:value-of select="$myscript" disable-output-escaping="yes" />
</script>
</xsl:template>
<xsl:template name="slideCode2">
<script language="VBScript">
Dim FileList,FileListArr,TxtList,TxtListArr,LinkList,LinkArr
Dim CanPlay,FilterStr,FilterArr,PlayImg_M,I

FileList = "<xsl:value-of select='$slidePicList' disable-output-escaping='yes' />"
LinkList = "<xsl:value-of select='$slideLinkList' disable-output-escaping='yes' />"
TxtList = "<xsl:value-of select='$slideTxtList' disable-output-escaping='yes' />"
<xsl:value-of select="$myvbscript" disable-output-escaping="yes" />
</script>
<xsl:if test="xml/setting">
	<table width="100%" height="100%" border="0" cellspacing="6" cellpadding="0">
		<tr id="NoScript">
			<td align="center" style="color:white">对不起，图片浏览功能需脚本支持，但您的浏览器已经设置了禁止脚本运行。请您在浏览器设置中调整有关安全选项。</td>
		</tr>
		<tr style="display:none" id="CanRunScript">
			<td height="100%" align="center" valign="center"><a id="Link" target="_blank"><img id="Img" width="{xml/setting/@width}" height="{xml/setting/@height}" border="0" /></a></td>
		</tr>
		<tr style="display:none">
			<td><a id="TempLink" target="_blank"><img id="TempImg" border="0" /></a></td>
		</tr>
	</table>
</xsl:if>
<script language="VBScript">
NoScript.style.display = "none"
CanRunScript.style.display = ""
Img.src = FileListArr(0)
Link.href = LinkArr(0)
SetTimeout "ChangeImg", PlayImg_M,"VBScript"
</script>
</xsl:template>
</xsl:stylesheet>