Here is a quick solution for you, by using some html5 attributes... Actually it was also possible before html5 but it wasn't validating.
I'd create the links as below:
_here we put your parameters to data attributes
and write the js like this:
$(function(){
//use mouseup, then it doesn't matter which button
//is clicked it will just fire the function
$('.myClazzz').bind('mouseup', function(e){
//get your params from data attributes
var row = $(this).attr("data-row"),
index = $(this).attr("data-index");
//and fire the function upon click
countLinks(row,index);
});
});
//don't forget to include jquery, before these lines;)
Hope this works out. Sinan.
PS myClazzz -> credits goes to jAndy :)