(1) Except as otherwise provided in subsection (2) of this section, any candidate engaged in or pursuing a write-in campaign shall file a notarized affidavit of his or her intent together with the receipt for any filing fee with the filing officer as provided in section no earlier than January 5 and no later than the second Friday prior to the election.
(2) For any county office elected pursuant to sections to which is subject to subdivision (1)(b) of section , a candidate may engage in or pursue a write-in campaign if he or she files a notarized affidavit of his or her intent together with the receipt for the filing fee with the filing officer as provided in section on or before March 3 of the year of the statewide primary election. If such an affidavit is filed as prescribed, the election commissioner or county clerk shall place that county office on the statewide primary election ballot with the names of the candidate properly filed for the nomination of the applicable political party and a line for write-in candidates.
(3) A candidate submitting an affidavit under this section for a partisan office on the statewide primary election ballot shall be a registered voter of the political party named in the affidavit unless the political party allows candidates not affiliated with the party by not adopting a rule under section .
(4) A candidate who has been defeated as a candidate in the primary election or defeated as a write-in candidate in the primary election shall not be eligible as a write-in candidate for the same office in the general election unless (a) a vacancy on the ballot exists pursuant to section or (b) the candidate was a candidate for an office described in sections to and the candidate lost the election as a result of a determination pursuant to section in the case of a tie vote.
(5) A candidate who files a notarized affidavit shall be entitled to all write-in votes for the candidate even if only the last name of the candidate has been written if such last name is reasonably close to the proper spelling.
(6) If any candidate who has filed pursuant to this section notifies the filing officer in writing duly acknowledged by the second Friday prior to the election that the candidate declines to be a write-in candidate, the notarized affidavit shall be considered withdrawn and no votes shall be counted for the withdrawn candidate under sections to .