<div class="top-content">
  <%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get, :id => 'contests_serch') do %>
      <table width="940px">
        <tr>
          <td class="info_font" style="width: 220px; color: #15bccf" rowspan="2">
            <a href="http://<%= Setting.host_contest%>" style="color: #15bccf;">
              <%=l(:label_contest_innovate_community)%>
            </a>
          </td>
          <td class="location-list">
            <strong><%= l(:label_user_location) %> :</strong>
          </td>
          <td rowspan="2" valign="bottom">
            <% if User.current.logged? %>
                <% unless User.current.user_extensions.identity == 1 %>
                    <%= link_to(l(:label_newtype_contest),  new_contest_contests_path, :class => 'icon icon-add', :target => "_blank") %>
                    <!-- end longjun -->
                <% end %>
            <% end %>
          </td>
          <td rowspan="2" >
            <div class="project-search" style="float: right">
              <script type="text/javascript">
                function regexName1()
                {
                    var name = $.trim($("#name").val());
                    if(name.length == 0)
                    {
                        $("#contest_name_span_head").text("<%= l(:label_search_conditions_not_null) %>");
                        $("#contest_name_span_head").css('color','#ff0000');
                        $("#contest_name_span_head").focus();
                        return false;
                    }
                    else
                    {
                        $("#contest_name_span_head").text("");
                        return true;
                    }
                }

                function submitSerch()
                {
                    if(regexName1()){$("#contests_serch").submit();}
                }
              </script>
              <%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => 'regexName1();', :width => "125px" %>
              <%= hidden_field_tag 'project_type', params[:project_type] %>
              <%#= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
              <%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
              <br />
              <span id="contest_name_span_head"></span>
            </div>
          </td>
        </tr>
        <tr>
          <td >
            <%=link_to l(:field_homepage), home_path %> >
            <a><%= l(:label_contest_innovate) %></a>
            <!-- end longjun -->
          </td>
        </tr>
      </table>
  <% end %>
</div>
<% if @contests.size > 0%>
    <%#= sort_contest(@s_state)%>
    <div id="bid-show" class="projects-index">
      <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
    </div>
<% elsif @is_search%>
    <%= render :partial => "layouts/no_content"%>
<% else %>
    <%#= sort_contest(@s_state)%>
    <div id="bid-show" class="projects-index">
      <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
    </div>
<% end %>

<% html_title l(:label_contest_list)%>
