<!--- Whitespace handling ---><CFSETTING ENABLECFOUTPUTONLY="Yes"><!--- Whitespace handling --->

<!--- This file (c)2000 by Nate Weiss (www.nateweiss.com). All rights reserved. --->
<!--- You may use this file as you wish, in commercial or non-commercial apps,  --->
<!--- but this copyright notice must remain intact. Distribution is forbidden.  --->

<!--- Tag Attributes --->
<CFPARAM NAME="Attributes.MovieFile" TYPE="String">
<CFPARAM NAME="Attributes.Width" DEFAULT="" TYPE="string">
<CFPARAM NAME="Attributes.Height" DEFAULT="" TYPE="string">
<CFPARAM NAME="Attributes.MovieName" TYPE="VariableName" DEFAULT="no_value">
<CFPARAM NAME="Attributes.Loop" DEFAULT="Yes" TYPE="Boolean">
<CFPARAM NAME="Attributes.Menu" DEFAULT="No" TYPE="Boolean">
<CFPARAM NAME="Attributes.Play" DEFAULT="Yes" TYPE="Boolean">
<CFPARAM NAME="Attributes.DeviceFont" DEFAULT="No" TYPE="Boolean">
<CFPARAM NAME="Attributes.Quality" DEFAULT="high" TYPE="String">
<CFPARAM NAME="Attributes.BGColor" DEFAULT="" TYPE="String">
<CFPARAM NAME="Attributes.ClassID" DEFAULT="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" TYPE="String">
<CFPARAM NAME="Attributes.CodeBase" DEFAULT="http://active.macromedia.com/flash2/cabs/swflash.cab" TYPE="String">
<CFPARAM NAME="Attributes.PlugInsPage" DEFAULT="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" TYPE="String">
<CFPARAM NAME="Attributes.CABVersion" DEFAULT="5,0,0,0" TYPE="String">
<CFPARAM NAME="Attributes.Scale" DEFAULT="showall" TYPE="String">
<CFPARAM NAME="Attributes.Align" DEFAULT="" TYPE="String">
<CFPARAM NAME="Attributes.SAlign" DEFAULT="" TYPE="String">
<CFPARAM NAME="Attributes.Base" DEFAULT="" TYPE="String">
<CFPARAM NAME="Attributes.WMode" DEFAULT="Window" TYPE="String">
<CFPARAM NAME="Attributes.Style" DEFAULT="" TYPE="string">
<CFPARAM NAME="Attributes.IncludeObject" DEFAULT="Yes" TYPE="Boolean">
<CFPARAM NAME="Attributes.IncludeEmbed" DEFAULT="Yes" TYPE="Boolean">
<CFPARAM NAME="Attributes.IndentCode" DEFAULT="No" TYPE="Boolean">
<CFPARAM NAME="Attributes.EnableFSCommand" DEFAULT="#ThisTag.HasEndTag#" TYPE="Boolean">
<CFPARAM NAME="Attributes.swLiveConnect" DEFAULT="#Attributes.EnableFSCommand#" TYPE="boolean">
<CFPARAM NAME="Attributes.MovieVar" TYPE="String" DEFAULT="player">
<CFPARAM NAME="Attributes.IncludeCommandSwitch" DEFAULT="No" TYPE="Boolean">

<!--- Global variables --->
<CFSET TagName = "CF_" & ListFirst(GetFileFromPath(GetCurrentTemplatePath()), ".")>
<CFSET AlreadyIncludedFlag = "Request.#TagName#_ScriptsIncluded">
<CFSET ErrorHeader = "<P><B>Error occurred while processing a &lt;#TagName#&gt; Tag&nbsp;&nbsp;&nbsp;</B></P>">
<CFSET CR = "
">

<!--- Keep track of how many times this tag has been called on this page --->
<CFPARAM NAME="Request.EmbedFlashMovieCounter" TYPE="numeric" DEFAULT="0">
<CFSET Request.EmbedFlashMovieCounter = Request.EmbedFlashMovieCounter + 1>

<!--- If a MovieName attribute was not provided --->
<CFIF Attributes.MovieName EQ "no_value">
  <CFSET Attributes.MovieName = "FlashMovie#Request.EmbedFlashMovieCounter#">
</CFIF>

<!--- Sanity Checking --->
<CFIF Attributes.EnableFSCommand AND (NOT ThisTag.HasEndTag)>
  <CFABORT SHOWERROR="#ErrorHeader# If the ENABLEFSCOMMAND attribute is set to 'Yes', an ending #HTMLEditFormat('</#TagName#>')# tag is required.">
