 
 
 
-hideBeenPaidYetWrapOnY = (o) ->
+hideBeenPaidYetWrapOnY = (o,reset) ->
   label(o.howMuchPaid).text(o.howMuchPaidYText)
-  val(o.howMuchPaid,"")
+  val(o.howMuchPaid,"") if reset
   legend(o.whatDatePaid).html(o.whatDatePaidYText)
-  val(o.whatDatePaidDay,"")
-  val(o.whatDatePaidMonth,"")
-  val(o.whatDatePaidYear,"")
+  val(o.whatDatePaidDay,"") if reset
+  val(o.whatDatePaidMonth,"") if reset
+  val(o.whatDatePaidYear,"") if reset
   label(o.howOften).text(o.howOftenYText)
-  val(o.howOften,"")
+  val(o.howOften,"") if reset
   label(o.monthlyPayDay).text(o.monthlyPayDayYText)
-  val(o.monthlyPayDay,"")
+  val(o.monthlyPayDay,"") if reset
   textToUse = switch (val(o.howOften))
     when "weekly" then o.usuallyPaidSameAmountWeeklyText
     when "fortnightly" then o.usuallyPaidSameAmountFortnightlyText

# What Costs function
#
window.whatCosts = (careCostsForThisWorkY, careCostsForThisWorkN, whatCosts) ->
  S(careCostsForThisWorkY).on "click", -> S("whatCostsWrap").slideDown 0

  S(careCostsForThisWorkN).on "click", -> S("whatCostsWrap").slideUp 0, -> val(whatCosts,"")

    when "monthly" then o.usuallyPaidSameAmountMonthlyText
    else o.usuallyPaidSameAmountOtherText

  legend(o.usuallyPaidSameAmount).html(textToUse)
  checked(o.usuallyPaidSameAmountY, false) if reset
  checked(o.usuallyPaidSameAmountN, false) if reset

hideBeenPaidYetWrapOnN = (o,reset) ->
  label(o.howMuchPaid).text(o.howMuchPaidNText)
  val(o.howMuchPaid,"") if reset
  legend(o.whatDatePaid).html(o.whatDatePaidNText)
  val(o.whatDatePaidDay,"") if reset
  val(o.whatDatePaidMonth,"") if reset
  val(o.whatDatePaidYear,"") if reset
  label(o.howOften).text(o.howOftenNText)
  val(o.howOften,"") if reset
  label(o.monthlyPayDay).text(o.monthlyPayDayNText)
  val(o.monthlyPayDay,"") if reset
  textToUse = switch (val(o.howOften))
    when "weekly" then o.usuallyPaidSameAmountWeeklyTextExpected
    when "fortnightly" then o.usuallyPaidSameAmountFortnightlyTextExpected
