function confirmDeleteDocument(){
    return confirm('Czy jesteś pewien, że chcesz usunąć dokument?');
}

$(document).ready(function(){
    $('input#selectPage').blur(function () {
    	var page = $('input#selectPage').val().match(new RegExp("\\d{1,}", "g"))
    	var dest = $('a#nextPage').attr('href').replace(new RegExp("page=\\d{1,}", "g"), 'page='+page[0]);
    	location.href= dest;
    });
    
    $('input#selectPage').keypress(function (e) {
      if (e.which == 13 ) {
        var page = $('input#selectPage').val().match(new RegExp("\\d{1,}", "g"))
    	var dest = $('a#nextPage').attr('href').replace(new RegExp("page=\\d{1,}", "g"), 'page='+page[0]);
    	location.href= dest;
      } 
    });
    
    
    
    $("select#orderby").change(function(){
//        $.ajax({
//            url: "getContent.php",
//            type: 'POST',
//			data: {
//                plugin: 'dokumentList',
//                content: 'getNews',
//				order: $(this).val()
//            },
//            success: function(data){
//                $('div#listaDokumentowMainPage').replaceWith(data);
//            }
//        });
//		var tmp = document.URL.match(new RegExp(/(.*)?&order/));
//		if (document.URL.match(new RegExp('.*(&order=.*).*'))){
//			alert('jest');
//		}else{
//			alert('brak');
//		}
		
		location.href = 'strona.php?p=1&order='+$(this).val();
    });

	 
});
