$(document).ready( function() {

//###########################################################################

//////////////////////////////////////////////////////////
jQuery.fn.dataTableExt.oSort['numeric-comma-asc']  = function(a,b) {
    var x = (a == "-") ? 0 : a.replace( /,/, "." );
    var y = (b == "-") ? 0 : b.replace( /,/, "." );
    x = parseFloat( x );
    y = parseFloat( y );
    return ((x < y) ? -1 : ((x > y) ?  1 : 0));
};
 
jQuery.fn.dataTableExt.oSort['numeric-comma-desc'] = function(a,b) {
    var x = (a == "-") ? 0 : a.replace( /,/, "." );
    var y = (b == "-") ? 0 : b.replace( /,/, "." );
    x = parseFloat( x );
    y = parseFloat( y );
    return ((x < y) ?  1 : ((x > y) ? -1 : 0));
};
//////////////////////////////////////////////////////////

jQuery.fn.dataTableExt.oSort['currency-asc'] = function(a,b) {
    /* Remove any commas (assumes that if present all strings will have a fixed number of d.p) */
    var x = a == "-" ? 0 : a.replace( /,/g, "" );
    var y = b == "-" ? 0 : b.replace( /,/g, "" );
     
    /* Remove the currency sign */
    x = x.substring( 1 );
    y = y.substring( 1 );
     
    /* Parse and return */
    x = parseFloat( x );
    y = parseFloat( y );
    return x - y;
};
 
jQuery.fn.dataTableExt.oSort['currency-desc'] = function(a,b) {
    /* Remove any commas (assumes that if present all strings will have a fixed number of d.p) */
    var x = a == "-" ? 0 : a.replace( /,/g, "" );
    var y = b == "-" ? 0 : b.replace( /,/g, "" );
     
    /* Remove the currency sign */
    x = x.substring( 1 );
    y = y.substring( 1 );
     
    /* Parse and return */
    x = parseFloat( x );
    y = parseFloat( y );
    return y - x;
};
//////////////////////////////////////////////////////////












//////////////////////////////////////////////////////////
//tab_newsy
$('#tab_newsy').dataTable( {
	"aoColumns": [
		null,
		{"sClass": "less_center"},
		{ "bSortable": false , "sWidth": "20%" }
		],
	"aaSorting": [[1,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "../js/dt_1.8.2/media/js/pl_PL.txt" }
} );

//tab_nagrody
$('#tab_nagrody').dataTable( {
	"aoColumns": [
		{ "bSortable": false , "sWidth": "15%" },
		null,
		{ "bSortable": false , "sWidth": "20%" }
		],
	"aaSorting": [[1,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "../js/dt_1.8.2/media/js/pl_PL.txt" }
} );


//tab_nagrody
$('#tab_nagrody2').dataTable( {
	"aoColumns": [
		{ "bSortable": true , "sWidth": "15%" },
		null
		],
	"aaSorting": [[0,'asc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "js/dt_1.8.2/media/js/pl_PL.txt" }
} );




//tab_n_uzytkownicy
$('#tab_n_uzytkownicy').dataTable( {
	"aoColumns": [
		{ "sWidth": "45%" },
		{ "sClass": "less_center", "sType" : 'numeric'},
		{ "sClass": "less_center", "sType" : 'numeric'},
		null,
		{ "bSortable": false , "sWidth": "25%" }
		],
	"aaSorting": [[1,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "../js/dt_1.8.2/media/js/pl_PL.txt" }
} );

//tab_n_historia
$('#tab_n_historia').dataTable( {
	"aoColumns": [
		{ "sClass": "less_center", "sWidth": "15%" },
		{ "sClass": "less_center"},
		{ "sClass": "less_center"},
		{ "sClass": "less_center", "sType" : 'numeric'},
		{ "sClass": "less_center", "sType" : 'numeric'}
		],
	"aaSorting": [[1,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "../js/dt_1.8.2/media/js/pl_PL.txt" }
} );


//tab_ulotki
$('#tab_ulotki').dataTable( {
	"aoColumns": [
		{"sClass": "less_center", "sWidth": "10%"},
		null,
		null,
		null,
		null,
		{"sType" : "string"},
		{ "bSortable": false , "sWidth": "20%"}
		],
	"aaSorting": [[0,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "../js/dt_1.8.2/media/js/pl_PL.txt" }
} );


//tab_kat
$('#tab_kat').dataTable( {
	"aoColumns": [
		{"sClass": "less_center", "sWidth": "5%"},
		null,
		{ "bSortable": false , "sWidth": "20%"}
		],
	"aaSorting": [[0,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "../js/dt_1.8.2/media/js/pl_PL.txt" }
} );


//tab_firma
$('#tab_firma').dataTable( {
	"aoColumns": [
		{"sClass": "less_center", "sWidth": "5%"},
		null,
		{ "bSortable": false , "sWidth": "20%"}
		],
	"aaSorting": [[0,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "../js/dt_1.8.2/media/js/pl_PL.txt" }
} );

//tab_promocje
$('#tab_promocje').dataTable( {
	"aoColumns": [
		{"sClass": "less_center", "sWidth": "5%"},
		{"sClass": "less_center", "sWidth": "5%"},
		null,
		null,
		null,
		null,
		{"sType": "html"},
		{ "bSortable": false , "sWidth": "15%"}
		],
	"aaSorting": [[0,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "../js/dt_1.8.2/media/js/pl_PL.txt" }
} );


//tab_produkt
$('#tab_produkt').dataTable( {
	"aoColumns": [
		null,
		{ "bSortable": false , "sWidth": "15%"},
		{ "bSortable": false , "sWidth": "10%", "sClass": "less_center"}
		],
	"aaSorting": [[0,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": true,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "../js/dt_1.8.2/media/js/pl_PL.txt" }
} );


//tab_tresc -admin
$('#tab_tresc_pliki').dataTable( {
	"aoColumns": [
		{"sWidth": "60%"},
		{ "sClass": "less_center"},
		{ "bSortable": false , "sWidth": "20%", "sClass": "less_center"}
		],
	"aaSorting": [[0,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "../js/dt_1.8.2/media/js/pl_PL.txt" }
} );

//#tab_tresc - ogólnodostępne
$('#tab_tresc').dataTable( {
	"aoColumns": [
		{"sWidth": "60%"},
		{ "sClass": "less_center"},
		],
	"aaSorting": [[0,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "js/dt_1.8.2/media/js/pl_PL.txt" }
} );

/*	"bStateSave": false,
	"bAutoWidth": false,
	"bLengthChange": true,
	"iDisplayLength": 50,
	"oLanguage": { "sUrl": "js/dt_1.8.2/media/js/pl_PL.txt" }*/


//tab_ulotki
$('#tab_produkty').dataTable( {
	"aoColumns": [
		{"sWidth": "70%"},
		{ "sClass": "less_center", "sType" : 'numeric-comma'},
		{ "sClass": "less_center", "sType" : 'numeric-comma'},
		null
		],
	"aaSorting": [[0,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "js/dt_1.8.2/media/js/pl_PL.txt" }
} );

//tab_ulotki
$('#tab_szukaj').dataTable( {
	"aoColumns": [
		{"sWidth": "70%"},
		{ "sClass": "less_center", "sType" : 'numeric-comma'},
		{ "sClass": "less_center", "sType" : 'numeric-comma'},
		null
		],
	"aaSorting": [[0,'desc']], 
	"bLengthChange": true,
	"iDisplayLength": 50,
	"bStateSave": false,
	"bAutoWidth": true,
	"oLanguage": { "sUrl": "js/dt_1.8.2/media/js/pl_PL.txt" }
} );

//###########################################################################

//koniec document.ready()
} );

