<script>
    var onUserCard = false;
    $(document).ready(function(){
        $("#relateProject,.relatePInfo").mouseover(function(){
            $(".relatePInfo").css("display","block");
        })
        $("#relateProject,.relatePInfo").mouseout(function(){
            $(".relatePInfo").css("display","none");
        })
        $(".coursesLineGrey").mouseover(function(){
            $(this).css("color","#ffffff");
        })
        $(".coursesLineGrey").mouseout(function(){
            $(this).css("color","#808080");
        })
        $(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
            $(this).prev().css("color","#ffffff");
            $(this).css("z-index", "9999");
        })
        $(".homepagePostSetting").mouseout(function(){
            $(this).prev().css("color","#808080");
            $(this).css("z-index", "1");
        })
    })
</script>
<% unless org_activities.nil? %>
    <% org_activities.each do |act| %>
        <script>
            $(function() {
                sd_create_editor_from_data(<%= act.id%>, null, "100%", "<%=act.class.to_s%>");
            });
        </script>
        <% if act.container_type == 'Organization' %>
            <% if act.org_act_type == 'OrgDocumentComment' %>
                <%= render :partial => 'organizations/show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %>
            <% end %>
        <% end %>
        <% if act.container_type == 'Project' %>
            <% case act.org_act_type.to_s %>
            <% when 'Message' %>
                <%= render :partial => 'organizations/project_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
            <% end %>
        <% end %>
        <% if act.container_type ==  'Course' %>
            <% case act.org_act_type.to_s %>
            <% when 'Message'%>
                <%= render :partial => 'organizations/org_course_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
            <% end %>
        <% end %>
        <% if act.container_type == 'OrgSubfield' %>
            <% if act.org_act_type == 'Message' and act.org_act_id and Message.where("id=#{act.org_act_id}").count > 0 %>
                <% message = Message.find(act.org_act_id) %>
                <% if !message.board.course_id.nil? %>
                    <%= render :partial => 'organizations/org_course_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
                <% elsif message.board.project_id != -1 %>
                    <%= render :partial => 'organizations/project_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
                <% elsif message.board.org_subfield_id %>
                    <%= render :partial => 'organizations/org_subfield_message', :locals => {:activity => message, :user_activity_id  => act.id} %>
                <% end %>
            <% end %>
            <% if act.org_act_type == 'News' and News.where("id=?", act.org_act_id).count > 0 %>
                <% news = News.find(act.org_act_id) %>
                <%= render :partial => 'organizations/org_subfield_news', :locals => {:activity => news, :user_activity_id  => act.id} %>
            <% end %>
        <% end %>
    <% end %>

<% end %>

<% if org_act_count == 10 %>
    <%= link_to "点击展开更多",show_org_subfield_organization_path(:id => @organization.id,:page => @page.to_i + 1,:sub_dir_name => params[:sub_dir_name]),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
<% end%>