function flag_comments(obj) {
	postURL = window.location.href;
	flagcomment_id = obj.hash.replace('#flag-comment-', '');
	jQuery.post(postURL, { liveshot_flagcomment: "flag", comment_id : flagcomment_id },
		  function(data){
		    //succsess
				if (data.success==true) {
					//FNC_Theme
					if (jQuery('div.flag-comment img.flag-comment-image').length>=1) {
						imgObj = jQuery(obj).parent().prev('img.flag-comment-image');
						jQuery(obj).parent('.flag-comment-text').html('You have already flagged this comment.');
						jQuery(imgObj).attr({src:'/wp-content/themes/FNC_theme/images/report_comment+.png'});
					//other themes
					}else {
						jQuery('div#flag-comment-'+flagcomment_id).html(FOX.settings.flag_comment_flagged_markup);
					}
				}else{//failed
					
				}
				
		  }, 
	"json");
}

jQuery(document).ready(function(){
	if (jQuery.cookie('fox_flag_comments_cids')) {
		var cids = jQuery.cookie('fox_flag_comments_cids').split('_');
		jQuery.each(cids, function(i,val) {
			//FNC_Theme
			if (jQuery('div#flag-comment-'+val+' img.flag-comment-image').length>=1) {
				jQuery('div#flag-comment-'+val+' .flag-comment-text').html('You have already flagged this comment.');
				jQuery('div#flag-comment-'+val+' img.flag-comment-image').attr({src:'/wp-content/themes/FNC_theme/images/report_comment+.png'});
			//other themes
			}else{
				jQuery('div#flag-comment-'+val).html(FOX.settings.flag_comment_flagged_markup);
			}
		});
		
	}
});