Any violation of this chapter or of any order, requirement, decision or determination issued by the Building Inspector pursuant to this chapter is hereby declared to be an offense, punishable by a fine not exceeding $1,000 or imprisonment for a period not to exceed six months, or both, upon conviction for a first offense; upon conviction for a second offense, both of which offenses were committed within a period of five years, punishable by a fine not less than $1,000 nor more than $5,000 or imprisonment for a period not to exceed six months, or both; and upon conviction for a third or subsequent offense, all of which offenses were committed within a period of five years, punishable by a fine not less than $2,500 nor more than $10,000 or imprisonment for a period not to exceed six months, or both. However, for the purpose of conferring jurisdiction upon courts and judicial officers generally, violations of this chapter or of any order, requirement, decision or determination issued by the Building Inspector pursuant to this chapter shall be deemed misdemeanors, and for such purpose only all provisions of law relating to misdemeanors shall apply to such violations. Each week's continued violation shall constitute a separate additional violation.