$(function() {
	$('a.deleteReportEntry').click(function() {
		var linkTo = $(this).attr('href');
		$.dialogCreate('Wollen Sie wirklich diesen Beitrag löschen?', {
			title: 'Bestätigung',
			buttonsDefault: false,
			buttons: {
				'Ja': function() {
					document.location.href = linkTo;
				},
				'Nein': function() {
					$(this).dialog('close');
				}
			}
		});
		return false;
	});

	$('a.toggleCommentReportEntry').click(function() {
		var linkTo = $(this).attr('href');
		var textUse = $(this).attr('data-isCommentable');
		var textActive = "Wollen Sie wirklich die Kommentarfunktion aktivieren?";
		var textDeactive = "Wollen Sie wirklich die Kommentarfunktion deaktivieren?";
		if(textUse == 0) text = textActive;
		else text = textDeactive;
		
		$.dialogCreate(text, {
			title: 'Bestätigung',
			buttonsDefault: false,
			buttons: {
				'Ja': function() {
					document.location.href = linkTo;
				},
				'Nein': function() {
					$(this).dialog('close');
				}
			}
		});
		return false;
	});

	$('a.changePublicReportEntry').click(function() {
		var linkTo = $(this).attr('href');
		var textUse = $(this).attr('data-publicStatus');
		var textActive = "Wollen Sie wirklich den Beitrag veröffentlichen?";
		var textDeactive = "Wollen Sie wirklich den Beitrag sperren?";
		if(textUse == 1) text = textActive;
		else text = textDeactive;
		
		$.dialogCreate(text, {
			title: 'Bestätigung',
			buttonsDefault: false,
			buttons: {
				'Ja': function() {
					document.location.href = linkTo;
				},
				'Nein': function() {
					$(this).dialog('close');
				}
			}
		});
		return false;
	});
});
