function addref(a,ref){
    var url = a.href.replace(/#.*$/, "");
    var hash = a.hash.replace(/#/,"");
    var text = encodeURI(a.innerHTML);
    $.get(url+"?ref="+ref+"&hash="+hash,
    {},
    function(data,status) {location.href=a.href;});
    $.get(url+"?ref="+ref+"&text="+text,
    {},
    function(data,status) {location.href=a.href;});
    return false;
}



