//----start function used in comments.php to add comment to post----//
function wp_comment_post_ajax (baseURL) {
	var comment_post_ID = jQuery("#comment_post_ID").val();
	var author = jQuery("#author").val();
	var email = jQuery("#email").val();
	var url = jQuery("#url").val();
	var comment = jQuery("#comment").val();
	var remember = jQuery("#remember").attr("checked");
	var forget = jQuery("#forget").attr("checked");

	jQuery.ajax({
		type: "POST",
		url: baseURL + "/wp-comments-post-ajax.php?action=1",
		data: "comment_post_ID=" + comment_post_ID + "&author=" + author + "&email=" + email + "&url=" + url + "&comment=" + comment + "&remember=" + remember + "&forget=" + forget,
		beforeSend: function() {
			jQuery("#submit").attr("disabled","disabled");
		},
		success: function(msg){
			if(msg == "1") {
				jQuery("#notif_msg").text("Your comment has been added.");
				jQuery("#comment_form").hide("slow");
			}
			else {
				jQuery("#error_msg").text(msg);
				jQuery("#submit").attr("disabled","");
			}
		}
	});
}
//----end function used in comments.php to add comment to post----//

//----start function used in comments.php to forget my information----//
function forget (baseURL) {
	jQuery.ajax({
		type: "GET",
		url: baseURL + "/wp-comments-post-ajax.php?action=2",
		success: function(msg){
			if(msg == "1") {
				jQuery("#forget").text("Done");
			}
		}
	});
}
//----end function used in comments.php to forget my information----//