<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <script>
      $(document).ready(function(){
          $(".resourcePopupClose").click(function(){
              $(".shareDP").css("display","none");
          });
          $(".sectionRow").toggle(
                  function(){
                      $(this).next().css("display","block");
                  },
                  function(){
                      $(this).next().css("display","none");
                  }
          );
      });
      function join_org(){
          if ($("#org_subfield_list input[type='checkbox']:checked").size() == 0)
          {
              alert("您还没有选择栏目！");
          }
          else
          {
              $("#join-form").submit();
          }
      }
  </script>
</head>

<body>

  <div>
    <div class="relateText fl mb10">发送到</div>
  </div>
  <div class="cl"></div>
  <div class="sectionWrap fl">

    <div class="pl10 fontGrey3 sectionRow">
      <span class="shareArrow"></span>我的组织
    </div>
    <ul class="fontGrey3 sectionContent" id="sectionContent3">
      <% organizations.each do |org| %>
          <li><span><%= link_to org.name, messages_get_subfield_on_click_org_path(:organization_id => org.id), :remote => true,:style =>"border:none; outline:none;"  %></span></li>
      <% end %>
    </ul>
  </div>
  <%= form_tag url_for(:controller => 'messages', :action => 'join_org_subfields', :id => id), :id => 'join-form', :remote => true %>
  <div id="org_subfield_list">
    <%= render :partial => 'show_org_subfields', :locals => {:org => nil} %>
  </div>
  <div class="cl"></div>
  <div class="courseSendCancel mr2" style="float:right;"><a href="javascript:void(0);" onclick="hideModal();" class="sendSourceText">取消</a></div>
  <div class="courseSendSubmit" style="float:right;"><a href="javascript:void(0);" onclick="join_org();" class="sendSourceText">确定</a></div>
  <div class="cl"></div>

</body>
</html>
