<!--- Fetch a listing of current films from the database --->
<CFQUERY NAME="GetFilms" DATASOURCE="#REQUEST.DataSource#"
  CACHEDWITHIN="#CreateTimeSpan(0,0,10,0)#">
  SELECT FilmID, MovieTitle
  FROM Films
  ORDER BY MovieTitle
</CFQUERY>

<!--- Fetch a listing of current actors from the database --->
<CFQUERY NAME="GetActors" DATASOURCE="#REQUEST.DataSource#"
  CACHEDWITHIN="#CreateTimeSpan(0,0,10,0)#">
  SELECT ActorID, NameFirst, NameLast, Gender
  FROM Actors
  WHERE IsTotalBabe = 1
</CFQUERY>

<!--- Use Query-of-queries to extract just the female actors --->
<CFQUERY NAME="GetFemaleActors" DBTYPE="Query">
  SELECT ActorID, NameFirst, NameLast
  FROM GetActors
  WHERE Gender = 'F'
  ORDER BY NameLast, NameFirst
</CFQUERY>

<!--- Use Query-of-queries to extract just the male actors --->
<CFQUERY NAME="GetMaleActors" DBTYPE="Query">
  SELECT ActorID, NameFirst, NameLast
  FROM GetActors
  WHERE Gender = 'M'
  ORDER BY NameLast, NameFirst
</CFQUERY>

<!--- Create formatting structure --->
<CFSET Formatting = StructNew()>
<CFSET Formatting.bgcolor = "##F5DEB3">
<CFSET Formatting.btncolor = "##FF8C00">
<CFSET Formatting.btnhicolor = "##FFA500">

<TABLE>
<TR VALIGN="top">
  <TD>
    <IMG SRC="../images/logo_c.gif" WIDTH="101" HEIGHT="101" ALT="" BORDER="0">
  </TD>
  <TD>
    <!--- Include Navigation Bar component, from Flash Component Kit --->
    <CF_uicascadingmenu
      WIDTH="500"
      HEIGHT="300"
      ELASTICITY="30"
      BOOST="20"
      SCALE="1"
      DAMPING="50"
      stFORMATTING="#Formatting#">
    
      <!--- Include Top-Level navigation choice --->
      <CF_uicascadingmenuitem 
        ID="1"
        NAME="Orange Whip Studios">
      <!--- Include Second-Level navigation choice --->
      <CF_uicascadingmenuitem
        NAME="Home"
        ID="2"
        PARENTID="1"
        HREF="../">  
      <!--- Include Second-Level navigation choice --->
      <CF_uicascadingmenuitem
        NAME="Store"
        ID="3"
        PARENTID="1"
        HREF="../29/Store.cfm">  
      

      <!--- Include Top-Level navigation choice for Films --->
      <CF_uicascadingmenuitem 
        ID="4"
        BGCOLOR="##FF0000"
        NAME="Films">
      <!--- Include sub-navigation choice for A-M films --->
      <CF_uicascadingmenuitem 
        ID="1000"
        PARENTID="4"
        NAME="A-L">
      <!--- Include sub-navigation choice for N-Z films --->
      <CF_uicascadingmenuitem 
        ID="1500"
        PARENTID="4"
        NAME="M-Z">
        
      <!--- For each Film --->
      <CFLOOP QUERY="GetFilms">
        <!--- URL to send user to if they click on this film --->
        <CFSET LinkURL = "ShowFilm.cfm?FilmID=#GetFilms.FilmID#">
        <!--- ID number for this menu item (1000 plus current row) --->
        <CFSET ParentID = IIF(Left(MovieTitle, 1) LTE "M", 1000, 1500)>
        <CFSET LinkID = ParentID + GetFilms.CurrentRow>
        
        <!--- Include Second-Level navigation choice for this film --->
        <CF_uicascadingmenuitem 
          ID="#LinkID#"
          PARENTID="#ParentID#"
          NAME="#GetFilms.MovieTitle#"
          HREF="#LinkURL#">
      </CFLOOP>

 
      <!--- Include Top-Level navigation choice for Actors (Female) --->
      <CF_uicascadingmenuitem
        ID="2000" 
        NAME="Hot Actresses" WIDTH="100">
      <!--- For each Film --->
      <CFLOOP QUERY="GetFemaleActors">
        <CFSET FullName = NameFirst & " " & NameLast>
        <!--- URL to send user to if they click on this actor --->
        <CFSET LinkURL = "ShowActor.cfm?ActorID=#GetFemaleActors.ActorID#">
        <!--- ID number for this menu item (1000 plus current row) --->
        <CFSET LinkID = 1000 + GetFilms.CurrentRow>
        <!--- Include Second-Level navigation choice for this Actor --->
        <CF_uicascadingmenuitem
          ID="#LinkID#"
          PARENTID="2000"
          NAME="#FullName#"
          HREF="#LinkURL#">  
      </CFLOOP>

      <!--- Include Top-Level navigation choice for Actors (Female) --->
      <CF_uicascadingmenuitem
        ID="3000" 
        NAME="Hot Actors" WIDTH="100">
      <!--- For each Film --->
      <CFLOOP QUERY="GetMaleActors">
        <CFSET FullName = NameFirst & " " & NameLast>
        <!--- URL to send user to if they click on this actor --->
        <CFSET LinkURL = "ShowActor.cfm?ActorID=#GetMaleActors.ActorID#">
        <!--- ID number for this menu item (1000 plus current row) --->
        <CFSET LinkID = 3000 + GetFilms.CurrentRow>
        <!--- Include Second-Level navigation choice for this Actor --->
        <CF_uicascadingmenuitem
          ID="#LinkID#"
          PARENTID="3000"
          NAME="#FullName#"
          HREF="#LinkURL#">  
      </CFLOOP>
    
    </CF_uicascadingmenu>

  </TD>
</TR>
</TABLE>
