<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:newasp="#newasp-functions" exclude-result-prefixes="msxsl newasp">
<xsl:output method="xml" omit-xml-declaration = "yes" indent="yes" version="4.0"/>
	<!--
	Copyright (C) 2007,2008 NewAsp.Net. All rights reserved.
	Written by newasp.net Sunwin
	-->
<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="'+ swf_width +'" height="'+ swf_height +'">');
	document.write('<param name="movie" value="'+swf_path+'images/bcastr31.swf"><param name="quality" value="high">');
	document.write('<param name="menu" value="false"><param name="wmode" value="opaque">');
	document.write('<param name="FlashVars" value="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'&TitleBgColor=6699FF">');
	document.write('<embed src="'+swf_path+'images/bcastr31.swf" wmode="opaque" FlashVars="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'&TitleBgColor=6699FF" menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); 
	document.write('</object>');
]]>
</xsl:variable>
<xsl:template match="/">
	<script type="text/javascript">
	var swf_width=<xsl:value-of select="/xml/@width"/>;
	var swf_height=<xsl:value-of select="/xml/@height"/>;
	var swf_path='<xsl:value-of select="$installdir" />';
	var files='';
	var texts='';
	var links='';
	files+='<xsl:call-template name="pixfiles"/>';
	texts+='<xsl:call-template name="pixtexts"/>'; 
	links+='<xsl:call-template name="pixlinks"/>';
	files=files.substr(1,files.length-1);
	texts=texts.substr(1,texts.length-1);
	links=links.substr(1,links.length-1);

	<xsl:value-of select="$myscript" disable-output-escaping="yes" />
</script>
</xsl:template>
<xsl:template name="pixfiles">
	<xsl:for-each select="xml/datalist/row">|<xsl:value-of select="@imglink"/></xsl:for-each>
</xsl:template>
<xsl:template name="pixtexts">
	<xsl:for-each select="xml/datalist/row">|<xsl:choose>
		<xsl:when test="/xml/@length = 0"><xsl:value-of select="@title" /></xsl:when>
		<xsl:otherwise><xsl:value-of select="newasp:cutstring(string(@title),number(/xml/@length))" /></xsl:otherwise>
	</xsl:choose></xsl:for-each>
</xsl:template>
<xsl:template name="pixlinks">
	<xsl:for-each select="xml/datalist/row">|<xsl:value-of select="@link"/></xsl:for-each>
</xsl:template>
<msxsl:script language="VBScript" implements-prefix="newasp" xmlns:msxsl="urn:schemas-microsoft-com:xslt"><![CDATA[							
	Option Explicit
	
	Function removehtml(strValue)
		Dim re
		Set re = new RegExp
		re.IgnoreCase = True
		re.Global = True
		re.Pattern = "<(.[^>]*)>"
		strValue = re.Replace(strValue,"")
		Set re = Nothing
		removehtml = strValue
	End Function

	Function stringlength(strValue)
		Dim re
		Set re = new RegExp
		re.IgnoreCase = True
		re.Global = True
		re.Pattern = "[^\x00-\xff]"
		stringlength = Len(re.Replace(strValue,"aa"))
		Set re = Nothing
	End Function

	Function cutstring(str,strlen)
		Dim i,l,t,c,s
		l = Len(str)
		s = ""
		strlen = CLng(strlen)
		If strlen < 1 Then
			s = str
		Else
			t = 0
			For i = 1 To l
				c = Asc(Mid(str,i,1))
				If c < 1 Then
					t = t + 2
				Else
					t = t + 1
				End If
				If t >= strlen Then
					s = left(str,i)&""
					Exit for
				Else
					s = str
				End If
			Next
		End If
		cutstring = s
	End Function
]]>
</msxsl:script>
</xsl:stylesheet>