test
-- " "
-- "**********************************************************************"
-- "on mouseUp
  newPage 1
end"
-- "**********************************************************************"
-- "on mouseUp
  newPage 2
end"
-- "**********************************************************************"
-- "on mouseUp
  newPage 3
end"
-- "**********************************************************************"
-- "on mouseUp
  newPage 4
end"
-- "**********************************************************************"
-- "on mouseUp
  newPage 5
end"
-- "**********************************************************************"
-- "on mouseUp
  newPage 6
end"
-- "**********************************************************************"
-- "on exitFrame
  global calcType
  getValues  
end"
-- "**********************************************************************"
-- "on exitFrame
  global bookmarks, filingStatus
  getValues
  puppetSprite 24, true
  puppetSprite 25, true
  puppetSprite 26, true
  case filingStatus of
    1: set the memberNum of sprite 24 = 14
    2: set the memberNum of sprite 25 = 14
    3: set the memberNum of sprite 26 = 14
  end case
  go to frame (the frame + getAt(bookmarks,2))
end
"
-- "**********************************************************************"
-- "on exitFrame
  global bookmarks, myJob, spouseJob, myPlan, spousePlan, filingStatus
  getValues
  puppetSprite 17, true
  puppetSprite 19, true
  puppetSprite 24, true
  puppetSprite 25, true
  puppetSprite 26, true
  puppetSprite 27, true
  puppetSprite 28, true
  puppetSprite 29, true
  puppetSprite 30, true
  puppetSprite 31, true
  case myPlan of
    "yes": set the memberNum of sprite 24 = 14
    "no": set the memberNum of sprite 25 = 14
  end case
  case spousePlan of
    "yes": set the memberNum of sprite 26 = 14
    "no": set the memberNum of sprite 27 = 14
  end case
  case myJob of
    "yes": set the memberNum of sprite 28 = 14
    "no": set the memberNum of sprite 29 = 14
  end case
  case spouseJob of
    "yes": set the memberNum of sprite 30 = 14
    "no": set the memberNum of sprite 31 = 14
  end case
    if filingStatus = 1 then
    set the locV of sprite 17 = 800
    set the locV of sprite 19 = 800
    set the locV of sprite 26 = 800
    set the locV of sprite 27 = 800
    set the locV of sprite 30 = 800
    set the locV of sprite 31 = 800
  end if
go to frame (the frame + getAt(bookmarks,3))
end"
-- "**********************************************************************"
-- "on exitFrame
  global bookmarks, filingStatus
  getValues
  if filingStatus <> 3 then
    puppetSprite 17, true
    puppetSprite 25, true
    set the locV of sprite 17 = 800
    set the locV of sprite 25 = 800
    setAt numBoxes, 5, 1
    if getAt(bookmarks, 5) > getAt(numBoxes, 5) then
      setAt bookmarks, 5, getAt(numBoxes, 5)
    end if
  else
    setAt numBoxes, 5, 2
  end if
  
  go to frame (the frame + getAt(bookmarks,4))
end
"
-- "**********************************************************************"
-- "on exitFrame
  global bookmarks
  getValues
  go to frame (the frame + getAt(bookmarks,5))
end"
-- "**********************************************************************"
-- "on exitFrame
    getValues
end"
-- "**********************************************************************"
-- "on enterframe
  checkRollOver 43
end


on exitFrame
  go the frame
end

on keyUp
  keyboardNav 1
end
"
-- "**********************************************************************"
-- "on enterframe
  checkRollOver 45
end

on keyUp
  keyboardNav 3
end


on exitFrame
  go the frame
end


on mouseUp
  global bookmarks, filingStatus
  if rollover(24) then
    set the memberNum of sprite 24 = 14
    set the memberNum of sprite 25 = 13
    set the memberNum of sprite 26 = 13
    set filingStatus = 1
  end if
  if rollover(25) then
    set the memberNum of sprite 24 = 13
    set the memberNum of sprite 25 = 14
    set the memberNum of sprite 26 = 13
    set filingStatus = 2
  end if
  if rollover(26) then
    set the memberNum of sprite 24 = 13
    set the memberNum of sprite 25 = 13
    set the memberNum of sprite 26 = 14
    set filingStatus = 3
  end if
end
 "
-- "**********************************************************************"
-- "on enterframe
  checkRollOver 44
end

on keyUp
  keyboardNav 2
