// JS for the comments page

var vPostId = '';

$(document).ready(function(){

	//Code to handle "Report This" clicks and vote links
	$('.reportThisLink, .voteLink').click(function(){
		
		var msg = "";
		
		if ($(this).attr('class') == 'reportThisLink'){
			msg = "<div>This comment has been flagged.</div>";					
		} else {
			msg = '<span>Thank you for voting</span>';
		}

		var thisLink = this;

		// now send an ajax request to flag this
		$.get(
			$(thisLink).attr('href'),
			 function(){
				// replace the text
				$(thisLink).after(msg);
				$(thisLink).remove();
			 });
		return false;

	}); // end of vote/report click handler


}); // end of document ready function
