function editComment(field_name) {
	$j('#old_comment_'+field_name).hide();
	$j('#edit_comment_form_'+field_name).show();
}

function cancelComment(field_name) {
	$j('#comment_text_'+field_name).val($j('#old_comment_text_'+field_name).text());
	$j('#old_comment_'+field_name).show();
	$j('#edit_comment_form_'+field_name).hide();
}

function saveComment(wniosekid, field, comment) {
	$j.post('index.php', {_mod : 267, id_wniosku: wniosekid, question_id: field, comment_text: comment}, saveCommentReturn, 'json')
}

function saveCommentReturn(data, textStatus) {
	if( data.response == 'ok' ) {
		$j('#edit_comment_form_'+data.field).hide();
		$j('#old_comment_text_'+data.field).html($j('#comment_text_'+data.field).val().replace("\n", '<br />'));
		$j('#old_comment_'+data.field).show();
		alert('Zmiany zostały zapisane.');
		
	}
//	console.log('saveCommentReturn');
//	console.log(textStatus);
//	console.log(data);
	
	  // data could be xmlDoc, jsonObj, html, text, etc...
	  // this; // the options for this ajax request
	  // textStatus can be one of:
	  //   "timeout"
	  //   "error"
	  //   "notmodified"
	  //   "success"
	  //   "parsererror" 
	  // NOTE: Apparently, only "success" is returned when you make
	  // an Ajax call in this way. Other errors silently fail.
	  // See above note about using $.ajax.
	  
	}

