$ ->
$("#list_entry_localeze_categories").chosen max_selected_options: 3, placeholder_text_multiple: "Select up to Three"
$("#how").click ->
$(".how").toggle()
elem = $("#chars")
$("#set_all").click all_days_same
$("#set_MF").click all_MF
$("#set_clear").click clear_times
$.each [
"sun"
"mon"
"tues"
"wednes"
"thurs"
"fri"
"satur"
], (i, day) ->
$("#hours_#{day}day_close").insertAfter "#hours_#{day}_open"
$("#hours_sunday_close").after " [Apply To All]"
$("#hours_monday_close").after " [Set Monday-Friday]"
$("#set_all").click all_days_same
$("#set_MF").click all_MF
$("#set_clear").click clear_times
for i in [0..9]
$("#payment_types_commadelimited_#{i}").click clear_payment_types
$("#list_entry_Phone").mask "(999) 999-9999"
$("#list_entry_AltNumber").mask "(999) 999-9999"
$("#list_entry_Fax").mask "(999) 999-9999"
clear_payment_types = ->
unchecked = true
for i in [1...9]
$("#payment_types_commadelimited_#{i}").prop "checked", ""
return
check_payment_types = ->
unchecked = true
for i in [1...9]
if $("#payment_types_commadelimited_#{i}").is(":checked")
$("#payment_types_commadelimited_0").prop "checked", ""
unchecked = false
$("#payment_types_commadelimited_0").prop "checked", "checked" if unchecked
all_days_same = ->
open_time = $("#hours_sunday_open").val()
close_time = $("#hours_sunday_close").val()
$("select[id*=day_open]").val open_time
$("select[id*=day_close]").val close_time
false
all_MF = ->
open_time = $("#hours_monday_open").val()
close_time = $("#hours_monday_close").val()
$("select[id*=day_open]:not(select[id*=sunday]):not(select[id*=saturday])").val open_time
$("select[id*=day_close]:not(select[id*=sunday]):not(select[id*=saturday])").val close_time
false
clear_times = ->
open_time = ""
close_time = ""
$("select[id*=day_open]").val open_time
$("select[id*=day_close]").val close_time