// have: <td>1420</td>
// want: <td><a class="ct" href="oneclub.php?club=1420" rel="oneclub.php?club=1420">1420</a></td>

$(function() {
	// get the first cell of each table row
	$("td:first-child").each(function(){
		var clubnumber = $(this).text();
		$(this).empty();
		var url = '"oneclub.php?club=' + clubnumber + '"';
		var h1 = ' href=' + url;
		var h2 = ' rel=' + url;
		$(this).html('<a class="ct"' + h1 + h2 + '>' + clubnumber + '</a>');
	});
	$(".ct").cluetip({ width:'400px', arrows:true, sticky:true, showTitle:false });
});

function gtxt() {
	var t = $("td:first-child").text();
	$("#quote").text(t);
}
$(function() { $("#showtxt").click(gtxt()); } );

// add charter date parser through the tablesorter addParser method
$(function() {
    $.tablesorter.addParser({
        // set a unique id
        id: 'charter',
        is: function(s) {
            // return false so this parser is not auto detected
            return false;
        },
        format: function(s) {
            // format your data for normalization
			a = s.split('/')
			a[1] > 25 ? y = '19' + a[1] : y = '20' + a[1]
			return y + a[0]
        },
        // set type, either numeric or text
        type: 'numeric'
    });
});

$(function() {$("#clublist").tablesorter({ headers: { 0: {sorter: "digit"}  }});});

