function Comment()
{
	this.url_website = '';
	this.phrase_proceed = '';
	
	this.create = function(global_id, type, refers_to_game_id, additional_info)
	{
		var text = $('textarea[name=\'message\']').val();
		
		$.ajax({
				type: 'POST',
				url: this.url_website+'site_ajax.php',
				data: {action: 'createComment', global_id: global_id, type: type, content: text, refers_to_game_id: refers_to_game_id, additional_info: additional_info},
				success: function(response)
				{
					var reg_exp = /id="comment_([0-9]*)"/;
					reg_exp.exec(response);
					var comment_id = RegExp.$1;
					$('div#comments').append(response);
					
					$('div#comment_'+comment_id).fadeIn(2000);
					
					$('textarea[name="message"]').val('');
				}
			});
	}
	
	this.deleteComment = function(comment_id)
	{
		var confirm_response = window.confirm(this.phrase_proceed+'?');
		if (confirm_response == true)
		{
			$.ajax({
				type: 'POST',
				url: this.url_website+'site_ajax.php',
				data: 'action=deleteComment&comment_id='+comment_id,
				success: function(text)
				{
					// Es gibt keine Response, es kann nicht fehlschlagen, man muss also keinen Status oder Ähnliches auslesen, bzw if-Abfrage
					$('div#comment_'+comment_id).fadeOut(2000, function() {
						$('div#comment_'+comment_id).remove();
					});
				}
			});
		}
	}
}