end


on exitFrame
  go the frame
end


on mouseUp
  global bookmarks, myJob, spouseJob, myPlan, spousePlan
  if rollover(24) then
    set the memberNum of sprite 24 = 14
    set the memberNum of sprite 25 = 13
    set myPlan = "yes"
  end if
  if rollover(25) then
    set the memberNum of sprite 24 = 13
    set the memberNum of sprite 25 = 14
    set myPlan = "no"
    set the memberNum of sprite 28 = 13
    set the memberNum of sprite 29 = 14
    set myJob = "no"
  end if
  if rollover(26) then
    set the memberNum of sprite 26 = 14
    set the memberNum of sprite 27 = 13
    set spousePlan = "yes"
  end if
  if rollover(27) then
    set the memberNum of sprite 26 = 13
    set the memberNum of sprite 27 = 14
    set spousePlan = "no"
    set the memberNum of sprite 30 = 13
    set the memberNum of sprite 31 = 14
    set spouseJob = "no"
  end if
  if rollover(28) then
    set the memberNum of sprite 28 = 14
    set the memberNum of sprite 29 = 13
    set myJob = "yes"
    set the memberNum of sprite 24 = 14
    set the memberNum of sprite 25 = 13
    set myPlan = "yes"
  end if
  if rollover(29) then
    set the memberNum of sprite 28 = 13
    set the memberNum of sprite 29 = 14
    set myJob = "no"
  end if
  if rollover(30) then
    set the memberNum of sprite 30 = 14
    set the memberNum of sprite 31 = 13
    set spouseJob = "yes"
    set the memberNum of sprite 26 = 14
    set the memberNum of sprite 27 = 13
    set spousePlan = "yes"
  end if
  if rollover(31) then
    set the memberNum of sprite 30 = 13
    set the memberNum of sprite 31 = 14
    set spouseJob = "no"
  end if
end
"
-- "**********************************************************************"
-- "on enterframe
  checkRollOver 46
end

on keyUp
  keyboardNav 4
end


on exitFrame
  go the frame
end


"
-- "**********************************************************************"
-- "on enterframe
  checkRollOver 47
end

on keyUp
  keyboardNav 5
end


on exitFrame
  go the frame
end


on mouseUp
  global bookmarks
  if (rollover(16) or rollover(24)) then
    setAt bookmarks, 5, 1
    page 5
  end if
  if (rollover(17) or rollover(25)) then
    setAt bookmarks, 5, 2
    page 5
  end if
end
"
-- "**********************************************************************"
-- "on enterframe
  checkRollOver 48
end

on exitFrame
  go the frame
end

on keyUp
  keyboardNav 6
end
"
-- "**********************************************************************"
-- "on exitFrame
  global bookmarks, numBoxes, maxPages, frameNum, myJob, spouseJob, myPlan, spousePlan, filingStatus, term, irate, myagi, spouseagi
  set the floatPrecision to 12
  set myJob = "no"
  set spouseJob = "no"
  set myPlan = "yes"
  set spousePlan = "yes"
  set filingStatus = 1
  set maxPages = 6
  set thisRoll = 0
  puppetSprite 40, true
  
  
  
  
  set term = float(20)
  set the text of member "term" = "20 years"
  set irate = float(8)
  set the text of member "irate" = "8%"
  set myagi = float(50000)
  set the text of member "myagi" = "$50,000"
  set spouseagi = float(50000)
  set the text of member "spouseagi" = "$50,000"
  
  set bookmarks = list(1,1,1,1,1,1)
  set frameNum = list(2,5,22,39,51,58)
  set numBoxes = list(1,1,1,1,2,1)
end"
-- "**********************************************************************"
-- "on otherRoll
  global thisRoll
  if (thisRoll <> 0) and not(rollover(43) or rollover(44) or rollover(45) or rollover(46) or rollover(47) or rollover(48) or rollover(16) or rollover(17) or rollover(18) or rollover(19) or rollover(20) or rollover(21) or rollover(22) or rollover(23)) then
    resetColors 0
  end if
end"
-- "**********************************************************************"
-- "on checkRollOver exempt
  global thisRoll
  set n = 43
  repeat while (n < 49)
    if (rollover(n) and (thisRoll <> (the memberNum of sprite n)) and (n <> exempt)) then
      resetColors n
    end if
    set n = n + 1
  end repeat
  if (exempt <> 0) and (exempt <> 48) and (exempt <> 44) and (exempt <> 45) then
    set n = 16
    repeat while (n < 24)
      if (rollover(n) and (thisRoll <> (the memberNum of sprite n))) then
        resetColors n
      end if
      set n = n + 1
    end repeat
  end if
  otherroll
