Like duirlai said, take a look at http://stackoverflow.com/questions/1440723/find-file-size-with-jquery.
Then the way you update your title with jQuery is like this...
$(function() {
$("a[href$='.pdf']").each(function(i, obj) {
var link = $(obj);
$.ajax({
type: "HEAD",
url: link.attr("href"),
success: function() {
var length = request.getResponseHeader("Content-Length");
if (!isNaN(parseInt(length))) {
var fileSize = readablizeBytes(length);
link.attr("title", "PDF, "+ fileSize +", opens in a new window");
}
}
})
})
});
// From http://web.elctech.com/2009/01/06/convert-filesize-bytes-to-readable-string-in-javascript/
function readablizeBytes(bytes) {
var s = ['bytes', 'kb', 'MB', 'GB', 'TB', 'PB'];
var e = Math.floor(Math.log(bytes)/Math.log(1024));
return (bytes/Math.pow(1024, Math.floor(e))).toFixed(2)+" "+s[e];
}