好库网
function favoriteStore(obj, storeid) {
    var type = 1;
    if (obj.src.indexOf("unfavorite_star.png") != -1) {
        type = 0;
    }
    $.post("/zpingtai/favoriteStore.aspx?type=" + type + "&id=" + storeid,
                       { cache: false }, function (data) {
                           if (data == "0") { alert("先登录,才能收藏成功!"); }
                           else if (type == 1) {
                               obj.src = "/Public/pt/dc1/images/unfavorite_star.png";
                               obj.title = "点此移出收藏";
                           }
                           else {
                               obj.src = "/Public/pt/dc1/images/favorite_star.png";
                               obj.title = "登录后点击收藏";
                           }
               });
 }