end
"
-- "**********************************************************************"
-- "on newPage thisPage
  puppetSprite 17, false
  puppetSprite 19, false
  puppetSprite 24, false
  puppetSprite 25, false
  puppetSprite 26, false
  puppetSprite 27, false
  puppetSprite 28, false
  puppetSprite 29, false
  puppetSprite 30, false
  puppetSprite 31, false
  getValues
  set the locV of sprite 40 = 800
  case thisPage of
    6:
      compare
      page thisPage
    otherwise
      page thisPage
  end case
end "
-- "**********************************************************************"
-- "on getValues
  global bookmarks, numBoxes, maxPages, term, irate, myagi, spouseagi, frameNum
  set the floatPrecision = 2
  
  
  if (the frame > getAt(frameNum,4)) and (the frame < getAt(frameNum,5)) then
    --MYAGI
    set incomeString = line 1 of the text of member "myagi"
    calcNum incomeString
    set incomeString = the result
    set myagi = value(incomeString)
    if myagi <= 0 then
      set myagi = 0
      set incomeString = "0"
    end if
    if myagi > 10000000 then
      set myagi = 10000000
      set incomeString = "10000000"
    end if
    calcDollar incomeString, 0
    set incomeString = the result
    set the text of member "myagi" = incomeString
    --SPOUSEAGI
    set incomeString = line 1 of the text of member "spouseagi"
    calcNum incomeString
    set incomeString = the result
    set spouseagi = value(incomeString)
    if spouseagi <= 0 then
      set spouseagi = 0
      set incomeString = "0"
    end if
    if spouseagi > 10000000 then
      set spouseagi = 10000000
      set incomeString = "10000000"
    end if
    calcDollar incomeString, 0
    set incomeString = the result
    set the text of member "spouseagi" = incomeString
  end if  
  
  if (the frame > getAt(frameNum,5)) and (the frame < getAt(frameNum,6)) then
    --TERM
    set incomeString = line 1 of the text of member "term"
    calcNum incomeString
    set incomeString = the result
    set term = value(incomeString)
    set term = integer(term)
    if term <= 1 then
      set term = 1
    end if
    if term > 100 then
      set term = 100
    end if
    if term = 1 then
      set the text of member "term" = term & " year"
    else
      set the text of member "term" = term & " years"
    end if
    --IRATE
    set incomeString = line 1 of the text of member "irate"
    calcNum incomeString
    set incomeString = the result
    set irate = value(incomeString)
    if irate > 50 then
      set irate = 50
    end if
    if irate <= 0 then
      set irate = 0
    end if
    set the text of member "irate" = irate & "%"
  end if  
  set the floatPrecision = 12
end

"
-- "**********************************************************************"
-- "on clearSprites
  puppetSprite 13, false
  puppetSprite 16, false
  puppetSprite 17, false
  puppetSprite 18, false
  puppetSprite 19, false
  puppetSprite 20, false
  puppetSprite 21, false
  puppetSprite 22, false
  puppetSprite 23, false
  puppetSprite 24, false
  puppetSprite 25, false
  puppetSprite 26, false
  puppetSprite 27, false
  puppetSprite 28, false
  puppetSprite 29, false
end
"
-- "**********************************************************************"
-- "on calcNum thisString
  if (the number of chars in thisString = 0) then
    set thisString = "0"
  end if
  set minus = "false"
  set n = 1
  set decimal = "false"
  repeat while (n <= the number of chars in thisString)
    if not((value(char n of thisString) >= 0) and (value(char n of thisString) <= 9)) then
      if (not(char n of thisString = ".")) or decimal = "true" then
        if ((char n of thisString = "-") and (n = 1)) then
          set minus = "true"
        end if
        delete char n of thisString
      else
        set decimal = "true"
        set n = n + 1
      end if
    else
      set n = n + 1
    end if
  end repeat
  set zeros = TRUE
  repeat while (zeros = TRUE)
    if (char 1 of thisString) = "0" then
      delete char 1 of thisString
    else
      set zeros = FALSE
    end if
  end repeat
  if decimal = "true" then
    set zeros = TRUE
    repeat while (zeros = TRUE)
      if (char (the number of chars in thisString) of thisString) = "0" then
        delete char (the number of chars in thisString) of thisString
      else
        set zeros = FALSE
      end if
    end repeat
  end if
  
  if thisString = "." then
    set thisString = "0"
  end if
  
  if (the number of chars in thisString = 0) then
    set thisString = "0"
  end if
  if (minus = "true") and not(thisString = "0") then
    set thisString = "-" & thisString
  end if
  repeat while (the number of chars in thisString) > 8
    delete char (the number of chars in thisString) of thisString
    
  end repeat
  if char (the number of chars in thisString) of thisString = "." then
    delete char (the number of chars in thisString) of thisString
  end if
  
  return thisString
