         error_y = $context.find('.unhappy').first().offset().top - header_height - 20
         scrollTo(0, error_y)
 
-window.pluralize_like_count = (like_count) ->
-    if like_count is 1 then 'like' else 'likes'
 
 if gon.page is 'stores_show' or gon.page is 'products_show' or gon.page is 'products_index' or gon.page is 'stores_new'
     # only reveal product gallery controls if there

    toggle_menu = -> ($ '#menu').toggle()

    if has_touch_events
        ($ '.mobile-layout-inner').css('padding-top', header_height)
        ($ '#menu_button').tap((e) ->
            e.preventDefault()

window.templates = {}

window.forceReflow = (elem = document.documentElement) ->
    # http://stackoverflow.com/questions/11297641/mobile-webkit-reflow-issue/11479118#11479118
    width = elem.style.width
    px = elem.offsetWidth + 1
    elem.style.width = px+'px'

    setTimeout ->
        elem.style.width = width
        elem = null
    0

window.pluralize_like_count = (like_count) ->
    if like_count is 1 then 'like' else 'likes'

$ ->
    window.header_height =  ($ '.mobile-header').height()
