//All scripts runnig always in all app
var message_count = 0;

function ajax_message_start(){
	jQuery(document).ajaxStart(function(){
        message_count += 1;
        jQuery.cursorMessage('Trwa wczytywanie danych. Proszę czekać...', {hideTimeout: 0})
        jQuery('body').css('cursor','wait');
    });

    jQuery(document).ajaxStop(function(){
       jQuery('body').css('cursor','');
       message_count -= 1;
       if (message_count == 0) jQuery('#cursorMessageDiv').fadeOut('slow');
    });
}

function to_confirm(){
	jQuery('a.to_confirm').click(function(){
		if (confirm('Czy na pewno chcesz: ' + jQuery(this).attr('rel'))){
			return true;
		}
		return false;
	});
}

jQuery(document).ready(function(){
	ajax_message_start();
	to_confirm();
});