function a(path,a) {
    //we can save mutiple clicks in persistent cookie and send to server once
    last_url = get_cookie("u");

    if(!a) {
        a = 0;
    }
    else {
        last_a = get_cookie("a");
        if(last_a && last_a == a) {
            a = 0;
        }
        else {
            set_cookie("a",a);
        }
    }
    if(last_url && last_url == window.location.href) {

    }
    else {
        last_url = window.location.href;
        set_cookie("u",last_url);
        var s = "<script charset='UTF-8' src='"+path+"/counter.htm?a="+a+"&u="+encodeURIComponent(document.location)+"&r="+encodeURIComponent(document.referrer)+"'></script>";
        document.write(s);
    }
}