$ ->

  if ($('#time-schedule-index-page').length > 0)

    $('.show-hide-details-button').click ->
      $this = $(@)
      elementID = $this.data('details-id')
      
      elementID = "#"+elementID
      displayVal = $(elementID).css("display")
      if $(elementID).css("display") == "none"
        $(elementID).slideDown("slow")
        $this.toggleClass('icon-plus icon-minus')
      else  
        $(elementID).slideUp("slow")
        $this.toggleClass('icon-minus icon-plus')

  if ($('#time-schedule-create-page').length > 0)
    
    $('.dynamic-tabular-form-addrow-button').click ->
      setTimeout (->
        $('.dayofyear-picker').datetimepicker
          language: settings.language
          pickSeconds: false
          pickDate: true
          pickTime: false
          format: settings.dayofyearpicker_format
            
        $('.time-picker').datetimepicker
          language: settings.language
          pickSeconds: false
          pickDate: false
          format: settings.timepicker_format      
    
      ), 1200
          
  if ($('#time-schedule-update-page').length > 0)
    $('.dynamic-tabular-form-addrow-button').click ->
      setTimeout (->
        $('.dayofyear-picker').datetimepicker
          language: settings.language
          pickSeconds: false
          pickDate: true
          pickTime: false
          format: settings.dayofyearpicker_format
            
        $('.time-picker').datetimepicker
          language: settings.language
          pickSeconds: false
          pickDate: false
          format: settings.timepicker_format      
    
      ), 1200                