﻿




//给所有列表用途功能加上连接
$(document).ready(function() {


    $('.linkfunction a').click(function() {
        this.href = "/Product/HomeFunction/" + this.id;

    });


    $('.linkfunction').each(function() {
        var productId = $(this).attr("value");
        var tr = $(this);
        if (productId != "undefined") {
            var content = "用途:";
            $.ajax({ type: "POST", url: "/TagWarehouse/GetTag/" + productId + ".html", data: "tagType=4&topN=" + 20, success: function(xml) {
                var data = eval(xml);

                $.each(data,function(i,n) {

                    content = content + "<a href='/Product/ListTag/" + n.tagID+ ".html?currPage=1&tagType=4'>" +n.tagName + "<\/a> &nbsp;";

                });

                tr.html(content);
            }


            });


        }

    });

});


function commendClick(productid, productname, Classify) {


    if (isLogin()) {
        switch (Classify) {
            case 1:

                Openwould(productid, productname, "commend"); //打开有用
                OpenMessageBox("control:commend;width:600;height:250;title:想用");
                break;
            case 2:
                Opencommend(productid, productname, "commend"); //打开推荐
                OpenMessageBox("control:commend;width:600;height:250;title:推荐");
                break;
            case 3:
                OpewReview(productid, productname, "commend"); //打开评论
                OpenMessageBox("control:commend;width:600;height:250;title:我要评价");
                break;
        }

    }

}


//添加到藏夹   
function collectclcik(id) {
    if (isLogin()) {
        $.ajax({ type: "POST", url: "/Collect/Create.html", data: "product_id=" + product_id, success: function(xml) {
            alert(xml);

        }
        });


    }

}


