var formData = {};
formData["g-recaptcha-response"] = $(".g-recaptcha-response").val();
formData["message"] = $("#message").val();
formData.o = access_token;
$.ajax({
url: $("#mainForm").attr('action'),
type: "POST",
data: formData,
dataType: "json"
}).always(function (res) {
// if (res.sta)
if (typeof res.responseJSON == "undefined") {
data = res;
} else {
data = res.responseJSON;
}
$('*').animate({ scrollTop : 0 }, 1250);
var style = (data.err == 1) ? "color: #FFEE58 !important" : "";
if (typeof data.result == "undefined") {
var msg = data.message;
} else {
var msg = data.message + " ";
msg += "<a href=\"" + data.result.postURL + "\">";
msg += AnonyPages.i18n.go_to_your_post;
msg += "</a>";
msg += "<br />" + AnonyPages.i18n.its_hashtag_is;
msg += "<a href=\"" + data.result.hashtagURL + "\">";
msg += data.result.hashtag;
msg += "</a>";
}
$("#title_message").html("<span style=\"" + style + "\">" + msg + "</span>");
$("#submitBtn").val(oSubmitBtnVal);
$("#firstBtnTitle").html(AnonyPages.i18n.post_again);
});