$(function(){
  ////////////////////////////////////////////////////////
  // Mark Abuse / Inappropriate Content
  // Modeled on similar function in _postControlUgcMessage.js
	
  $('a.flag_abuse_for_asset').live('click', function(){
  if (confirm('Are you sure you want to report this as abuse?')) {
	eval('var type_and_id_array = ' + $(this).attr('rev') + ';'); // should be of form [123,456]
      $.getJSON('/contact/postcontactform', { 
    	'assettype_id' : type_and_id_array[0],
    	'asset_id' : type_and_id_array[1],
        'comments' : 'User flagged abuse or inappropriate content',
        'fix_subject' : 1,
        'from_addr' : 'noreply@filife.com',
        'from_name' : 'site user',
        'recipient' : 'abuse',
        'subject' : 'Questionable content'
        }, function(json){
           $('div.flag_abuse_for_asset_' + type_and_id_array[1]).replaceWith('<div class="tm_1 bm_1 strong txtmd neg_highlight">Thank you.  FiLife\'s site moderators have been notified.</div>');
       });
     }
  return false;
  });

});
