/* Scripts for NGG Featured Pics */

  var nggfp_s=0;
  var nggfp_t;
  var nggfp_numSpecials = 0;
  var nggfp_rootString = "nggfp_fpic_";
  /* NOTE: nggfp_cycletime must be defined elsewhere! */

  function nggfp_initJS()
  {
    /* Count the number of featured items on the page */
    while ( document.getElementById( nggfp_rootString.concat(nggfp_numSpecials.toString()) ))
      nggfp_numSpecials++;

    /* Start a timer if we have more than one featured item */
    if (nggfp_numSpecials > 1 )
      nggfp_t = setTimeout("nggfp_cycleFeaturedPic()", nggfp_cycletime); 
  }

  function nggfp_cycleFeaturedPic()
  {

    /* Make the special referenced by s hidden */
    document.getElementById( nggfp_rootString.concat(nggfp_s.toString()) ).style.visibility="hidden";

    /* Increment our counter */
    nggfp_s++;
    if( nggfp_s >= nggfp_numSpecials )
      nggfp_s=0;

    /* Make the special referenced by s visible */
    document.getElementById( nggfp_rootString.concat(nggfp_s.toString()) ).style.visibility="visible";

    /* Start a new timer */
    nggfp_t = setTimeout("nggfp_cycleFeaturedPic()", nggfp_cycletime); 
  }

