<% if index == 2%>
<% k.each do |c1|%>
<%= link_to_attachment c1, {:download => true}%>
<%= c1.downloads %>
<%= link_to_attachment c1, {:download => true, :text => image_tag("/images/button/download.png", width: "22px", alt: l(:button_download)) }%>
<% end -%>
<%else%>
<% k.each do |c1|%>
<%= link_to c1.filename, (attachFromUrl c1), {:title => c1.filename, :target => "_blank"} %>
<%= c1.downloads %>
<%= link_to_attachment c1, {:download => true, :text => image_tag("/images/button/download.png", width: "22px", alt: l(:button_download)) }%>
<% end -%>
<% end %>