// Funciones JQuery !!!

// add parser through the tablesorter addParser method 
$.tablesorter.addParser({ 
    // set a unique id
    id: 'fecha',
	is: function(s) {
		// return false so this parser is not auto detected 
        return false;
	},
	format: function(s,table) {
		var c = table.config;
		var x = s;
        s = x.substr(6) + '/';
        s += x.substr(3,2)+ '/';
        s += x.substr(0,2);
		s = s.replace(/\-/g,"/");
		s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3");
		return $.tablesorter.formatFloat(new Date(s).getTime());
	},
	type: "numeric"
});

$(document).ready(function() 
    { 
        $("#tablatorneos").tablesorter({headers: {1: {sorter: 'fecha'}, 2: {sorter: 'fecha'}}})
        				  .tablesorterPager({container: $("#pager"), size: 10});
        
        $(".volver").click(ira);
    }
);

function ira(){
	x = $(this).attr("href");
	location.href = x;
}