end
"
-- "**********************************************************************"
-- "on resetColors n
  global thisRoll
  if (thisRoll <> 0) then
    cursor -1
    set the locV of sprite 40 = 800
  end if
  if (n <> 0) then
    if (n < 43) then
      cursor [1,2]
    end if
    set thisRoll = (the memberNum of sprite n)
    if (n > 42) then
      set the locV of sprite 40 = 46 + (37 * (n - 43))
      cursor [1,2]
    end if
  else
    set thisRoll = 0
  end if
end
"
-- "**********************************************************************"
-- "on page thisPage
  global frameNum
  case thisPage of
    1:
      go to frame (getAt(frameNum,1))
    2:
      go to frame (getAt(frameNum,2))
    3:
      go to frame (getAt(frameNum,3))
    4:  
      getValues
      set the text of member "temp1" = the text of member "myagi"
      set the text of member "temp2" = the text of member "spouseagi"
      go to frame (getAt(frameNum,4))
    5:
      set the text of member "temp1" = the text of member "term"
      set the text of member "temp2" = the text of member "irate"
      go to frame (getAt(frameNum,5))
    6:
      go to frame (getAt(frameNum,6))
  end case
end
"
-- "**********************************************************************"
-- "on calcDollar thisString, decimal
  set minus = "false"
  set n = 0
  if (char 1 of thisString = "-") then
    delete char 1 of thisString
    set minus = "true"
  end if
  
  set x = the number of chars in thisString
  repeat while (n < x)
    set n = n + 1
    if (char n of thisString = ".") then
      set x = n - 1
      if decimal = 0 then
        delete char n to (the number of chars in thisString) of thisString
      else
        delete char (n + 3) to (the number of chars in thisString) of thisString
      end if
    end if
  end repeat
  set n = 0
  repeat while (n < x - 1)
    set n = n + 1
    if (n mod 3 = 0) then
      set thisString = chars(thisString,1,x - n) & "," & chars(thisString,x - n + 1,the number of chars in thisString)
    end if
  end repeat
  if minus = "false" then
    set thisString = "$" & thisString
  else
    set thisString = "-$" & thisString
  end if
  if decimal <> 0 then
    if char (the number of chars in thisString) of thisString = "." then
      set thisString = thisString & "0"
    end if
    if char ((the number of chars in thisString) - 1) of thisString = "." then
      set thisString = thisString & "0"
    end if
    if char ((the number of chars in thisString) - 2) of thisString <> "." then
      set thisString = thisString & ".00"
    end if
  end if
  return thisString
end
"
-- "**********************************************************************"
-- "on setDefaults
  global firstTimeThrough, fedtaxes1, statetaxes1, socsec1, fedtaxes2, statetaxes2, socsec2, i196, i296, s96
  if (firstTimeThrough = 0) then
    set firstTimeThrough = 1
    --set fedTaxes = ((i196 + i296) * 0.1029) - 2134
    --set stateTaxes = ((i196 + i296) * 0.02589) - 415
        if (i196 > 62700) then
          set templow1 = 62700
          set temphigh1 = i196 - 62700
        else
          set templow1 = i196
          set temphigh1 = 0
        end if
        if (i296 > 62700) then
          set templow2 = 62700
          set temphigh2 = i296 - 62700
        else
          set templow2 = i296
          set temphigh2 = 0
        end if
        set socsec1 = (templow1 * 0.0765) + (temphigh1 * 0.0145)
        set socsec2 = (templow2 * 0.0765) + (temphigh2 * 0.0145)
    case s96 of
      2,4:
        set socsec1 = socsec1 + socsec2
    end case
    
    
    set the floatPrecision = 2
    --calcDollar string(fedTaxes)
    --set incomeString = the result
    --set the text of member "fedTaxes" = incomeString
    --calcDollar string(stateTaxes)
    --set incomeString = the result
    --set the text of member "stateTaxes" = incomeString
    calcDollar string(socsec1)
    set incomeString = the result
    set the text of member "socsec1" = incomeString
    calcDollar string(socsec2)
    set incomeString = the result
    set the text of member "socsec2" = incomeString
    set the floatPrecision = 12
  end if