</CFIF>


<!--- Don't output anything yet if the tag is paired and this is the opening tag --->
<CFIF (ThisTag.HasEndTag EQ "No") OR (ThisTag.ExecutionMode EQ "End")>

  <CFSCRIPT>
    // Set variables to enable code indenting
    if (Attributes.IndentCode) {
      Ind1 = CR & "  ";
      Ind2 = Ind1 & "  ";
    } else {
      Ind1 = "";
      Ind2 = "";
    };
  
    // Do some simple string manipulation on some attributes 
    bMenu = IIF(Attributes.Menu, DE('true'), DE('false'));
    bLoop = IIF(Attributes.Loop, DE('true'), DE('false'));
    bPlay = IIF(Attributes.Play, DE('true'), DE('false'));
    bFont = IIF(Attributes.DeviceFont, DE('true'), DE('false'));
    bswLC = IIF(Attributes.swLiveConnect, DE('true'), DE('false'));
    
    // Assume everything between opening and closing tags is JS code for FSCommand
    FSCommandCode = ThisTag.GeneratedContent;  
    ThisTag.GeneratedContent = "";
    if (Attributes.IncludeCommandSwitch) {
      FSCommandCode = " switch (command) { #Ind1#" & Trim(FSCommandCode); 
      FSCommandCode = FSCommandCode & " #Ind2# break; #Ind1# default: #Ind2# alert('Unknown FSCommand Sent By Flash Movie\n\nmovie: #Attributes.MovieName#\ncommand: ' + command + '\nargs: ' + args) }; ";
    };
  </CFSCRIPT>
  

  <!--- If the ENABLEFSCOMMAND attribute is set to "Yes" --->
  <CFIF Attributes.EnableFSCommand>
    
    <!--- Write required JS code to the HEAD portion of the document --->
    <!--- This code taken from the "Default with FSCommand" template that ships with Flash 4 --->
    <CFSAVECONTENT VARIABLE="ScriptContent">
      <CFOUTPUT>
        <SCRIPT LANGUAGE="JavaScript">
          <!--
          <CFIF Not IsDefined(AlreadyIncludedFlag)>
            var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
          </CFIF>
    
          // Handle all the the FSCommand messages in a Flash movie
          function #Attributes.MovieName#_DoFSCommand(command, args) {
            var #Attributes.MovieVar# = InternetExplorer ? document.all["#Attributes.MovieName#"] : document.#Attributes.MovieName#;

            // *** Begin actual FSCommand Code ***
            #FSCommandCode#
            // *** End actual FSCommand Code ***
          }
    
          // Hook for Internet Explorer 
          if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
          	document.write('<SCRIPT LANGUAGE="VBScript"\> \n');
          	document.write('on error resume next \n');
          	document.write('Sub #Attributes.MovieName#_FSCommand(ByVal command, ByVal args)\n');
          	document.write('  call #Attributes.MovieName#_DoFSCommand(command, args)\n');
          	document.write('end sub\n');
          	document.write('</SCRIPT\> \n');
          }
          //-->
        </SCRIPT>  
      </CFOUTPUT>
    </CFSAVECONTENT>
    
    <CFHTMLHEAD TEXT="#ScriptContent#">
    
    <CFSET SetVariable(AlreadyIncludedFlag, "Yes")>
  </CFIF>



  
  
  
  <CFOUTPUT><!-- Embed Flash Movie: "#ListLast(Attributes.MovieFile, "/\")#" --></CFOUTPUT>
  
  <!--- If we're supposed to output the <OBJECT> tag.... --->
  <CFIF Attributes.IncludeObject>
    <CFOUTPUT>#CR#<OBJECT ID="#Attributes.MovieName#" </CFOUTPUT>
      <CFIF Len(Attributes.Width)><CFOUTPUT>#Ind1#width="#Attributes.Width#" </CFOUTPUT></CFIF>
      <CFIF Len(Attributes.Height)><CFOUTPUT>#Ind1#height="#Attributes.Height#" </CFOUTPUT></CFIF>
      <CFIF Len(Attributes.Style)><CFOUTPUT>#Ind1#style="#Attributes.Style#" </CFOUTPUT></CFIF>
      <CFOUTPUT>#Ind1#classid="#Attributes.ClassID#" </CFOUTPUT>
      <CFOUTPUT>#Ind1#codebase="#Attributes.CodeBase#<CFIF Len(Attributes.CABVersion)>##version=#Attributes.CABVersion#</CFIF>"> </CFOUTPUT>
      <CFOUTPUT>#Ind1#<PARAM NAME="movie" VALUE="#Attributes.MovieFile#"></CFOUTPUT>
      <CFOUTPUT>#Ind1#<PARAM NAME="loop" VALUE="#bLoop#"></CFOUTPUT>
      <CFOUTPUT>#Ind1#<PARAM NAME="play" VALUE="#bPlay#"></CFOUTPUT>
      <CFOUTPUT>#Ind1#<PARAM NAME="menu" VALUE="#bMenu#"></CFOUTPUT>
      <CFOUTPUT>#Ind1#<PARAM NAME="quality" VALUE="#Attributes.Quality#"></CFOUTPUT>
      <CFOUTPUT>#Ind1#<PARAM NAME="scale" VALUE="#Attributes.Scale#"></CFOUTPUT> 
      <CFOUTPUT>#Ind1#<PARAM NAME="devicefont" VALUE="#bFont#"></CFOUTPUT> 
      <CFIF Len(Attributes.bgcolor)><CFOUTPUT>#Ind1#<PARAM NAME="bgcolor" VALUE="#Attributes.BGColor#"></CFOUTPUT></CFIF> 
      <CFIF Len(Attributes.Base)><CFOUTPUT>#Ind1#<PARAM NAME="BASE" VALUE="#Attributes.Base#"></CFOUTPUT></CFIF>  
      <CFIF Len(Attributes.Align)><CFOUTPUT>#Ind1#<PARAM NAME="align" VALUE="#Attributes.Align#"></CFOUTPUT></CFIF>  
      <CFIF Len(Attributes.SAlign)><CFOUTPUT>#Ind1#<PARAM NAME="salign" VALUE="#Attributes.SAlign#"></CFOUTPUT></CFIF>
   </CFIF>
   
   <!--- If we're supposed to output the <EMBED> tag.... --->
   <CFIF Attributes.IncludeEmbed>
      <CFOUTPUT>#Ind1#<EMBED MAYSCRIPT NAME="#Attributes.MovieName#" src="#Attributes.MovieFile#" </CFOUTPUT>
         <CFOUTPUT>#Ind2#loop="#bLoop#" </CFOUTPUT>
         <CFOUTPUT>#Ind2#menu="#bMenu#" </CFOUTPUT>
         <CFOUTPUT>#Ind2#play="#bPlay#" </CFOUTPUT>
         <CFOUTPUT>#Ind2#quality="#Attributes.Quality#" </CFOUTPUT>
         <CFOUTPUT>#Ind2#scale="#Attributes.Scale#" </CFOUTPUT> 
         <CFOUTPUT>#Ind2#devicefont="#bFont#" </CFOUTPUT> 
         <CFOUTPUT>#Ind2#swLiveConnect="#bswLC#" </CFOUTPUT>
         <CFOUTPUT>#Ind2#wmode="#Attributes.WMode#" </CFOUTPUT>
         <CFOUTPUT>#Ind2#type="application/x-shockwave-flash" </CFOUTPUT>
         <CFIF Len(Attributes.bgcolor)><CFOUTPUT>#Ind2#bgcolor="#Attributes.BGColor#" </CFOUTPUT></CFIF>
         <CFIF Len(Attributes.Width)><CFOUTPUT>#Ind2#width="#Attributes.Width#" </CFOUTPUT></CFIF>
         <CFIF Len(Attributes.Height)><CFOUTPUT>#Ind2#height="#Attributes.Height#" </CFOUTPUT></CFIF>
         <CFIF Len(Attributes.Align)><CFOUTPUT>#Ind2#align="#Attributes.Align#" </CFOUTPUT></CFIF>  
         <CFIF Len(Attributes.SAlign)><CFOUTPUT>#Ind2#salign="#Attributes.SAlign#" </CFOUTPUT></CFIF>  
         <CFIF Len(Attributes.Base)><CFOUTPUT>#Ind2#BASE="#Attributes.Base#" </CFOUTPUT></CFIF>
         <CFOUTPUT>#Ind2#pluginspage="#Attributes.PlugInsPage#">#Ind1#</EMBED></CFOUTPUT>
    </CFIF>     

  <!--- Close <OBJECT> tag if called for --->  
  <CFIF Attributes.IncludeObject>
    <CFOUTPUT>#CR#</OBJECT></CFOUTPUT>
  </CFIF>
</CFIF>


<!--- Whitespace handling ---><CFSETTING ENABLECFOUTPUTONLY="No"><!--- Whitespace handling --->
