<CFSILENT>
  <!--- 
    Examples of use:
    <!--- Sets a cookie that lives until browser is closed --->
    <CF_SetClientCookieViaJS
      CookieName="MyCookie"
      CookieValue="My Value">
  
    <!--- Persistent cookie (See EXPIRES for CFCOOKIE tag) --->
    <CF_SetClientCookieViaJS
      CookieName="MyCookie"
      CookieValue="My Value"
      Expires="1/1/2002 7:00 PM">
  --->
  
  <!--- Tag Attributes --->
  <CFPARAM NAME="Attributes.CookieName" TYPE="variableName">
  <CFPARAM NAME="Attributes.CookieValue" TYPE="string">
  <CFPARAM NAME="Attributes.Expires" TYPE="string" DEFAULT="">
  
  <!--- Local Variables --->
  <CFPARAM NAME="Request.CF_SetClientCookie_Counter" TYPE="numeric" DEFAULT="0">
  <CFSET Request.CF_SetClientCookie_Counter = Request.CF_SetClientCookie_Counter + 1>
</CFSILENT>
<CFOUTPUT>
<CFIF Request.CF_SetClientCookie_Counter EQ 1>
  <SCRIPT LANGUAGE="JavaScript">
  <!-- 
  // Generated by CF_SetClientCookie custom tag
  function _CF_SetCookie(sName, sValue, sExpires) {
    if (sExpires == null) {
      document.cookie = sName + "=" + escape(sValue) + "; path=/";
    } else {
      document.cookie = sName + "=" + escape(sValue) + "; expires=" + sExpires + "; path=/";
    };  
  }
  //-->
  </SCRIPT>
</CFIF>

<SCRIPT LANGUAGE="JavaScript">
<!--
  _CF_SetCookie("#JSStringFormat(Attributes.CookieName)#", "#JSStringFormat(Attributes.CookieValue)#" <CFIF Attributes.Expires NEQ "">, "#GetHttpTimeString(Attributes.Expires)#"</CFIF>);
//-->
</SCRIPT>
</CFOUTPUT>