jQuery(document).ready(function() {
	jQuery("a.paging_first").bind("click",
		function(event){
			clickCount(jQuery("a.paging_first"),"pg");
		});
	jQuery("a.paging_previous").bind("click",
		function(event){
			clickCount(jQuery("a.paging_previous"),"pg");
		});
	jQuery("a.paging_next").bind("click",
		function(event){
			clickCount(jQuery("a.paging_next"),"pg");
		});
	jQuery("a.paging_last").bind("click",
		function(event){
			clickCount(jQuery("a.paging_last"),"pg");
		});									
});

function clickCount(a,identifier){
	var href = a.attr("href") + "?ref=" + identifier;
	if("true" != a.attr("clickcounter_set")){
		a.attr("clickcounter_set","true");
		a.attr("href", href);	
	}
}