+ def active_banners()
+ all_banners().reject do |k,v|
+ enddate = v[:enddate]
+ parsed = (enddate and Date.parse enddate rescue nil)
+ parsed.is_a?(Date) and parsed.past?
+ end
+ end
+
+ # returns the least recently seen banner that is not hidden
+ def next_banner()
+ banners = active_banners()