if ($limit_f > $roster_f) {
    $allowF = 1;
}
if ($limit_d > $roster_d) {
    $allowD = 1;
}
if ($limit_g > $roster_g) {
    $allowG = 1;
}
debug("USER: "******"last pick number (" . getLastPickNumber($leagueID) . ")");
?>

<p/>

   <style type="text/css" media="screen, print, projection">
      #fch_wrap {
      width:750px;
      margin:0 auto;
      background:#99c;
      }
      #fch_header {
      padding:5px 10px;
      background:#ddd;
      }
      h1 {
function nextDraftOrder($leagueID)
{
    $picksSoFar = intval(selectCount("fch_draft", " WHERE leagueID = {$leagueID}"));
    $totalPlayers = intval(selectCount("fch_league_membership", " WHERE leagueID = {$leagueID} and status = \"active\""));
    $max = getLastPickNumber($leagueID) + 1;
    // because we want the NEXT player
    $season = getSeason();
    debug($picksSoFar . " " . $totalPlayers . " " . $max);
    if (!($totalPlayers > 0)) {
        displayResults(getReturnCode(0, "Error: No players in this league."));
    }
    $quotient = intval(($max - 1) / $totalPlayers);
    debug("quotient {$quotient}");
    $mod = ($max - 1) % $totalPlayers + 1;
    debug("mod {$mod}");
    if ($quotient % 2 == 0) {
        $r = intval($mod);
        debug("{$r} = r");
    } else {
        $r = intval($totalPlayers - $mod + 1);
        debug("{$r} = r");
    }
    return $r;
}