%= stylesheet_link_tag 'mega_menu', 'menu_tree' %>
<%= javascript_tag nil, :src => 'http://www.google.com/jsapi' %>
<%= javascript_tag "google.load('jquery', '1.4.2')" %>
<%= javascript_include_tag 'jquery.hoverIntent.minified.js', 'mega_menu' %>
<%= content_tag :ul, :id => :menu, :class => :menu_links do %>
<%= content_tag :li, nil, :class => :placeholder unless local_assigns[:root] %>
<% prev_level = -1 %>
<% category_class.each_with_level(categories) do |category, level| %>
<%=raw '' if level <= prev_level %>
<%=raw '' * (prev_level - level) if level < prev_level %>
<%= render :partial => 'sortable_nested_set/category', :object => category %>
' * (prev_level + 1) if prev_level > -1 %>
<% end %>
<% unless categories.empty? %>
<% for category_id in sortable_ids %>
<%= sortable_element_reporting_target "items_#{category_id}",
:moved,
:containment => sortable_ids.collect { |cid| "items_#{cid}" },
:dropOnEmpty => true,
:method => :put,
:tag => :div,
:url => sns_sort_items_categories_path %>
<% end %>
<%= sortable_element_reporting_target :menu,
:moved,
:ghosting => true,
:handle => :handle,
:hoverclass => "'hovered'",
:method => :put,
:only => [ :category, :placeholder ],
:tree => true,
:url => sns_sort_categories_categories_path(:root => root) %>
<% end %>