<% if @has_commit %>
    $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/has_commit_work') %>');
    showModal('ajax-modal', '500px');
    $('#ajax-modal').siblings().remove();
    $('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
            "<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
    $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
    $('#ajax-modal').parent().addClass("anonymos");
<% elsif @submit_result%>
    $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_information') %>');
    showModal('ajax-modal', '500px');
    $('#ajax-modal').siblings().remove();
    $('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
            "<a href='/student_work/"+ <%=@student_work.id%> +"/retry_work' class='upload_btn' data-remote='true'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
    $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
    $('#ajax-modal').parent().addClass("anonymos");
<% else %>
    window.location.href = '<%= new_student_work_url(:homework => @homework.id)%>';
<% end %>

function clickCanel() {
    hideModal('#popbox02');
    window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>';
}