/*console.log('tes');*/
function get_responses(id)
{
    $("#replies-"+id).html("<img src=\"/image/miniloading.gif\" />");
    $.get("/action/get_responses.php", {id:id}, function (data) {
        $("#replies-"+id).html(data);
        /*$("#replies-"+id).hide();*/
        $("#replies-"+id).removeClass("hidden");
        /*$("#replies-"+id).show();*/
	$("#_get_response_"+id).hide();
    });
    return false;
}
function reply(id)
{
   $("#comment-"+id+" .comment-content").html($("#comment-"+id+" .comment-content").html()+
             "<div class=\"reply-form\"><form>"
            +"<textarea id=\"reply-content-"+id+"\" name=\"content\"></textarea><br /><input onclick=\"return do_reply("+id+")\" type=\"submit\" value=\"Svara\" />"
            +"</form></div>");
   return false;
}

function do_reply(id)
{
    $.post("/action/reply.php", {id: id, content: $("#reply-content-"+id).val()}, function (d) {
        $(".reply-form").html("<img src=\"/image/miniloading.gif\" />");
        $(".reply-form").remove();
        get_responses(id);
    });
    return false;
}