end
"
-- "**********************************************************************"
-- "on compare
  global bookmarks, numBoxes, maxPages, frameNum, myJob, spouseJob, myPlan, spousePlan, filingStatus, term, irate, myagi, spouseagi
  
  if myJob = "no" then
    case filingStatus of
      1:
        set deduction = 2000
        If myagi < 2000 then
          set deduction = myagi
        end if
        if deduction < 0 then
          set deduction = 0
        end if
      2:
        if spouseJob = "no" then
          set deduction = 4000
        else
          set deduction = 4000 - ((myagi - 40000) / 2.5)
          if deduction > myagi then
            set deduction = myagi
          end if
          if deduction < 0 then
            set deduction = 0
          end if
          if deduction > 4000 then
            set deduction = 4000
          end if
        end if
      3:
        set deduction = 2000
        If myagi < 2000 then
          set deduction = myagi
        end if
        if deduction < 0 then
          set deduction = 0
        end if
        if deduction > 2000 then
          set deduction = 2000
        end if
        if spouseJob = "no" then
          set spousededuction = 2000
          If spouseagi < 2000 then
            set spousededuction = spouseagi
          end if
          if spousededuction < 0 then
            set spousededuction = 0
          end if
          if spousededuction > 2000 then
            set spousededuction = 2000
          end if
        else
          set spousededuction = 2000 - (spouseagi / 5)
          if spousededuction > spouseagi then
            set spousededuction = spouseagi
          end if
          if spousededuction < 0 then
            set spousededuction = 0
          end if
          if spousededuction > 2000 then
            set spousededuction = 2000
          end if
        end if
    end case
  else
    case filingStatus of
      1:
        set deduction = 2000 - ((myagi - 25000) / 5)
        if deduction > myagi then
          set deduction = myagi
        end if
        if deduction < 0 then
          set deduction = 0
        end if
        if deduction > 2000 then
          set deduction = 2000
        end if
      2:
        set deduction = 4000 - ((myagi - 40000) / 2.5)
        if deduction > myagi then
          set deduction = myagi
        end if
        if deduction < 0 then
          set deduction = 0
        end if
        if deduction > 4000 then
          set deduction = 4000
        end if
      3:
        set deduction = 2000 - (myagi / 5)
        if deduction > myagi then
          set deduction = myagi
        end if
        if deduction < 0 then
          set mydeduction = 0
        end if
        if deduction > 2000 then
          set deduction = 2000
        end if
        if spouseJob = "yes" then
          set spousededuction = 2000 - (spouseagi / 5)
          if spousededuction > spouseagi then
            set spousededuction = spouseagi
          end if
          if spousededuction < 0 then
            set spousededuction = 0
          end if
          if spousededuction > 2000 then
            set spousededuction = 2000
          end if
        else
          set spousededuction = 2000
          if spousededuction > spouseagi then
            set spousededuction = spouseagi
          end if
          if spousededuction < 0 then
            set spousededuction = 0
          end if
        end if
    end case
  end if
  calcDollar string(deduction), 0
  set deductionText = the result
  if filingStatus = 3 then
    calcDollar string(spousededuction), 0
    set spouseDeductionText = the result
  end if
  
  --CALCULATE TOTAL SAVINGS
  set payment = deduction
  if filingStatus = 3 then
    set payment = payment + spouseDeduction
  end if
  if payment > 0 then
    set n = 0
    set totalamount = 0.0000
    set rate = (float(1) + float(float(irate) / 100))
    repeat while n < term
      set n = n + 1
      set totalamount = totalamount + float(payment)
      set totalamount = float(totalamount * rate)
    end repeat
    calcDollar string(totalamount), 0
    set totalAmountText = the result
    
  end if
  
  --PREPARE FINAL TEXT
  set the text of member "totaltext" = "Given your AGI, tax filing and employment status, " 
  case filingStatus of
    1:
      if deduction > 0 then
        set the text of member "totaltext" = the text of member "totaltext" & "you can contribute up to " & deductionText & " into a tax-deductible IRA."
      else 
        set the text of member "totaltext" = the text of member "totaltext" & "you cannot take a deduction for contributions to an IRA."
      end if
    2:
      if deduction > 0 then
        set the text of member "totaltext" = the text of member "totaltext" & "you and your spouse can contribute up to " & deductionText & " into a tax-deductible IRA."
      else
        set the text of member "totaltext" = the text of member "totaltext" & "you and your spouse cannot take a deduction for contributions to an IRA."
      end if
    3:
      if deduction > 0 then
        if spousededuction > 0 then
          set the text of member "totaltext" = the text of member "totaltext" & "you can contribute up to " & deductionText & " into a tax-deductible IRA.  Likewise, your spouse can contribute up to " & spouseDeductionText & "."
        else
          set the text of member "totaltext" = the text of member "totaltext" & "you can contribute up to " & deductionText & " into a tax-deductible IRA.  However, your spouse cannot take a deduction for contributions into an IRA."
        end if
      else
        if spousededuction > 0 then
          set the text of member "totaltext" = the text of member "totaltext" & "you cannot take a deduction for contributions into a tax-deductible IRA, but your spouse can contribute up to " & spouseDeductionText & "."
        else
          set the text of member "totaltext" = the text of member "totaltext" & "neither you nor your spouse can take a deduction for contributions into a tax-deductible IRA."
        end if
      end if
  end case
  
  if payment > 0 then
    case filingStatus of
      1:
        set the text of member "totaltext" = the text of member "totaltext" & RETURN & RETURN & "Based on your eligibility, the rate of return and the number of years you plan to contribute, you will have " & totalAmountText & " in your IRA at the end of this period."
      2, 3:
        set the text of member "totaltext" = the text of member "totaltext" & RETURN & RETURN & "Based on your eligibility, the rate of return and the number of years you plan to contribute, you and your spouse will have " & totalAmountText & " in your IRA at the end of this period."
    end case
    set the text of member "totaltext" = the text of member "totaltext" & "  This assumes you will not withdraw any of your IRA funds before age 59 1/2.  If you withdraw before then, you will be subject to a 10 percent penalty, plus any monies withdrawn will be subject to taxes as regular income.  The number cited is before any taxes are assessed."
  end if
