$('div.favorite a.addlink').click( 
    function() {
        this.href = this.href + "&jq=1";
        $.get(this.href, 
            function(data) { 
                var d = $('#fave' + data);
                if(d.hasClass("added")) {
                    d.removeClass("added");
                    d.find("a.addlink").html("Add to Favorites");
                    d.find("a.viewlink").hide();
                    if(show_favorites) {
                        d.parent().hide();
                        var f = $('#foundCount');
                        f.html(f.html() -1);
                    }
                } else {
                    d.addClass("added");
                    d.find("a.addlink").html("Remove from Favorites");
                    d.append('<a class="viewlink" href="search?show_favorites=1&filler=1">View Your Favorites &raquo;</a>');
                }
            }
        );
        return false;
    }
);

$('div.show_favorites div.favorite a').click(
    function() {
    }
);

