Event.observe(window, 'load', function(event) {
	try {
		var button = $('print_button');
		
		Event.observe(button, 'click', function(event) {
			window.print();
		});
	} catch (e) {
	}
	$$('[rel="popup"]').each(function(element) {
		element.onclick = function() {
			window.open(element.getAttribute('href'), 'popup', 'width=800,height=600,resizable=yes,scrollbars=yes,status=yes');
			return false;
		};
	});
	$$('[rel="delete"]').each(function(element) {
		Event.observe(element, 'click', function(event) {
			if (!confirm('Czy na pewno chcesz usunąć tą pozycję?')) {
				event.preventDefault();
			}
		});
	});
	$$('[rel="paid"]').each(function(element) {
		Event.observe(element, 'click', function(event) {
			if (!confirm('Czy na pewno chcesz oznaczyć tą fakturę jako opłaconą?')) {
				event.preventDefault();
			}
		});
	});
});