end

"
-- "**********************************************************************"
-- "on keyboardNav pageNum
  global bookmarks, numBoxes, maxPages
  --DOWNARROW, TAB, RETURN
  if (the keyCode = 125) or ((the keyCode = 48) and not(the shiftDown)) then
    setAt bookmarks, pageNum, (getAt(bookmarks, pageNum) + 1)
    if getAt(bookmarks, pageNum) > getAt(numBoxes, pageNum) then
      setAt bookmarks, pageNum, getAt(numBoxes, pageNum)
      if (pageNum <> maxPages) then
        setAt bookmarks, (pageNum + 1), 1
        clearSprites
        page (pageNum + 1)
      end if
    else
      page pageNum
    end if
  end if
  
  
  
  
  --UPARROW, SHIFT-TAB
  if (the keyCode = 126) or ((the keyCode = 48) and the shiftDown) then
    setAt bookmarks, pageNum, (getAt(bookmarks, pageNum) - 1)
    if getAt(bookmarks, pageNum) < 1 then
      setAt bookmarks, pageNum, 1
      if (pageNum <> 1) then
        setAt bookmarks, (pageNum - 1), getAt(numBoxes, (pageNum - 1))
        clearSprites
        page (pageNum - 1)
      end if
    else
      page pageNum
    end if
  end if
  
  
  --HOME KEY
  if (the keyCode = 115) and (pageNum <> 1) then
    clearSprites
    page 1
  end if
  
  --END KEY
  if (the keyCode = 119) and (pageNum <> maxPages) then
    clearSprites
    page maxPages
  end if
  
  --PAGE UP
  if (the keyCode = 116) and (pageNum <> 1) then
    clearSprites
    page (pageNum - 1)
  end if
  
  --PAGE DOWN
  if (the keyCode = 121) and (pageNum <> maxPages) then
    clearSprites
    page (pageNum + 1)
  end if
end
"
-- "**********************************************************************"
